为此,必须一次添加每个段,并使用ENTLAST函数检索它。添加了功能编辑示例。
- (if (and (setq pt1 (getpoint))
- (setq pt2 (getpoint pt1)))
- (progn
- (setq ang (+ (angle pt1 pt2) (/ pi 2.0)))
- (setq pt3 (polar pt2 ang 1.5))
- [color=magenta] (command "_LINE" "_non" pt1 "_non" pt2 "")(setq entity1st (entlast))[/color]
- [color=magenta] (command "_LINE" "_non" pt2 "_non" pt3 "")(setq entity2nd (entlast))[/color]
- [color=magenta] (command "_LINE" "_non" pt3 "_non" pt1 "")(setq entity3rd (entlast)) [/color]
- [color=blue] ;set color of first line entity to yellow[/color]
- [color=blue] (command "_CHPROP" entity1st "" "_C" 2 "")[/color]
- )
- )
|