visual lisp for autocad 是什么

如题所述

是用于AutoCAD二次开发的编程语言,即:可视化lisp语言。例如:
( defun c:safe ( / TH I1 pt pt1 pt2 ptm pts pte ptc rx ang olderr )
( setq TH 3.5 olderr *error* *error* myerr
I1 ( getvar "useri1" ))
(modes '("cmdecho" "osmode" ))
( setvar "cmdecho" 0 )
( setvar "osmode" 0 )
( initget 1 )
( setq pts ( getpoint "\n选择标注起始点: " ))
( initget ( + 1 2 4 ))
( setq rx ( getdist pts "\n最小安全净距<mm>: "))
( command "color" "red" )
( command "circle" pts rx )
( command "color" "bylayer" )
( initget 1 )
( setq pt1 ( getpoint pts "\n选择弧的起始角方向(按逆时针方向): " ))
( initget 1 )
( setq pt2 ( getpoint pts "\n选择弧的终止角方向: " ))
( command "erase" "l" "" )
( command "arc" "c" pts ( polar pts ( angle pts pt1 ) rx )
( polar pts ( angle pts pt2 ) rx ))
( initget 1 "External" )
( setq pte ( getpoint pts "\nE-标注在弧外部/<标注文字点>: "))
( if ( = pte "External" )
( progn
( initget 1 )
( setq pte ( getpoint pts "\n标注文字引出点: "))
( sfLine pts pte ( itoa ( fix rx )))
( setq ptc ( polar pts ( angle pts pte ) rx ))
( command "pline" ptc "w" 0 ( * I1 0.35 )
( polar ptc ( angle pte pts ) ( * 3.0 I1 )) "" )
); progn
( progn
( setq ang ( angle pts pte )
pte ( polar pts ang rx )
ptc pte pt pts
ptm ( polar pts ang ( / ( distance pts pte ) 2.0 )))
( if ( and ( > ang ( * 0.5 pi ))
( <= ang ( * 1.5 pi )))
( setq pt pts pts pte pte pt
ang ( angle pts pte )
)); if - setq
( command "line" pts pte "" )
( command "pline" ptc "w" 0 ( * I1 0.35 )
( polar ptc ( angle ptc pt ) ( * 3.0 I1 )) "" )
( command "text" "j" "bc" ( polar ptm ( + ang ( * 0.5 pi )) ( * I1 1.5 ))
( * I1 TH ) ( * 180.0 ( / ang pi)) ( itoa ( fix rx )))
); progn
); if
( moder )
( setq *error* olderr )
(princ)
); c:safe
温馨提示:答案为网友推荐,仅供参考
相似回答