0 Members and 1 Guest are viewing this topic.
;;; ======================================================================;;; Lib function: kg:vl:Get (LibVer20101216);;; Purpose: Generic visual lisp get-function.;;; Arguments: lst - list of objects and/or properties;;; Root element first. If the first element in the;;; list is nil then the application object is used;;; as the root.;;; Return value: Result of vlax-get.;;; Dependencies: None;;; Remarks: http://www.theswamp.org/index.php?topic=2005.0;;; http://www.visuallisp-tutorial.mapcar.net/schnellzugriff.html;;; Examples: (kg:vl:Get '(nil)) => #<VLA-OBJECT IAcadApplication 020aa128>;;; (kg:vl:Get '(nil activedocument activelayer color)) => 7;;; ======================================================================(defun kg:vl:Get (lst / tmpLst) (setq tmpLst (cons (cond ((car lst)) ((vlax-get-acad-object)) ) tmpLst ) ) (mapcar '(lambda (a) (setq tmpLst (cons (vlax-get ; alternative: vlax-get-property (car tmpLst) a ) tmpLst ) ) ) (cdr lst) ) (mapcar '(lambda (a) (and (not (vlax-object-released-p a)) (vlax-release-object a) ) ) (cdr tmpLst) ) ; (gc) (car tmpLst))
Very original idea Roy! I like it