I would like to find a lisp that changes the scale of something that has an annotative scale and deletes all other scales in the object scale list. Often i have many different scales of existing dimensions or objects. i waste a lot of time opening the annotation object scale dialogue box, selecting add, finding my scale and deleting the old scale.
Solved! Go to Solution.
Solved by Ian_Bryant. Go to Solution.
Hi,
you could try loading the attached LSP file.
The CH-ASC function adds the current Annoscale to a selected annotative object
and deletes all other scales from it.
Regards Ian
thank you, works great.
In localised Autocad versions you must put the "_" before the ssget parameters at Line 5
(if (setq ent (ssget "_:S:L"))
This is a very useful lisp, but it would be awesome if you could window a group of dims and change them all at once.
Is that possible?
Yes this would be great to use on multiple items such as blocks, Mtext, Mleaders, etc.
Is that possible?
Try the following:
(defun c:chasc ( / cmd ent idx lst scl sel ) (cond ( (= 1 (getvar 'cvport)) (princ "\nThis command is only available in Modelspace.") ) ( (setq sel (ssget "_:L" '((0 . "*TEXT,*DIMENSION,INSERT,HATCH,MULTILEADER")))) (setq cmd (getvar 'cmdecho) scl (getvar 'cannoscale) ) (setvar 'cmdecho 0) (repeat (setq idx (sslength sel)) (if (setq ent (ssname sel (setq idx (1- idx))) lst (LM:annoscales ent) ) (progn (if (not (member scl lst)) (command "_.-objectscale" ent "" "_a" scl "") ) (if (setq lst (vl-remove-if '(lambda ( itm ) (= itm scl)) lst)) (progn (command "_.-objectscale" ent "" "_d") (foreach itm lst (command itm)) (command "") ) ) ) ) ) (setvar 'cmdecho cmd) ) ) (princ) ) ;; Annotative Scales - Lee Mac ;; Returns a list of all annotative scales associated with a supplied entity (defun LM:annoscales ( 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) ) (princ)
Great Code! Just curious on the ssget command, what does ":S:L" do i cant find it in the help anywhere?
@lelandleahy4987 wrote:
Great Code! Just curious on the ssget command, what does ":S:L" do i cant find it in the help anywhere?
Great thanks!, Autocad's help didn't show a lot of these options. (note all the undocumented options) Why does Autodesk not show all the options? There should not be "undocumented" items!
thanks again! i will refer to Lee Mac's site first then autodesks 😃
When using Lee Mac's code, it looks like it should automatically pick text, dimensions, hatch, etc, but it's always asking for me to select objects. Am I missing something? Do I have some weird configuration setting wrong?
I have thousands of objects I need to select to execute this code; seems like it actually SHOULD do what I want, but it's not working.
So, turns out my computer was being odd apparently; rebooted and now the script works by highlighting all of my geometry.
Thank you Lee Mac.
That routine is perfect. This fixes my number one gripe with how ACAD decided to set up changing/adding/deleting an objects scale.
Seven clicks and two dialog boxes to change one objects scale. Repeated for every object type because properties will not show "Annotation Scale" for objects of different type when selected together.
This routine will save me lots of time... =]