Jump to content

VLA-object (loop problem) Release 2006


Recommended Posts

Posted

I may be very stupid for not finding the answer but I was analyzing a lisp routine which contents a function called "vlax-ename->vla-object". I looked for definition in AutoCAD help and found this...

 

Transforms an entity to a VLA-object

 

Then at the end says see also

 

The vlax-vla-object->ename function.

 

which says

 

Transforms a VLA-object to an AutoLISP entity

 

Anyhow I tried to find what a VLA-object is and I found absolutely no answer at all. Can anybody help me please?

Posted

This is not a silly question at all.

 

A VLA-Object is a Visual LISP entity, or collection of such, as part of the ActiveX API (VBA also). You can learn a lot more about VLA-Objects in the Developer help under the "ActiveX and VBA Reference" section.

 

I'm sure someone smarter than I will come along, and provide some additional information, but I hope this helps!

 

[edit]

BTW - What is the loop problem you're having?

[/edit]

Posted

To perform many of the VLA/Activex functions on an entity it needs to be made into a vla-object

 

for example... to get the Layer property of an entity using VLA

(setq ent (entsel "Select entity: ");select entity
     ename (car ent); get entity name
     obj (vlax-ename->vla-object ename);create vla-object from entity name
     lyr (vlax-get-property obj 'Layer); get Layer property of vla-object
     )

Posted
To perform many of the VLA/Activex functions on an entity it needs to be made into a vla-object

 

for example... to get the Layer property of an entity using VLA

 

Or one could combine steps, like so:

 

(setq lyr
      (vla-get-layer
        (vlax-ename->vla-object (car (entsel "\nSelect entity: ")))))

Posted

Likewise, if one needs an ename from a vla-object, this will work:

 

(setq ename (vlax-vla-object->ename vla-object))

Posted
Or one could combine steps, like so:

 

(setq lyr
      (vla-get-layer
        (vlax-ename->vla-object (car (entsel "\nSelect entity: ")))))

 

Nit picking, but

 

(vlax-ename->vla-object nil)

 

:)

Posted
Nit picking, but

 

(vlax-ename->vla-object nil)

 

:)

 

LMAO - Yes, of course! :lol:

 

Funny enough, I typically step through instead of selecting a single entity, like so (thanks Alan!):

 

(if (setq ss (ssget ...))
 (progn 
   (vlax-for x (setq ss (vla-get-activeselectionset *activeDoc*))
     ...)
   (vla-delete ss)))
...

 

I'll try to curb my expedited behavior in the future... You'll help make me a "Real [Programmer]" yet. :wink:

Posted
Nit picking, but

 

(vlax-ename->vla-object nil)

:)

x2........
Posted
x2........

 

I know, I know... You've taught me better, Alan. :oops:

Posted
You guys know each other?

 

best buds.

 

Aww... C'mon, we know each other better than that, don't we!? o:)

 

Just kidding... Sincerely though, I've learned a lot from Alan's guidance over the past several months. :wink:

Posted

Ahh... AUGI... should've known. I've hung around there a couple of times but haven't really posted too much..

Posted
Ahh... AUGI... should've known. I've hung around there a couple of times but haven't really posted too much..

 

What with all of your free time after being a "Quantum Mechanic" here, and a "Gator" on TheSwamp... who'd have guessed that!? :)

 

I found this and other helpful places after being helped by folks like Alan, RK, and others... Reputable folks, dependable advice, and here I am. :wink:

Posted
What with all of your free time after being a "Quantum Mechanic" here, and a "Gator" on TheSwamp... who'd have guessed that!? :)

 

lol that is over two years though... :oops:

Posted
lol that is over two years though... :oops:

 

Fair enough... I've not been doing this (forum stuff) nearly as long (or as well :unsure:).

 

I'd like to believe I'm a quick study... but only time will tell, as "this too shall pass."

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...