Jump to content

Cannot delete scale


Recommended Posts

I've created a new blank dwg and I want to delete the scales to replace them with custom ones. I was able to delete all the scales except the 1:1 (or 1'-0"=1'-0") one. There are no objects in there, 1:1 isn't in use in Model space and I deleted the viewports, so what could still be using it?

Link to comment
Share on other sites

I haven't tried to do this, but would speculate that the software may require at least one scale in that dropdown menu.

Have you tried editing it, to become one of the new scales you plan to add?

Link to comment
Share on other sites

I haven't tried to do this, but would speculate that the software may require at least one scale in that dropdown menu.

I have made a new custom scale, selected it, then tried to delete the 1:1 again, and it can't be deleted - even if it isn't the only one in the menu.

Have you tried editing it, to become one of the new scales you plan to add?

Only the name can be edited; the Scale properties are greyed out.

Link to comment
Share on other sites

any annotative object in a drawing has to have a annotative scale attached and 1:1 is the default scale until you create a new scale and select it for that object then you will not be able to delete the 1:1 scale. After you create the new scale then you have to select it and unselect the 1:1 scale then you can delete it. It sounds like you created the new scale but didn't unselect the 1:1 scale. I'm not at my work station right now but I think that's how it works.

Link to comment
Share on other sites

It sounds like you created the new scale but didn't unselect the 1:1 scale.

But I did unselect it; I mentioned this a few posts ago.

Link to comment
Share on other sites

It may well be impossible to delete or edit the values, but bear in mind that 1:1 as Ski_Me has said is used as default in many parts of the drawing file, as an example if you open the page setup manager in a standard layout and click on the modify tab you will find that it uses 1:1 by default, and there are no doubt countless other places that have 1:1 as a default setting (I haven't checked but what about the settings for tables, mtext, leaders, block editor, etc any and all of these could have a default of 1:1 buried in the background)

Link to comment
Share on other sites

All other scales are based on calculating 1 (1:1) divided by or multiplied by a scale factor.

 

Life has limits. All programming needs foundation (default) values to function. 1:1 is what holds AutoCad together. 1:1 is reality. One cannot delete reality. Well, for one's own self that may be possible, but nobody else will understand.

 

Much like reality, one can however simply choose to ignore 1:1. There is still the communicating with others issue, but...

 

Me: "Doc,it hurts when I do this."

Doc: "Then don't do that."

 

When you go to plot a scale drawing out for others to make what you have drawn, your plot scale (Not the viewport scale) must be 1:1. Your layout must be set up to print the same size as a real piece of paper, in 1:1 scale no matter what your viewport scale is. AutoCad uses the same algorithms and default values to plot as it does to draw.

Link to comment
Share on other sites

1:1 is reality. One cannot delete reality. Well, for one's own self that may be possible, but nobody else will understand.

 

Much like reality, one can however simply choose to ignore 1:1. There is still the communicating with others issue, but...

 

Giving new meaning to the whole concept of "alternative scale factors." :|

Link to comment
Share on other sites

You cannot delete a scale that's referenced somewhere in the drawing. It's been done programmatically, but it will corrupt the drawing if it was referenced somewhere in the drawing.

 

Code challenge: Create a merge scale lisp to change every reference in the drawing for a given scale like 1:1 to the same selected scale.

Link to comment
Share on other sites

Giving new meaning to the whole concept of "alternative scale factors." :|
I was just trying to kick the dead horse in a novel manner. ;)
Link to comment
Share on other sites

I was just trying to kick the dead horse in a novel manner. ;)

 

Thank God, there's more than one way!

Always receptive to your input, perspective, and flirtation with the "borderline moderation compelling edge". :beer:

Edited by Dadgad
Link to comment
Share on other sites

found more complete code online that should fix Scale Lists for anyone and added two commands that both set automatically Imperial or Metric depending on MEASUREMENT system variable.

 

ScaleListReset will Reset [Default Scale List…] from 'User Preferences' tab in Options (stored in Windows Registry).

 

