chelsea1307,
请参阅下面的代码。
它正在寻找一个层调用txt。
我添加了一个图层命令,如果图层不在图形中,则生成该图层。
还要确保块调用sa位于acad搜索路径中。
如果图形中已经有这些图层,请跳过此操作。
除此之外,他们似乎工作。我没有得到你所指的错误。
这是可能的,因为程序中的变量未声明为局部变量,并且
可能与可能加载的另一个程序发生干扰。
只是一个猜测。
- ;inserts air direction arrow (supply)
- (defun c:sa ()
- (setq ortho (getvar "orthomode"))
- (setq scl (getvar "dimscale" ))
- (setvar "orthomode" 1)
- (command "_-layer" "_make" "txt" "") ;I added this line
- (setq pnt (getpoint "\nPick insertion point:" ))
- (setq a (getangle "\nAngle?:" pnt ))(terpri)
- (setq ang ( * a 57.3))
- (command "_-layer" "_set" "txt" "")
- (command "_-insert" "sa" pnt scl scl ang) ;Make sure this block is in the acad path
- )
- ;inserts 4 way air direction arrows for diffuser
- (defun c:4sa ()
- (SETVAR "OSMODE" 64)
- (SETQ INS (GETPOINT "\nPICK POINT"))
- (COMMAND "ID" INS)
- (command "_-layer" "_make" "txt" "") ;I added this line
- (setvar "clayer" "txt")
- (setq scl (getvar "dimscale" ))
- (command "_-insert" "sa" "@15,0" scl scl 0) ;Make sure this block is in the acad path
- (COMMAND "_ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
- (SETVAR "OSMODE" 0)
- )
|