- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all!
I am relatively new to working with lisp programming, and am working on create to lisp to toggle on and off the contour label line visibility. I am using this code for extracting surface boundaries as a starting point, but am running into trouble when trying to loop through the collection of objects.
I've tried using a selection set, I've tried converting the selection set (as in the current code at the bottom) to a vla-object but always get an error ; error: bad argument type: VLA-object collection: XXXXXX.
I tried to create a collection similar to the example code below for surface contour labels, but couldn't find a entry similar to the surfaces for the contour labels when inspecting the active document in VLIDE (screenshot attached).
(setq c3ddoc (vlax-get c3d 'activedocument)
surfs (vlax-get c3ddoc 'surfaces)
Can anyone point me in the right direction as to what am I doing wrong?
(vl-load-com)
(DEFUN C:test ( / c3d c3ddoc all_lbls vl_lbls lbls *acad* )
;(SETQ object (vlax-ename->vla-object (CAR (ENTSEL))))
(if (setq *acad* (vlax-get-acad-object)
c3d (strcat "HKEY_LOCAL_MACHINE\\" (if vlax-user-product-key (vlax-user-product-key) (vlax-product-key) ) )
c3d (vl-registry-read c3d "Release")
c3d (substr c3d 1 (vl-string-search "." c3d (+ (vl-string-search "." c3d) 1) ) )
c3d (vla-getinterfaceobject *acad* (strcat "AeccXUiLand.AeccApplication." c3d) )
)
(progn
(setq c3ddoc (vlax-get c3d 'activedocument))
(setq all_lbls (ssget "x" (list (cons 0 "AECC_SURFACE_CONTOUR_LABEL_GROUP"))))
(setq vl_lbls (vlax-ename->vla-object (ssname all_lbls 0)))
(vlax-for lbls vl_lbls
(vlax-put-property lbls "IsLabelLineVisible" 1 )
)
(if (not (vlax-object-released-p c3d) ) (vlax-release-object c3d) )
(if (not (vlax-object-released-p *acad*) ) (vlax-release-object *acad*) )
)
)
(princ)
);END DEFUN
Solved! Go to Solution.