ScaleListStd will assign an editable Scale List from below in this code.

 

;; Utilities to clean-up scale lists by htls69 though I've downloaded a lot of similar code.
;; https://forums.autodesk.com/t5/autocad-civil-3d-customization/scale-list-cleanup-lisp/m-p/5647666#M10417

;;^C^C(load "ScaleListClean.lsp") ScaleListReset ;
;; Command to Reset [Default Scale List…] from 'User Preferences' tab in Options (stored in Windows Registry).
(defun c:ScaleListReset (/ key 1stScaleName 1stEnt 1stElist cannoscale)
; http://www.cadtutor.net/forum/showthread.php?100013-Cannot-delete-scale&p=680512&viewfull=1#post680512
 (c:ScaleListRemXRef);Remove XREF scales
 (if(=(getvar "MEASUREMENT")0);Imperial
   (progn
     (c:ScaleListMinImperial);Set minimal Imperial scales
     (c:ScaleListRemMetric);Remove Metric scales
   )
   (progn
     (c:ScaleListMinMetric);Set minimal Metric scales
     (c:ScaleListRemImperial);Remove Imperial scales
   )
 )
 (command ".-scalelistedit" "Reset" "Yes" "Exit")
)

;;^C^C(load "ScaleListClean.lsp") ScaleListStd ;
;; Command to assign an editable Scale List from below in this code.
(defun c:ScaleListStd (/ key 1stScaleName 1stEnt 1stElist cannoscale)
; http://www.cadtutor.net/forum/showthread.php?100013-Cannot-delete-scale&p=680512&viewfull=1#post680512
 (c:ScaleListRemXRef);Remove XREF scales
 (if(=(getvar "MEASUREMENT")0);Imperial
   (progn
     (c:ScaleListMinMetric);Set minimal Metric scales
     (c:ScaleListRemImperial);Remove Imperial scales
     (c:ScaleListImperial);Set minimal Imperial scales
     (c:ScaleListRemMetric);Remove Metric scales
   )
   (progn
     (c:ScaleListMinImperial);Set minimal Imperial scales
     (c:ScaleListRemMetric);Remove Metric scales
     (c:ScaleListMetric);Set minimal Metric scales
     (c:ScaleListRemImperial);Remove Imperial scales
   )
 )
)

;; Command to remove all XREF scale lists
(defun c:ScaleListRemXRef (/)
 (princ
   (strcat "\n"
    (itoa (DelScaleListMatch "*XREF*" (GetScaleListEntities)))
    " XREF scales deleted."
   ) ;_ end of strcat
 ) ;_ end of princ
 (princ)
) ;_ end of defun

;; Command to remove all Imperial scales
(defun c:ScaleListRemImperial (/)
 (princ
   (strcat "\n"
    (itoa (DelScaleListMatch "*=*" (GetScaleListEntities)))
    " Imperial scales deleted."
   ) ;_ end of strcat
 ) ;_ end of princ
 (princ)
) ;_ end of defun

;; Command to remove all Metric Scales
(defun c:ScaleListRemMetric (/)
 (princ
   (strcat "\n"
    (itoa (DelScaleListMatch "*:*" (GetScaleListEntities)))
    " Metric scales deleted."
   ) ;_ end of strcat
 ) ;_ end of princ
 (princ)
) ;_ end of defun

;; Command to ensure Minimal Imperial scales are present
(defun c:ScaleListMinImperial (/)
 (princ (strcat "\n" (itoa (InstallScaleList MinImplScaleList)) " scale added"))
 (princ)
) ;_ end of defun

;; Command to ensure Imperial scales are present
(defun c:ScaleListImperial (/)
 (princ (strcat "\n" (itoa (InstallScaleList StdImplScaleList)) " scales added"))
 (princ)
) ;_ end of defun

;; Command to ensure Minimal ISO scales are present
(defun c:ScaleListMinMetric (/)
 (princ (strcat "\n" (itoa (InstallScaleList MinISOScaleList)) " scale added"))
 (princ)
) ;_ end of defun

