Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in Method 'HandleToObject' of object IAcadDocument

Status
Not open for further replies.

LikidSoul

Programmer
Feb 4, 2004
1
ES
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





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top