+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
  1. #1
    Full Member
    Discipline
    Architectural
    svorgodne's Discipline Details
    Occupation
    lisp developer
    Discipline
    Architectural
    Using
    AutoCAD 2013
    Join Date
    May 2007
    Location
    Vienna, austria
    Posts
    83

    Default VLA-object (loop problem) Release 2006

    Registered forum members do not see this ad.

    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?

  2. #2
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

    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]
    "Potential has a shelf life." - Margaret Atwood

  3. #3
    Forum Deity
    Using
    Civil 3D 2008
    Join Date
    Sep 2006
    Location
    Pittsburgh, PA, USA
    Posts
    3,581

    Default

    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
    Code:
    (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
          )

  4. #4
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

    Quote Originally Posted by lpseifert View Post
    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:

    Code:
    (setq lyr
           (vla-get-layer
             (vlax-ename->vla-object (car (entsel "\nSelect entity: ")))))
    "Potential has a shelf life." - Margaret Atwood

  5. #5
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

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

    Code:
    (setq ename (vlax-vla-object->ename vla-object))
    "Potential has a shelf life." - Margaret Atwood

  6. #6
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Quote Originally Posted by RenderMan View Post
    Or one could combine steps, like so:

    Code:
    (setq lyr
           (vla-get-layer
             (vlax-ename->vla-object (car (entsel "\nSelect entity: ")))))
    Nit picking, but

    Code:
    (vlax-ename->vla-object nil)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  7. #7
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

    Quote Originally Posted by Lee Mac View Post
    Nit picking, but

    Code:
    (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!):

    Code:
    (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.
    "Potential has a shelf life." - Margaret Atwood

  8. #8
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,015

    Default

    Quote Originally Posted by Lee Mac View Post
    Nit picking, but

    Code:
    (vlax-ename->vla-object nil)
    x2........
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  9. #9
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,948

    Default

    Quote Originally Posted by alanjt View Post
    x2........
    I know, I know... You've taught me better, Alan.
    "Potential has a shelf life." - Margaret Atwood

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Registered forum members do not see this ad.

    You guys know each other?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. idea..loop...problem...
    By scubastu in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 29th Oct 2009, 09:34 pm
  2. Replies: 0
    Last Post: 12th Aug 2008, 08:10 pm
  3. AutoCAD History from Version 1 to Release 2009 Which is the 23rd Release
    By Between the Lines in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 21st Mar 2008, 09:50 pm
  4. how do I enlarge object in AutoCAD 2006
    By dadude in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 11th Jul 2006, 03:57 am
  5. OBJECT PROPERTIES CAD 2006
    By benedetta in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 28th Mar 2006, 08:26 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts