大家好,我正试图让我的lisp例程调用dcl对话框,根据用户选择的幻灯片执行不同的功能。
目前,lisp只使用1个修剪长度,而不管我是否尝试让它这样做。我知道我的问题在(action_tile)中,如果我能找到人帮我们纠正这个问题,我将不胜感激。提前谢谢,现在让我们看看代码:
- (action_tile "Slide12"
- "(progn
- (setq Return$ Slide12$)(setq doAction 'T)
- (done_dialog)
- )"
- )
-
- (action_tile
- "cancel"
- "(done_dialog) (setq doAction nil)")
-
- (start_dialog)
- (unload_dialog Dcl_Id%)
- (if doAction (SmallVLVInsert))
- (princ)
- );defun c:Smallvalves
-
- (done_dialog)
- (defun SmallVLVInsert ( / ss p2 p3)
- (done_dialog)
- (command "attreq" "0")
- (if (eq 16384 (logand 16384 (getvar "osmode")))
- (setvar "OSMODE" (boole 6 (getvar "OSMODE") 16384)))
- (command "snap" "0.0625")
- (setq insertpt1 (getpoint "\nPick Insertion Point on line: "))
- (if (not (tblsearch "layer" "pid"))
- (entmake
- (list
- (cons 0 "Layer")
- (cons 100 "AcDbSymbolTableRecord")
- (cons 100 "AcDbLayerTableRecord")
- (cons 2 "pid")
- (cons 70 0)
- (cons 62 3)
- (cons 6 "Continuous")
- )
- )
- )
- (setq Snap (getvar "osmode"))
-
- (setvar "clayer" "pid")
- (command "_insert" Return$ insertpt1 "" "" "")
- (while (not ss)
- (setq ss (entsel "\nSelect line to break: "))
- );while
- ;(while (not p3)
- (setvar 'osmode 613)
- (setq p3 (getpoint "\nPick valve center:")
- p2 (angle p3 (cadr ss))
- )
- (command "break" ss "f" (polar p3 p2 0.093750)
- (polar p3 p2 -0.093750))
- (setvar "cmdecho" 1)
- (princ)
- (setvar "osmode" Snap)
- );if
这只是一个小摘录,但我相信它充分说明了我的问题。
如果我想在最后一个右括号下方添加第二个函数“;If”,
然后,例程似乎只看到第一个函数,并将在第一个defun SmallVlvInsert中指定的距离内修剪选定块周围的线。我想添加一个FlanSmlValveInsert,用于修剪。1172而不是SmallVlvInsert中的0.093750,但以相同的方式修剪,因为它工作良好。当然,我们会欣然接受任何升级或错误检查,并将其放入此代码中。
我希望这能奏效。。。。非常感谢。 |