Author Topic: scalelist, scalelistedit etc  (Read 7434 times)

0 Members and 1 Guest are viewing this topic.

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
scalelist, scalelistedit etc
« on: July 15, 2008, 09:50:52 AM »
More of a general question than needing help.

Where/when did the scalelist and scalelist edit come into being?
I have to admit they are driving me potty, the current drawing I am editing had hundreds of scales in the list, and its no longer a simple thing to select a viewport scale in the properties dialog box. ScalelistDel has made it onto my toolbar so I can keep on top of the pesky things.

Is it just bad planning, a bug, or are they/can they be useful?
Thanks for explaining the word "many" to me, it means a lot.

Hedgehog

  • Guest
Re: scalelist, scalelistedit etc
« Reply #1 on: July 15, 2008, 10:02:00 AM »
They can be useful when dealing with annotative scaling but in general I find them a pain... there is an Autodesk application to trim down the number of scales on that list... now where is it...  :kewl:


CHulse

  • Swamp Rat
  • Posts: 504
Re: scalelist, scalelistedit etc
« Reply #3 on: July 15, 2008, 10:41:25 AM »
I just made a button to reset the list... PIA.
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

ronjonp

  • Needs a day job
  • Posts: 7529
Re: scalelist, scalelistedit etc
« Reply #4 on: July 15, 2008, 11:19:55 AM »
I just made a button to reset the list... PIA.

If you don't use scalelists, why don't you just add the command to startup...then the drawing is "cleaned" on open.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

CHulse

  • Swamp Rat
  • Posts: 504
Re: scalelist, scalelistedit etc
« Reply #5 on: July 15, 2008, 12:14:15 PM »
I just made a button to reset the list... PIA.

If you don't use scalelists, why don't you just add the command to startup...then the drawing is "cleaned" on open.

Good Idea.
I like to have the option though...it's not always needed.
Cary Hulse
Urban Forestry Manager
Wetland Studies and Solutions

Civil 3D 2020 & 2023

Big G

  • Bull Frog
  • Posts: 415
Re: scalelist, scalelistedit etc
« Reply #6 on: July 15, 2008, 10:38:14 PM »
found that sometimes the scalelistedit cmd will throw up an error in c3d 2008 when there is too many scales

-scalelistedit never seems to fail tho


*EDIT*
covered here also http://www.theswamp.org/index.php?topic=23963.0
I thought i seen the light at the end of the tunnel. But it was just someone with a torch bringing me more work.
"You have to accept that somedays youre the pigeon and  somedays youre the statue"

hudster

  • Gator
  • Posts: 2848
Re: scalelist, scalelistedit etc
« Reply #7 on: July 16, 2008, 03:33:40 AM »
I like that in 2009 you can set it up that only your default scales are loaded when you open a drawing.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: scalelist, scalelistedit etc
« Reply #8 on: July 16, 2008, 08:22:26 AM »
Where do they come from?
It seems like I've constantly got new ones in the scale list.
Thanks for explaining the word "many" to me, it means a lot.

Crank

  • Water Moccasin
  • Posts: 1503
Re: scalelist, scalelistedit etc
« Reply #9 on: July 16, 2008, 09:07:03 AM »
Where do they come from?
It seems like I've constantly got new ones in the scale list.
Be sure you have SP1 installed.
The new scale are coming from imported wblocks and xrefs.

