I'm trying to find the annotative scales of a selected entity.
With this code the scales for most entities can be found:
(defun get_all_scales (ent / annotative lijst n schalen)
(setq annotative (cdr (assoc 360 ent)))
(if annotative (progn
(setq lijst (entget (cdr (assoc 350 (entget (cdr (assoc 360 (entget annotative))))))))
(foreach n (collect 350 lijst)
(setq schalen (cons
(cdr (assoc 300 (entget (cdr (assoc 340 (entget n))))))
schalen
)
)
)
schalen
))
)
(defun collect (key lijst / n return)
(foreach n lijst
(if (= key (car n))
(setq return (cons (cdr n) return))
)
)
return
)
(defun c:test (/ ent scalelist)
(setq ent (entget (car (entsel))))
(if ent (setq scalelist (get_all_scales ent)))
(if scalelist
(princ scalelist)
;else
(alert "\nNo annoscales")
)
(princ)
)
However, on dynamic blocks it crashes, because group 350 isn't present.
No problem, it's possible to make an exeption for dynamic blocks, but where is the data stored of the annotative scales? I can't find it... Perhaps someone can point me in the right direction.
Any help is appriciated.