;; Command to ensure ISO scales are present
(defun c:ScaleListMetric (/)
 (princ (strcat "\n" (itoa (InstallScaleList StdISOScaleList)) " scales added"))
 (princ)
) ;_ end of defun

;; Command to remove incorrect scales & ensure standard scales
;; in relation to the MEASUREMENT sysvar
(defun c:ScaleListStandard (/)
 (princ "\nRemoving XREF scales ...")
 (c:ScaleListRemXRef);Remove XREF scales
 (if (= 0 (getvar "MEASUREMENT"))
   (progn
     (prompt "\nRemoving Metric scales ...")
     (c:ScaleListRemMetric)
     (prompt "\nInstalling Standard Imperial scales ...")
     (c:ScaleListImperial)
   )
   (progn
     (prompt "\nRemoving Imperial scales ...")
     (c:ScaleListRemImperial)
     (prompt "\nInstalling Standard Metric scales ...")
     (c:ScaleListMetric)
   )
 )
 (princ)
)


;; ----------------------------------
;; Utility functions
;; ----------------------------------

;; List of Minimum Imperial scales as per AutoCAD
(setq MinImplScaleList
      '(("1\" = 1'" 1.0 . 1.0)			;Scale type A
)
) ;_ end of setq

;; List of standard Imperial scales as per AutoCAD
(setq StdImplScaleList
      '(("1\" = 1'" 1.0 . 1.0)			;Scale type A
 ("1\" = 5'" 1.0 . 5.0)			;Scale type B
 ("1\" = 10'" 1.0 . 10.0)		;Scale type C
 ("1\" = 20'" 1.0 . 20.0)		;Scale type D
 ("1\" = 30'" 1.0 . 30.0)		;Scale type E
 ("1\" = 40'" 1.0 . 40.0)		;Scale type F
 ("1\" = 50'" 1.0 . 50.0)		;Scale type G
 ("1\" = 60'" 1.0 . 60.0)		;Scale type H
 ("1\" = 80'" 1.0 . 80.0)		;Scale type I
 ("1\" = 100'" 1.0 . 100.0)		;Scale type J
 ("1\" = 200'" 1.0 . 200.0)		;Scale type K
 ("1\" = 300'" 1.0 . 300.0)		;Scale type L
 ("1\" = 400'" 1.0 . 400.0)		;Scale type M
 ("1\" = 500'" 1.0 . 500.0)		;Scale type N
 ("1\" = 600'" 1.0 . 600.0)		;Scale type O
 ("1\" = 1000'" 1.0 . 1000.0)	;Scale type P
 ("1\" = 2000'" 1.0 . 2000.0)	;Scale type Q
 ("1\" = 3000'" 1.0 . 3000.0)	;Scale type R
 ("1\" = 4000'" 1.0 . 4000.0)	;Scale type S
 ("1\" = 5000'" 1.0 . 5000.0)	;Scale type T
 ("1\" = 6000'" 1.0 . 6000.0)	;Scale type U
)
) ;_ end of setq

;; List of standard ISO scales (from ISO 13567)
(setq MinISOScaleList
      '(("1:1" 1.0 . 1.0)		;Scale type A
)
) ;_ end of setq

;; List of standard ISO scales (from ISO 13567)
(setq StdISOScaleList
      '(("1:1" 1.0 . 1.0)		;Scale type A
 ("1:10" 1.0 . 10.0)		;Scale type B
 ("1:20" 1.0 . 20.0)		;Scale type C
 ("1:30" 1.0 . 30.0)		;Scale type D
 ("1:40" 1.0 . 40.0)		;Scale type E
 ("1:50" 1.0 . 50.0)		;Scale type F
 ("1:60" 1.0 . 60.0)		;Scale type G
 ("1:80" 1.0 . 80.0)		;Scale type H
 ("1:100" 1.0 . 100.0)		;Scale type I
 ("1:200" 1.0 . 200.0)		;Scale type J
 ("1:300" 1.0 . 300.0)		;Scale type K
 ("1:400" 1.0 . 400.0)		;Scale type L
 ("1:500" 1.0 . 500.0)		;Scale type M
 ("1:600" 1.0 . 600.0)		;Scale type N
 ("1:1000" 1.0 . 1000.0)	;Scale type O
 ("1:2000" 1.0 . 2000.0)	;Scale type P
 ("1:3000" 1.0 . 3000.0)	;Scale type Q
 ("1:4000" 1.0 . 4000.0)	;Scale type R
 ("1:5000" 1.0 . 5000.0)	;Scale type S
 ("1:6000" 1.0 . 6000.0)	;Scale type T
)
) ;_ end of setq

