broncos15 Posted February 29, 2016 Posted February 29, 2016 I had a quick question on the annotative scale properties of mleaders. I cannot find any documentation in the acadauto.chm about the annotative scale properties of an object. What I am wanting to do is to add in the current annotative scale (easily done using the -objectscale command), delete all the annotative scales of the mleaders besides the current one, then add them back. If I knew how to find/store the scales associated with each object I know that I could accomplish it using a repeat loop. Does anyone have any suggestions? Quote
Lee Mac Posted February 29, 2016 Posted February 29, 2016 To provide an insight into where the annotative data is stored, the following function will return all annotative scale associated with a given MLeader entity: (defun getmleaderannoscales ( ent / dic enx itm rtn ) (if (and (setq enx (entget ent)) (setq dic (cdr (assoc 360 (cdr (member '(102 . "{ACAD_XDICTIONARY") enx))))) (setq dic (cdr (assoc -1 (dictsearch dic "acdbcontextdatamanager")))) (setq dic (cdr (assoc -1 (dictsearch dic "acdb_annotationscales")))) ) (while (setq itm (dictnext dic (not itm))) (setq rtn (cons (cdr (assoc 300 (entget (cdr (assoc 340 itm))))) rtn)) ) ) (reverse rtn) ) _$ (getmleaderannoscales (car (entsel))) ("1:1" "1:4") Quote
broncos15 Posted February 29, 2016 Author Posted February 29, 2016 To provide an insight into where the annotative data is stored, the following function will return all annotative scale associated with a given MLeader entity: (defun getmleaderannoscales ( ent / dic enx itm rtn ) (if (and (setq enx (entget ent)) (setq dic (cdr (assoc 360 (cdr (member '(102 . "{ACAD_XDICTIONARY") enx))))) (setq dic (cdr (assoc -1 (dictsearch dic "acdbcontextdatamanager")))) (setq dic (cdr (assoc -1 (dictsearch dic "acdb_annotationscales")))) ) (while (setq itm (dictnext dic (not itm))) (setq rtn (cons (cdr (assoc 300 (entget (cdr (assoc 340 itm))))) rtn)) ) ) (reverse rtn) ) _$ (getmleaderannoscales (car (entsel))) ("1:1" "1:4") Lee, thank you so much for the help, that function is super useful! It's weird that AutoCad made it so difficult to extract the mleader scales (the fact that you have to do a dictionary search for them seems ridiculous). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.