这是ludr。lsp沿正确的正交方向移动,只需执行r5,它就会将对象5向右移动。现在我把它放在哪里了,我把它贴在这里了。正在尝试查找。我想我是作为普林的一部分做的。它可能在家里。
- ; draw a pline by direction Up Down left or Right use upper or lowercase
- ; by Alan H dec 2015
- ; this version is a metric/decimal version
- ; version 2 depending on request will be a imperial version
- ; 1'8 1/4" input d1.8.25 start with 1.8 = 1'8" then add second fraction ver 3
- ; how to use u123.45 D34.57 R102.6 l53
- (defun ah:left ( / pt2)
- (setq pt2 (polar pt pi (atof (substr ans 2 (- (strlen ans) 1)))))
- (setq pt pt2)
- (command pt2)
- )
- (defun ah:up ( / pt2)
- (setq pt2 (polar pt (/ pi 2.0) (atof (substr ans 2 (- (strlen ans) 1)))))
- (setq pt pt2)
- (command pt2)
- )
- (defun ah:right ( / pt2)
- (setq pt2 (polar pt 0.0 (atof (substr ans 2 (- (strlen ans) 1)))))
- (setq pt pt2)
- (command pt2)
- )
- (defun ah:down ( / pt2)
- (setq pt2 (polar pt (* 1.5 pi) (atof (substr ans 2 (- (strlen ans) 1)))))
- (setq pt pt2)
- (command pt2)
- )
- (defun C:ahpliner ( / pt ans)
- (command "_pline")
- (command (setq pt (getpoint "Pick start point - Enter or C to finish")))
- (while (= (getvar "cmdactive") 1 )
- (setq ans (getstring "Enter L123 U456 R67 D78"))
- (cond ((= ans "")(command ""))
- ((= "L"(strcase (substr ans 1 1)))(ah:left))
- ((= "U"(strcase (substr ans 1 1)))(ah:up))
- ((= "D"(strcase (substr ans 1 1)))(ah:down))
- ((= "R"(strcase (substr ans 1 1)))(ah:right))
- ((= "C"(strcase (substr ans 1 1)))(command "close"))
- ) ;cond
- ) ; while
- )
|