;; Function to obtain list of scale entity names
(defun GetScaleListEntities (/ lst item)
 (setq lst nil)
 (foreach item	(dictsearch (namedobjdict) "ACAD_SCALELIST")
   (if	(= 350 (car item))
     (setq lst (cons (cdr item) lst))
   ) ;_ end of if
 ) ;_ end of foreach
 lst
) ;_ end of defun

;; Function to obtain list of scale types in current drawing
(defun GetScaleList (/ lst lst1 item data)
 (setq	lst  (GetScaleListEntities)
lst1 nil
 ) ;_ end of setq
 (foreach item	lst
   (setq data (entget item))
   (setq lst1 (cons (vl-list* (cdr (assoc 300 data))
		       (cdr (assoc 140 data))
		       (cdr (assoc 141 data))
	     ) ;_ end of vl-list*
	     lst1
       ) ;_ end of cons
   ) ;_ end of setq
 ) ;_ end of foreach

 ;; Sort the list - most detailed to least
 (setq	lst
 (vl-sort lst1
	  '(lambda (s1 s2)
	     (> (/ (cadr s1) (cddr s1)) (/ (cadr s2) (cddr s2)))
	   ) ;_ end of lambda
 ) ;_ end of vl-sort
 ) ;_ end of setq
) ;_ end of defun

;; Function to delete scale matching a wildcard name
(defun DelScaleListMatch (pattern lst / item data count)
 (setq count 0)
 (foreach item	lst
   (setq data (entget item))
   (if	(wcmatch (cdr (assoc 300 data)) pattern)
     (progn
(entdel item)
(setq count (1+ count))
     ) ;_ end of progn
   ) ;_ end of if
 ) ;_ end of foreach
 count
) ;_ end of defun

;; Function to ensure list of scale are installed
(defun InstallScaleList (stdlst / lst item cmd)
 (setq lst (GetScaleList))		;Get list of scale entity names

 ;; Remove items from stdlst which is already in the drawing
 (setq	stdlst (vl-remove-if
	 '(lambda (e) (/= nil (assoc (car e) lst)))
	 stdlst
       ) ;_ end of vl-remove-if
 ) ;_ end of setq

 (setq cmd (getvar "CMDECHO"))
 (setvar "CMDECHO" 0)
 (command "._undo" "_Begin")
 ;; Start scalelist edit if needed
 (if (> (length stdlst) 0)
   (command ".-scalelistedit")
 )
 ;; Step through remainder of stdlst
 (foreach item	stdlst
   (command "_Add" (car item) (strcat (rtos (cadr item)) ":" (rtos (cddr item))))
 ) ;_ end of foreach

 ;; End scalelist edit if needed
 (if (> (length stdlst) 0)
   (command "_Exit")
 )
 (command "._undo" "_End")
 (setvar "CMDECHO" cmd)
 (length stdlst)
)

(princ)
;|«Visual LISP© Format Options»
(72 2 40 2 T "end of " 60 9 0 0 0 T T nil T)
;*** DO NOT add text below the comment! ***|;

Link to comment
Share on other sites

  • 2 years later...

I would love a function to merge different scales that matematically match, such as duplicated by imports (1:100 and 1:100_2) or by diffrent definition, such as

m1:100 (1000 dwg units = 100 units) and m1:100 (1 dwg units = 0.1 units) - possibly letting me to choose.

Thank you

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...