本帖最后由 kucha007 于 2023-3-15 09:38 编辑
试试这个?
- (defun c:TT (/ Old_Ort p1 p2 p3 p4)
- (defun *error* ( msg );定义出错函数
- (command "_.UCS" "P" )
- (setvar "OrthoMode" Old_Ort)
- )
- (if
- (and
- (setq p1 (getpoint "\n→请选择旋转中心: "))
- (setq p2 (getpoint p1 "\n→请选择X轴正方向: "))
- )
- (progn
- (setq Old_Ort (getvar "OrthoMode"))
- (setvar "OrthoMode" 1)
- (setq P3 (trans P1 1 0))
- (setq P4 (trans P2 1 0))
- (command "_.UCS" "_Z" (Angtos (Angle P1 p2) 0 15))
- (COMMAND "_Pline" (trans P3 0 1) (trans P4 0 1) PAUSE)
- (while (/= 0 (getvar 'cmdactive))(vl-cmdf pause));等待命令结束
- (command "_.UCS" "P" )
- (setvar "OrthoMode" Old_Ort)
- )
- )
- (princ)
- )
|