vla-getentity

vla-getentity

gcsjlewis
Collaborator Collaborator
1,664 Views
2 Replies
Message 1 of 3

vla-getentity

gcsjlewis
Collaborator
Collaborator

I am trying to understand the vla-getentity command.  I understand it returns nil so i do not know exactly what its grabbing.  Is there a way to pass an already selected item through this?  I am trying to get the boundingbox of a viewport that i have in a selection set already.

0 Likes
Accepted solutions (1)
1,665 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

@gcsjlewis wrote:

....  I am trying to get the boundingbox of a viewport that i have in a selection set already.


Since (vla-...) functions aren't included in AutoCAD's Customization Guide Help, I don't know exactly, either.  But you can do that without (vla-getEntity):

  (vla-getboundingbox (vlax-ename->vla-object EntityName) 'minpt 'maxpt)
  (setq
    LL (vlax-safearray->list minpt); Lower Left corner
    UR (vlax-safearray->list maxpt); Upper Right
  )

 

where EntityName can a variable that it's stored in, or can be from (ssname SelectionSetName IndexNumber) or (car (entsel....)).

Kent Cooper, AIA
Message 3 of 3

DannyNL
Advisor
Advisor

vla-GetEntity is a method supported by the Utility object. You can compare it to entsel and it requires the user to select an object/point in the drawing.

See: http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-69164FAA-F3C7-47A4-962C-5F4B2D5BC583

 

So to get the bounding box of an object that you already selected or is in a selection set, use the method Kent described.