嗨,LSA,
这里是我的代码,我只是为您创建了一个特殊的,并进行了测试
- (defun c:test (/ loc rad p1 p2 el1 dia p3 el2 p4 el3 el4)
- (setq loc (getpoint "\nClick any location for object<0,0,0>: "))
- (if (= loc nil)(setq loc '(0 0 0)))
- (setq rad (getdist "\nEnter radius for duct<1>: "))
- (if (= rad nil)(setq rad 1))
- (setq p1 (polar loc 0 rad))
- (setq p2 (polar loc (* pi 0.5) rad))
- (command "_arc" "c" loc p1 p2 "")
- (setq el1 (entlast))
- (setq dia (getdist "\nEnter diameter for duct<2>: "))
- (if (= dia nil)(setq dia 2))
- (setq p3 (polar p1 0 dia))
- (command "_offset" dia el1 p3 "")
- (setq el2 (entlast))
- (setq p4 (polar p2 (* pi 0.5) dia))
- (command "_line" p1 p3 "")
- (setq el3 (entlast))
- (command "_line" p2 p4 "")
- (setq el4 (entlast))
- (command "_region" el1 el2 el3 el4 "")
- (princ)
- )
|