Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

object annotation scales BIG AHA!

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
250 Views, 0 Replies

object annotation scales BIG AHA!

this seems to work on retrun scales for blocks, dims, text and hatches -
returns nil if no scales found or not annotative.


you're all welcome to it - I'd love feedback

most of it is library stuff which I included - thanks to a nice library
function the actual code is pretty small


Jamie

(defun get_obj_scales (en / scales)

;-------library functions---------
(defun jddsubst (ed1 dxf1 newval1)
(if (= (type ed1) 'ENAME)
(setq ed1 (entget ed1))
)
(if (assoc dxf1 ed1)
(subst (cons dxf1 newval1)(assoc dxf1 ed1) ed1)
(reverse (cons (cons dxf1 newval1) (reverse ed1)))
)
)
(defun arctgv (dxf_code list_1)
(setq list_1 (cond
((= (type dxf_code) 'SYM)
(if (= (type list_1) 'ENAME)
(vlax-ename->vla-object list_1)
list_1
)
)
(T
(if (= (type list_1) 'VLA-OBJECT)
(vlax-vla-object->ename list_1)
list_1
)
)
)
)
(cond
((= (type list_1) 'ENAME)
(cdr (assoc dxf_code (entget list_1)))
)
((= (type list_1) 'LIST)
(cdr (assoc dxf_code list_1))
)
((= (type list_1) 'VLA-OBJECT)
(if (vlax-property-available-p list_1 dxf_code)
(vl-catch-all-apply 'vlax-get-property (list list_1
dxf_code))
nil
)
)
(T nil)
)
)
(defun eng ( x / )
(if (vl-catch-all-error-p (setq x (vl-catch-all-apply 'entget (list x))))
nil
x
)
)
;----------------main progn------------
(foreach x (eng (arctgv 350 (arctgv 360 (reverse (eng (arctgv 360
en))))))
(if (and (= (car x) 350)
(setq ed1 (entget (cdr x)))
(arctgv 340 ed1)
)
(setq scales (jddsubst scales (arctgv 300 (arctgv 340 ed1))
(arctgv 141 (arctgv 340 ed1))))
)
)
scales
)
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost