I am searching for a function that would get the annotative scale (scales) factor of the object.
I mean not the scale itself, but the factor, similar to cannoscalevalue variable, but one that the object itself posses (if it does).
Can it be red from the object directly?
I have a function to get the list of annotative scales from the object, but how to proceed after it? For example if the scale is "1/4" = 1'-0", how to convert it to scale factor, which would be 0.0208333 in this case?
(defun GetAnnoScales (e / dict lst rewind res)
;;; Argument: the ename of an annotative object.
;;; Returns the annotative scales associated with the
;;; ename as a list of strings.
;;; Example: ("1:1" "1:16" "1:20" "1:30")
;;; Returns nil if the ename is not annotative.
;;; Can be used to test whether ename is annotative or not.
;;; Works with annotative objects: text, mtext, leader, mleader,
;;; dimension, block reference, tolerance and attribute.
;;; Based on code by Ian Bryant.
;;;Joe Burk
;;;http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-do-i-make-hatch-annotative-via-vlisp-almost-there/m-p/2080831
;; Argument: an ename or vla-object.
;; Return T if object is annotative, otherwise nil.
(if
(and
e
(setq dict (cdr (assoc 360 (entget e))))
(setq lst (dictsearch dict "AcDbContextDataManager"))
(setq lst
(dictsearch (cdr (assoc -1 lst)) "ACDB_ANNOTATIONSCALES")
) ;_ end of setq
(setq dict (cdr (assoc -1 lst)))
) ;_ end of and
(progn
(setq rewind t)
(while (setq lst (dictnext dict rewind))
(setq e (cdr (assoc 340 lst))
res (cons (cdr (assoc 300 (entget e))) res)
rewind nil
) ;_ end of setq
) ;_ end of while
) ;_ end of progn
) ;_ end of if
(reverse res)
)