0 Members and 1 Guest are viewing this topic.
Where did you find variable lst defined?Have you tried :Code - Auto/Visual Lisp: [Select](setq sel (kpblc vlablkselection))
(defun kpblc (obj-lst / adoc name selset) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object)) name "TempSelSet" ) ;_ end of setq (vl-catch-all-apply (function (lambda () (vla-delete (vla-item (vla-get-selectionsets adoc) name)))) ) ;_ end of vl-catch-all-apply (setq selset (vla-add (vla-get-selectionsets adoc) name)) (vla-additems selset (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbobject (cons 0 (1- (length obj-lst)))) obj-lst) ) ;_ end of vlax-make-variant ) ;_ end of vla-additems selset ) ;_ end of defun
@Grrr1337:I understand what you are doing there: working around the missing ObjectName property. But the selection set object has some unique methods, checking for those would be more straightforward.
Have you tried :Quote(defun kpblc (obj-lst / adoc name selset) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object)) name "TempSelSet" ) ;_ end of setq (vl-catch-all-apply (function (lambda () (vla-delete (vla-item (vla-get-selectionsets adoc) name)))) ) ;_ end of vl-catch-all-apply (setq selset (vla-add (vla-get-selectionsets adoc) name)) (vla-additems selset (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbobject (cons 0 (1- (length obj-lst)))) obj-lst) ) ;_ end of vlax-make-variant ) ;_ end of vla-additems selset ) ;_ end of defun