0 Members and 1 Guest are viewing this topic.
(defun c:test (/ blks props p d ang ins) (if (and (setq blk (vlax-ename->vla-object (car (entsel)))) (= (vla-get-ObjectName blk) "AcDbBlockReference") (setq ins (vlax-get blk 'InsertionPoint)) (setq props (vlax-invoke blk 'getdynamicblockproperties)) ) (foreach p props (if (= (vla-get-propertyname p) "Overall Length") (setq d (/ (vlax-variant-value (vla-get-value p)) 2.)) ) (if (= (vla-get-propertyname p) "Angle1") (setq ang (vlax-variant-value (vla-get-value p))) ) ) ) (list (polar ins ang d) (polar ins (+ pi ang) d)))
Hmmmm, that was easier then I thought, thanks a lot.It seams to be working correctly...What am I missing?
(defun c:test (/ blks props p d ang ins) (if (and (setq blk (vlax-ename->vla-object (car (entsel)))) (= (vla-get-ObjectName blk) "AcDbBlockReference") (setq ins (vlax-get blk 'InsertionPoint)) (setq props (vlax-invoke blk 'getdynamicblockproperties)) ) (foreach p (mapcar 'cons (mapcar 'vla-get-propertyname props) (mapcar 'vlax-variant-value (mapcar 'vla-get-value props) ) ) (if (= (car p) "Overall Length") (setq d (/ (cdr p) 2.)) ) (if (= (car p) "Angle1") (setq ang (cdr p)) ) ) ) (list (polar ins ang d) (polar ins (+ pi ang) d)))