3dwannab 发表于 2022-8-26 05:37:44

CANNOSCA 的重置和排序

大家好,
请参阅附图,其中有两个 1:1 比例。但是一个叫1:1,另一个叫1:1000。我不知道这是怎么发生的,但这是我本周在办公室看到的一幅画。
命名的 1:1000 比例在 Edit Scale GUI 中显示为灰色。
也许有人可以阐明如何解决这个问题。
这是我有 ATM 的代码,它每次都有 60% 的时间工作。


(vl-load-com); by Ian_Bryant, 2013-04-25 12:20 PM; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-lisp-to-sort-cannoscale-list/m-p/3887927#M310705; Reported bug for not sorting the scale in this reply also.; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-lisp-to-sort-cannoscale-list/m-p/11381844#M435522(defun c:Reset_Cannoscale_List_Metric (/ var_cmdecho xpt as3 ndict dict sce sx sl dl xl)(setq var_cmdecho (getvar "cmdecho"))(setvar "cmdecho" 0)(setq xpt (getvar "expert"))(setvar "expert" 5)(command "-scalelistedit" "reset" "yes" "exit")(command "-scalelistedit" "delete" "*"); List of standard ISO scales (from ISO 13567) below.; "1:1" "1:2" "1:5" "1:10" "1:20" "1:25" "1:50" "1:75" "1:100" "1:200" "1:250" "1:500" "1:750" "1:1000" "1:2000" "1:2500" "1:5000" "1:10000"(foreach n '("1:1" "1:2" "1:5" "1:10" "1:20" "1:25" "1:50" "1:75" "1:100" "1:200" "1:250" "1:500" "1:750" "1:1000" "1:2000" "1:2500" "1:5000" "1:10000")    (command "add")    (command n)    (command n))(command "exit")(setvar "expert" xpt)(setvar "cmdecho" var_cmdecho)(setq dict (dictsearch (namedobjdict) "acad_scalelist"))(setq as3   (assoc 3 dict)      ndict (cdr (member as3 (reverse dict)))      dict(member as3 dict))(while (setq as3 (assoc 3 dict))    (setq dict (member as3 dict)          dl   (cons (cdr as3) dl)          sce(cdr (assoc 350 dict))    )    (if (> (setq sx (/ (cdr (assoc 140 (entget sce))) (cdr (assoc 141 (entget sce))))) 1.0)      (setq xl (cons (cons sx sce) xl))      (setq sl (cons (cons sx sce) sl))    )    (setq dict (cdr dict)))(setq sl (vl-sort sl '(lambda (x y) (> (car x) (car y)))))(if xl (setq sl (append sl (vl-sort xl '(lambda (x y) (< (car x) (car y)))))))(setq dl (acad_strlsort dl))(setq n 0)(repeat (length dl)    (setq ndict (cons (cons 3 (nth n dl)) ndict)          ndict (cons (cons 350 (cdr (nth n sl))) ndict)          n   (1+ n)    ))(entmod (reverse ndict))(princ))(c:Reset_Cannoscale_List_Metric);;----------------------------------------------------------------------;;;;                           End of File                              ;;;;----------------------------------------------------------------------;;         
页: [1]
查看完整版本: CANNOSCA 的重置和排序