“Wblock”对话框
嘿伙计们,我正在将一些三维实体转换成可用的二维动态块,我正在编写一个快速的小lisp,这将有助于加快速度。
(defun c:test (/ obj obj2 bp name)
(setq obj (entsel))
(command
"_-view" "_top"
"flatshot" '(0 0) 1 1 0
"_erase" obj ""
"_explode" "_all"
)
(setq obj2 (ssget))
(setq bp (getpoint "\nWhere is basepoint?: "))
(setq name (getstring T "\nWhat is the name of the block?: "))
(command
"_block" name bp obj2 ""
"_insert" name '(0 0) 1 1 0
"wblock"
)
)
我的问题是wblock命令,有没有办法打开对话框?如果没有,我需要将块文件导出到不同的文件路径(不是每次,而是大部分)。。。你的方法是什么?
谢谢 你已经测试过你想要自动化的方法了吗? 您是否在WBLOCK命令之前尝试过发出initdia?进行此操作时,您需要将其分开。例如。
(initdia)
(command "WBLOCK")
都是这些我不知道的代码。。。谢谢 你打算在你的新程序中加入OVERKILL命令吗?
既然你提到了,我可能会的。
在添加wblock命令后,我意识到不需要在fshot之后创建块。所发生的事情是,块被导出到图形内部,我只需要为我的目的显示线。
(defun c:test (/ obj obj2 bp name)
(setq obj (entsel));;select 3D to flatten
(command
"_-view" "_top"
"flatshot" '(0 0) 1 1 0
"_erase" obj "";;erase 3D entitiy
"_explode" "_all";;explode fshot block
"overkill" "_all"
)
(setq obj2 (ssget));;select newly create 2D lines
(setq bp (getpoint "\nWhere is basepoint?: "));;Basepoint for Block
(setq name (getstring T "\nWhat is the name of the block?: "));;name for block
(initdia)
(command
"-wblock" "" name bp obj2
)
)
出于某种原因,它说overkill是一个未知的命令
此外,使用FSHOT命令将线宽设置为0,将线宽设置为bylayer的命令是什么? 这是我正在使用的更新代码,以防其他人发现这很有用。
添加了一些错误检查。在fshot之后仍然无法确定线宽,但我可以稍后更改。
(defun c:Z (/ obj obj2 bp un)
(if (setq un (getint "\nWhat are your units? 1-Inches 2-Feet 3-Millimeters 4-Meters "))
(progn
(cond
((= un 1)
(command
"_.insunits" 1 ""
);;end command
)
((= un 2)
(command
"_.insunits" 2 ""
);;end command
)
((= un 3)
(command
"_.insunits" 4 ""
);;end command
)
((= un 4)
(command
"_.insunits" 6 ""
);;end command
)
((> un 4)
(alert "PLEASE SELECT APPROPRIATE UNITS")
)
((< un 1)
(alert "PLEASE SELECT APPROPRIATE UNITS")
)
)
)
(alert "PLEASE SELECT APPROPRIATE UNITS")
)
(IF (setq obj (entsel));;select 3D object to flatten
(progn
(command
"_-view" "_top"
"flatshot" '(0 0) 1 1 0
"_.erase" obj "";;erase 3D entitiy
"_.explode" "_all";;explode fshot block
"_.overkill" "_all"
)
(setq obj2 (ssget));;select newly create 2D lines
(setq bp (getpoint "\nWhere is basepoint?: "));;Basepoint for Block
(initdia)
(command
"-wblock" "" bp obj2 ""
"_.CLOSE" "Y"
)
)
(alert "NO OBJECTS SELECTED!"))
(princ)
)
页:
[1]