halam 发表于 2022-7-5 17:50:45

管理多个自定义比例l

你好
 
如何管理默认比例(注释性)?在我的工作中,我必须能够与两个mm一起工作。m.似乎不可能使用默认选项,因为这是固定的,我看不出如何依赖于要应用的正确绘图单元。
 
 
所以我做了几行代码。但现在有点慢。我注意到LM:steal这个技能确实可以克服这个问题,但我想有一个特殊的命令。
欢迎您对他的建议和想法
 
 


(defun c:SetScale (/)
(setq getunits (getvar "insunits"))
(if (= getunits 4) (c:setscale_mm) ())
(if (= getunits 6) (c:setscale_m) ())
)


(defun c:SetScale_mm (/ lst pat tmp)
;;; Pat - the pattern scale is made up of lists of species
;;; (("Name of the Scale 1" Scale_paper_unit_1 Scale_drawing_unit_1)
;;; ("Name of the Scale 2"Scale_paper_unit_2 Scale_drawing_unit_2)
;;; ...
;;; ...
;;; Usage: (SetScale)
(setq pat '(("NLCS_MM_1:1" 1 1);_Correct scale here
             ("NLCS_MM_1:2" 1 2)
      ("NLCS_MM_1:5" 1 5)
             ("NLCS_MM_1:10" 1 10)
      ("NLCS_MM_1:20" 1 20)
             ("NLCS_MM_1:50" 1 50)
             ("NLCS_MM_1:100" 1 100)
      ("NLCS_MM_1:200" 1 200)
      ("NLCS_MM_1:250" 1 250)
      ("NLCS_MM_1:500" 1 500)
      ("NLCS_MM_1:1000" 1 1000)
      ("NLCS_MM_1:2000" 1 2000)
      ("NLCS_MM_1:2500" 1 2500)
      ("NLCS_MM_1:5000" 1 5000)
      ("NLCS_MM_1:10000" 1 10000)
            )
)

(setq tmp (mapcar 'car pat))
(setq getexpert (getvar "expert"))
(setvar "expert" 5)
(command "_.-scalelistedit" "RESET" "YES" "EXIT")
(command "_.-scalelistedit" "d" "*" "EXIT")
       (progn
         (while (> (getvar "CMDACTIVE") 0) (command))
         (command "_.-scalelistedit")
         (foreach item pat
         (command "_Add"
                  (car item)
                  (strcat (rtos (cadr item)) ":" (rtos (caddr item)))
         ) ;_ end of command
         ) ;_ end of foreach
         (command "_Exit")
         (while (> (getvar "CMDACTIVE") 0) (command))

       )
(setvar "expert" getexpert)
(princ)
)




tombu 发表于 2022-7-5 18:44:37

我一直使用史蒂夫·约翰逊的ScaleListDelhttp://www.cadforum.cz/cadforum_en/download.asp?fileID=724
您可以设置任意多个不同的。命令和说明在标题中,包括示例以供使用或作为参考。

halam 发表于 2022-7-5 19:01:16

非常感谢Tombu!
这真的很像我要找的。。
页: [1]
查看完整版本: 管理多个自定义比例l