Jump to content

Recommended Posts

Posted

is there a way to get item index?

 

Set item1 = ThisDrawing.ModelSpace.Item([index])

item1.XXXX = [index]

 

XXXX which property?

 

ObjectID,OwnerID is not index..

or is there a way to get item from ownerID?

 

Set item1 = ThisDrawing.ModelSpace.YYYY([OwnerID] or [ObjectID])

YYYY which object?

Posted

Why do you need the index?

 

You can convert to VLA-Object from ObjectID/Handle.

Posted

Using an ObjectID

 

In LISP:

 

(vla-ObjectIDtoObject
 (vla-get-ActiveDocument
   (vlax-get-acad-object)
 )
 <ObjectID>
)

In VBA:

 

ThisDrawing.ObjectIdToObject(objectID)  

Or using a Handle:

 

In LISP:

 

(vla-HandletoObject
 (vla-get-ActiveDocument
   (vlax-get-acad-object)
 )
 <Handle>
)

In VBA:

 

ThisDrawing.HandleToObject(handle)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...