Hello,
I'm working with AutoCAD and VBA, and I've got a big problem
I'm using the instruction 'HandleToObject' like this
Dim objEnt(0) as AcadEntity
MyObjectHandle = "45D3"
Set objEnt(0) = ThisDrawing.Application.ActiveDocument.HandleToObject(MyObjectHandle)
objEnt(0).Visible = True
objEnt(0).Color = acGreen
objEnt(0).Update
Until here, everything is perfect... But if I put this instruction in a Bucle, because I need to localize and re localize lots of objects inside my drawing, I get this message:
Method 'HandleToObject' of object IAcadDocument failed.
It appears the second time I use the instruction... What it happens? I use 'set objent(0)= nothing', but it doesn't work.
Anybody knows how I can avoid it? Thanks a lot from now on...
LikidSoul
I'm working with AutoCAD and VBA, and I've got a big problem
I'm using the instruction 'HandleToObject' like this
Dim objEnt(0) as AcadEntity
MyObjectHandle = "45D3"
Set objEnt(0) = ThisDrawing.Application.ActiveDocument.HandleToObject(MyObjectHandle)
objEnt(0).Visible = True
objEnt(0).Color = acGreen
objEnt(0).Update
Until here, everything is perfect... But if I put this instruction in a Bucle, because I need to localize and re localize lots of objects inside my drawing, I get this message:
Method 'HandleToObject' of object IAcadDocument failed.
It appears the second time I use the instruction... What it happens? I use 'set objent(0)= nothing', but it doesn't work.
Anybody knows how I can avoid it? Thanks a lot from now on...
LikidSoul