If you put the next lisp in your acaddoc.lsp or your .mnl-file all unused scales will be purged:
Code: [Select]
(defun c:PurgeScales ( / schaallijst n ce dm)
(command ".undo" "begin")
(setq ce (getvar "CMDECHO"))(setvar "CMDECHO" 0)
(setq dm (getvar "DYNMODE"))(setvar "DYNMODE" -3)
(if (and (wcmatch (getvar "CANNOSCALE") "*'*")(not (inPspace)))
(setvar "CANNOSCALE" "1:1")
)

[color=red](if (> (length (dict-list (dict-name "ACAD_SCALELIST"))) 17)(COMMAND "-SCALELISTEDIT" "R" "Y" "E"))[/color]

(setq schaallijst '())
(foreach n (dict-list (dict-name "ACAD_SCALELIST"))
(setq schaallijst (cons (cdr (assoc 300 (entget (cdr n)))) schaallijst))
)
(foreach n schaallijst
(if (/= n "1:1")(command ".-scalelistedit" "Delete" n "Exit"))
)

(setvar "DYNMODE" dm)
(setvar "CMDECHO" ce)
(command ".undo" "end")
(princ)
)
(c:PurgeScales)

(defun inPSPACE ()
  (and
    (zerop (getvar "TILEMODE"))
    (zerop (getvar "VPMAXIMIZEDSTATE"))
    (eq (getvar "CVPORT") 1)
  )
)

;; List A Dictionary As Pairs {Name . Object Name}
(defun dict-list ( dname / d nl ) ;; dname As object name or string else ROOT
(cond
((and (setq d (cond
((= 'ENAME (type dname)) dname)
((= 'STR (type dname)) (dict-name dname))
(T (namedobjdict))
  )
)
(setq d (entget d))
)
(while (setq d (member (assoc 3 d) d))
(if (or (= 350 (caadr d)) ;; regular dict
(= 360 (caadr d)) ;; extension dict
)
(setq nl (cons (cons (cdar d) (cdadr d)) nl))
)
(setq d (cdr d))
)
(reverse nl)
)
)
)

;; Get Dictionary Object Name From Root Dictionary
(defun dict-name ( name ) ;; name As string or ename of exist dict
(cond
( (= 'STR (type name))
(cdr (assoc -1 (dictsearch (namedobjdict) name))))
( (and
(= 'ENAME (type name))
(= "AcDbDictionary" (cdr (assoc 100 (entget name))))
  )
name
)
)
)
Notice that I use 'foreach' twice, because in acad2009 the dictionary changes with every scalelistedit.
« Last Edit: July 19, 2008, 02:19:43 AM by Crank »
Vault Professional 2023     +     AEC Collection

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Re: scalelist, scalelistedit etc
« Reply #10 on: July 16, 2008, 11:30:20 AM »
thanks Crank. I'll take a look at that when I go back to work on Friday
Thanks for explaining the word "many" to me, it means a lot.

Crank

  • Water Moccasin
  • Posts: 1503
Re: scalelist, scalelistedit etc
« Reply #11 on: July 19, 2008, 02:30:27 AM »
I know this can be slow the first time you use it, but once the drawing is saved the useless scales shouldn't return, so the next time it will be a lot faster.
I've added the red line to speed things up a bit for drawings with large scalelists.

I don't know why Autodesk desided to make these long scalelists, because I never use more scales than 4 in a dwg. With these long scalelists you'll have to guess/list what scale you've to use. With only the used scales the drawings are smaller and it's working easier.
Vault Professional 2023     +     AEC Collection

Crank

  • Water Moccasin
  • Posts: 1503
Re: scalelist, scalelistedit etc
« Reply #12 on: July 19, 2008, 03:06:23 AM »
BTW, to set/make annoscales, you can use this:
Code: [Select]
(defun c:1:1 ()(MaakSchaal 1))
(defun c:1:2 ()(MaakSchaal 2))
(defun c:1:5 ()(MaakSchaal 5))
(defun c:1:10 ()(MaakSchaal 10))
(defun c:1:20 ()(MaakSchaal 20))
(defun c:1:50 ()(MaakSchaal 50))
(defun c:1:100 ()(MaakSchaal 100))
(defun c:1:200 ()(MaakSchaal 200))
(defun c:1:500 ()(MaakSchaal 500))
(defun c:1:1000 ()(MaakSchaal 1000))
(defun c:1:2000 ()(MaakSchaal 2000))
(defun c:1:5000 ()(MaakSchaal 5000))
(defun c:1:10000 ()(MaakSchaal 10000))

(defun MaakSchaal (waarde / e schaal)
(command ".undo" "be")
(setq schaal (strcat "1:" (itoa waarde)))
(setq e (getvar "EXPERT"))(setvar "EXPERT" 5)
(command ".-scalelistedit" "A" schaal schaal "Exit")
(setvar "EXPERT" e)
(if (inPspace)
(princ "\nThis scale is added to the scalelist.")
; else
(setvar "CANNOSCALE" schaal)
)
(command ".undo" "end")
(princ)
)
Vault Professional 2023     +     AEC Collection