Hi, Does anybody know, how to find out values of attributes from ACMBALLOON? Kari
(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
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 | | | |
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.
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 | > | > | > | > | |
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
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 | > | > | > | > | > | > | > | > | > | | > | | > | > | |
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