BIGAL 发表于 2022-7-5 18:13:36

Left Right Up & Down

Often I just need to draw a simple ortho shape so I press F8 drag mouse type distance etc etc fall over fingers in process. So why not just up left down right close. So maybe its useful maybe not but I have posted it here. Just type direction LRDU or lrdu plus the distance. It could add say 45's also using other alpha characters.
 

; 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 requests 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; L34.57 ; d102.6 ; r53 ; C orto leave open; as many entries as you like(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:LUDR ( / 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)
页: [1]
查看完整版本: Left Right Up & Down