Mechanical question

Discussion in 'AutoCAD' started by Kari, Dec 16, 2003.

  1. Kari

    Kari Guest

    Hi,
    Does anybody know, how to find out values of attributes from ACMBALLOON?

    Kari
     
    Kari, Dec 16, 2003
    #1
  2. Kari

    DaveS Guest

    (setq entobj (vlax-ename->vla-object (car (entsel))))

    ;returns - #<VLA-OBJECT IMcadBalloon 0b20a914>
    ;the balloon object

    (vlax-get-property entobj "bomitems")

    ;returns - #<VLA-OBJECT IMcadBOMItems 0b1bf2b4>
    ;the items collection for the balloon

    (setq obj (vlax-invoke-method bomitemlist 'item 0))

    ;returns - #<VLA-OBJECT IMcadBOMItem 0b1bda14>
    ;the item for this balloon

    (vlax-safearray->list (vlax-variant-value (vlax-get-property obj "data")))

    ;returns - (("MASS" "0.382186") ("DESCR" "EYE BOLT, 1/4-20") ("NAME"
    "080-00201"))
    ;the value list for that balloon
    ;(vlax-get-property obj "data") returns a variant
    ;(vlax-variant-value... returns a safearray
    ;(vlax-safearray->list... converts safearray to list


    Hope that's enough to get you going.

    Have fun,
    Dave
     
    DaveS, Dec 16, 2003
    #2
  3. Kari

    Kari Guest


    I have had a little problems with these newsgroups, so I answer after 2
    weeks of original message....

    I have got this error message:

    error: no function definition: VLAX-ENAME->VLA-OBJECT

    There is something wrong with this line:

    (setq obj (vlax-invoke-method bomitemlist 'item 0))

    Kari
     
    Kari, Jan 5, 2004
    #3
  4. On versions of AutoCAD prior to 2004 you need to call (vl-load-com) at least
    once per session to have those functions loaded. It does not hurt to put
    that statement at the top of any function that uses the (vl*) functions.


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    |
    | > > Hi,
    | > > Does anybody know, how to find out values of attributes from
    ACMBALLOON?
    | > >
    | > > snip <
    | >
    | > (setq entobj (vlax-ename->vla-object (car (entsel))))
    | >
    | > ;returns - #<VLA-OBJECT IMcadBalloon 0b20a914>
    | > ;the balloon object
    | >
    | > (vlax-get-property entobj "bomitems")
    | >
    | > ;returns - #<VLA-OBJECT IMcadBOMItems 0b1bf2b4>
    | > ;the items collection for the balloon
    | >
    | > (setq obj (vlax-invoke-method bomitemlist 'item 0))
    | >
    | > ;returns - #<VLA-OBJECT IMcadBOMItem 0b1bda14>
    | > ;the item for this balloon
    | >
    | > (vlax-safearray->list (vlax-variant-value (vlax-get-property obj
    "data")))
    | >
    | > ;returns - (("MASS" "0.382186") ("DESCR" "EYE BOLT, 1/4-20") ("NAME"
    | > "080-00201"))
    | > ;the value list for that balloon
    | > ;(vlax-get-property obj "data") returns a variant
    | > ;(vlax-variant-value... returns a safearray
    | > ;(vlax-safearray->list... converts safearray to list
    | >
    | >
    | > Hope that's enough to get you going.
    | >
    | > Have fun,
    | > Dave
    | >
    |
    |
    | I have had a little problems with these newsgroups, so I answer after 2
    | weeks of original message....
    |
    | I have got this error message:
    |
    | error: no function definition: VLAX-ENAME->VLA-OBJECT
    |
    | There is something wrong with this line:
    |
    | (setq obj (vlax-invoke-method bomitemlist 'item 0))
    |
    | Kari
    |
    |
    |
    |
     
    R. Robert Bell, Jan 5, 2004
    #4
  5. Before you can use any vla-* or vlax-* functions, you must
    call (vl-load-com) at least once.

    That's the case on all versions of AutoCAD, including 2004.
     
    Tony Tanzillo, Jan 5, 2004
    #5
  6. My vanilla profile for A2k4 (no customization FIAK) runs vla/vlax- functions
    fine.

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    "Tony Tanzillo" <tony.tanzillo at caddzone dot com> wrote in message
    | Before you can use any vla-* or vlax-* functions, you must
    | call (vl-load-com) at least once.
    |
    | That's the case on all versions of AutoCAD, including 2004.
    |
    | --
    | AcadXTabs: MDI Document Tabs for AutoCAD
    | http://www.acadxtabs.com
    |
    |
    | >
    |
    | >
    | > I have had a little problems with these newsgroups, so I answer after 2
    | > weeks of original message....
    | >
    | > I have got this error message:
    | >
    | > error: no function definition: VLAX-ENAME->VLA-OBJECT
    | >
    | > There is something wrong with this line:
    | >
    | > (setq obj (vlax-invoke-method bomitemlist 'item 0))
    | >
    | > Kari
    | >
    | >
    | >
    | >
    |
    |
     
    R. Robert Bell, Jan 5, 2004
    #6
  7. Yea but aren't you the same guy who thought
    that (entsel 123) doesn't throw an error?
    (probably because you had a global *error*
    handler loaded, which you didn't know about).

    --------------------------------------------------
    Regenerating model.

    AcadXTabs16 copyright ©2003 Tony Tanzillo www.caddzone.com
    FlatLand16.arx ©2002 Tony Tanzillo (wwww.caddzone.com)

    AutoCAD menu utilities loaded.

    Command: (vlax-get-acad-object)
    ; error: no function definition: VLAX-GET-ACAD-OBJECT
     
    Tony Tanzillo, Jan 5, 2004
    #7
  8. Found it. Something in the Express Tools for A2k4 loads it. My apologies to
    Kari for the misleading statement about A2k4 loading it automatically.


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    "Tony Tanzillo" <tony.tanzillo at caddzone dot com> wrote in message
    |
    | --------------------------------------------------
    | Regenerating model.
    |
    | AcadXTabs16 copyright ©2003 Tony Tanzillo www.caddzone.com
    | FlatLand16.arx ©2002 Tony Tanzillo (wwww.caddzone.com)
    |
    | AutoCAD menu utilities loaded.
    |
    | Command: (vlax-get-acad-object)
    | ; error: no function definition: VLAX-GET-ACAD-OBJECT
    |
    | --------------------------------------------------
    |
    |
    | --
    | AcadXTabs: MDI Document Tabs for AutoCAD
    | http://www.acadxtabs.com
    |
    |
    | > My vanilla profile for A2k4 (no customization FIAK) runs vla/vlax-
    functions
    | > fine.
    | >
    | > --
    | > R. Robert Bell, MCSE
    | > www.AcadX.com
    | >
    | >
    | > "Tony Tanzillo" <tony.tanzillo at caddzone dot com> wrote in message
    | > | > | Before you can use any vla-* or vlax-* functions, you must
    | > | call (vl-load-com) at least once.
    | > |
    | > | That's the case on all versions of AutoCAD, including 2004.
    | > |
    | > | --
    | > | AcadXTabs: MDI Document Tabs for AutoCAD
    | > | http://www.acadxtabs.com
    | > |
    | > |
    | > | >
    | > |
    | > | >
    | > | > I have had a little problems with these newsgroups, so I answer
    after 2
    | > | > weeks of original message....
    | > | >
    | > | > I have got this error message:
    | > | >
    | > | > error: no function definition: VLAX-ENAME->VLA-OBJECT
    | > | >
    | > | > There is something wrong with this line:
    | > | >
    | > | > (setq obj (vlax-invoke-method bomitemlist 'item 0))
    | > | >
    | > | > Kari
    | > | >
    | > | >
    | > | >
    | > | >
    | > |
    | > |
    | >
    | >
    |
    |
     
    R. Robert Bell, Jan 5, 2004
    #8
  9. Kari

    Kari Guest

    Actually I had to add that vl-load-com (I saw one example in
    afralisp-sites). I have found out it by myself couple days ago, when I got
    error-message earlier.

    There is still something wrong in (setq obj (vlax-invoke-method bomitemlist
    'item 0))-line....

    Kari
     
    Kari, Jan 7, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.