用于设置viewpo的Lisp/DCL例程
我想知道是否有人能帮我。我要找的是一个例程,可以让你选择一个纸空间视口,弹出一个具有不同比例选择的对话框,然后将该视口更改为所选比例。我有一个lisp/dcl,它已经为文本大小/尺寸比例做了这项工作。我想知道是否有人可以帮我调整它以改变视口比例?
dsl。dcl
dsl。lsp 尝试从dcl拾取比例,然后z e拾取dwg的中心点,然后z C zzz,其中zzz是所选比例的比例因子,否则再次使用缩放ZZXP zzz是比例因子10XP=1:100
(setq sc (getstring "\nScale for this window 1:"))
(setq sc3 (strcat "1/" sc "xp"))
(setq zc (getpoint "\nPoint to centre of view in Viewport:"))
(command "_.zoom" "_center" zc sc3)
我在论坛上找到了这个例程,想知道它是否可以以某种方式集成到DSL lisp/DCL例程中?
(定义c:测试(/e s)
(if(setq e(car(entsel“\n选择要更改的视口/视图比例:”))
(if(eq“AcDbViewport”(vla get objectname(setq e(vlax ename->vla object e)))
(if(setq s(getreal)(strcat“\n指定新比例(当前:1”)
(实时操作系统(/1。(vla get customscale e))2)
"'): "
)
)
)
(vl catch all apply(函数vla put customscale)(列表e(/1.s)))
)
(普林斯“\n无效对象!”)
)
)
(普林斯)
) 只是好奇。
为什么不使用AutoCAD特性框?为什么在Lisp程序的情况下需要它? 嗯,我办公室里有些人的灯泡不是最亮的
我想用最简单的方法整理床单。“属性”框不适用于civil Scale(即1“=10”)。我认为这是一种简化模型窗口设置的方法。 也许是这个。这很简单,但很有效:
(defun C:S1() (DRAWVP1))
(defun C:S2() (DRAWVP2))
(defun C:S4() (DRAWVP4))
(defun C:S8() (DRAWVP)
(defun C:S12 () (DRAWVP 12))
(defun C:S16 () (DRAWVP 16))
(defun C:S24 () (DRAWVP 24))
(defun C:S32 () (DRAWVP 32))
(defun C:S48 () (DRAWVP 48))
(defun C:S96 () (DRAWVP 96))
---------------------------------------------------------------------------------------
(defun DRAWVP (Scale / OLDCMD CVP SS)
(setq OLDCMD (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (/= (getvar "cvport") 1)
(progn
(command "_zoom" "_s" (strcat "1/" (itoa Scale) "xp"))
(setq CVP (getvar "cvport"))
(setq SS
(ssget "_X"
(list
(cons 0 "viewport")
(Cons 69 CVP)
)
)
)
(command "_vports" "_L" "ON" SS "")
(command "_pspace")
)
)
(setvar "cmdecho" OLDCMD)
(princ)
)
(princ)
页:
[1]