Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

use of handle property (OLE Object)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
GeryKnee
304 Views, 2 Replies

use of handle property (OLE Object)

 

I don't know if i am in the right forum.

I need help about how to use the handle property to retrieve an object

 

example

 suppose obj - a line for example is an OleVariant that is associated to the drawing object.

 OH = obj.handle is the unique handle (of type string) of object and can be used to retrieve the object , but

 trying to retrieve it , i use the reference

   SearchObj = Acad.ActiveDocument.ModelSpace.Item(OH)

  the below causes error , that means ModelSpace is the wrong collection the item belongs to

 So, what is the collection in wich i can find the object using handle

2 REPLIES 2
Message 2 of 3
hgasty1001
in reply to: GeryKnee

Hi,

 

Has been a lot of time since the last time i did VBA, but I think you can create an AcadObject with something like:

 

dim acobj as AcadObject

Set acobj=thisDrawing.HandleToObject(Handle)

 

Now you can test acobj for your needs.

 

Gaston Nunez

Message 3 of 3
GeryKnee
in reply to: hgasty1001

 

thanks Gaston

That's good

Gery

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost