请参阅注释。。。
- (defun c:arrow (/ p1 Len Alen p2 p3)
- (if (and (setq p1 (getpoint "\nSpecify Start point of Arrow:")) ; notice these are broken up to avoid error if the first is not defined, etc.
- (setq p2 (getpoint p1 "\nSpecify End point of Arrow:")) ; only if these two variables are filled, will the routine continue
- )
- (progn
- (setq dist (distance p1 p2)
- vrt (/ dist 3)
- pickAngle (angle p1 p2)
- p3 (polar p2 (+ pickAngle (/ pi 2)) vrt)
- p4 (polar p2 (- pickAngle (/ pi 2)) vrt)
- )
- (vl-cmdf "_.pline" "_non" p1 "_w" 0 0 "_non" p3 "_non" p4 "_c") ; if you add "_non" before defining a point in any command, it will ignore any running OSnaps. Thus, you don't have to worry with osmode
- (vl-cmdf "_.-hatch" "_s" (entlast) "" "_p" "_solid" "")
- )
- )
- (princ)
- )
|