svorgodne Posted August 25, 2010 Posted August 25, 2010 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? Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 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] Quote
lpseifert Posted August 25, 2010 Posted August 25, 2010 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 ) Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 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: "))))) Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 Likewise, if one needs an ename from a vla-object, this will work: (setq ename (vlax-vla-object->ename vla-object)) Quote
Lee Mac Posted August 25, 2010 Posted August 25, 2010 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) Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 Nit picking, but (vlax-ename->vla-object nil) LMAO - Yes, of course! 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: Quote
alanjt Posted August 25, 2010 Posted August 25, 2010 Nit picking, but (vlax-ename->vla-object nil) x2........ Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 x2........ I know, I know... You've taught me better, Alan. Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 You guys know each other? best buds. Aww... C'mon, we know each other better than that, don't we!? Just kidding... Sincerely though, I've learned a lot from Alan's guidance over the past several months. :wink: Quote
Lee Mac Posted August 25, 2010 Posted August 25, 2010 Ahh... AUGI... should've known. I've hung around there a couple of times but haven't really posted too much.. Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 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: Quote
Lee Mac Posted August 25, 2010 Posted August 25, 2010 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... Quote
BlackBox Posted August 25, 2010 Posted August 25, 2010 lol that is over two years though... Fair enough... I've not been doing this (forum stuff) nearly as long (or as well ). I'd like to believe I'm a quick study... but only time will tell, as "this too shall pass." Quote
Recommended Posts
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.