你好
我做了这个简单的Autolisp程序,但它并没有完成这个姿势。
可能是由于角度错误(72)。或该线的长度(125.873)。
注意:在执行程序后,请注意起点和终点没有连接。。。。为什么?
- (defun c:ax (/ p1 p2 p3 p4 p5 oldsnap oldortho newortho)
- (setq small 38)
- (setq pcs1 (getdist"\nLength of First peice: "))
- (setq p1 (getpoint"\nSpecify the start point of peice:"))
- (setq p2 (polar p1 (DTR 270) 120))
- (setq p3 (polar p2 (DTR 0)(- pcs1 small)))
- (setq p4 (polar p3 (DTR [color="red"]72[/color]) [color="Red"]125.873[/color]))
- (setq p5 (polar p4 (DTR 180) pcs1))
- (setq oldsnap (getvar "osmode"))
- (setq oldortho (getvar "orthomode"))
- (setq newsnap (setvar "osmode" 0))
- (setq newortho (setvar "orthomode" 0))
- (command "_pline" p1 "_w" 0 0 p2 p3 p4 p5 "")
- (setvar "osmode" oldsnap)
- (setvar "orthomode" oldortho)
- (princ "Made by Tharwat")
- (princ))
- ;++++++++++++ degree to radians ++++++++++++
- (defun DTR (ang)(* pi (/ ang 180.0)))
非常感谢您的帮助。。。
谢谢
塔瓦特 |