Drawing a Round-Ended Slot
This macro will draw a round-ended slot of any size, at any angle to the axes.
DEFINE A_slot_macro
LOCAL W
LOCAL P1
LOCAL V
LOCAL P2
READ NUMBER 'Enter the slot width' W
LOOP
FOLLOW OFF
COLOR WHITE
LINETYPE SOLID
READ PNT 'Pick one center point' P1
READ PNT 'Pick the other center point' RUBBER_LINE P1 P2
LET V (ROT (( P2 - P1 ) * ( W /2 ) / (LEN (P2 - P1))) 90)
ARC CEN_BEG_END P1 ( P1 + V ) ( P1 - V )
ARC CEN_BEG_END P2 ( P2 - V ) ( P2 + V )
LINE POLYGON ( P1 - V ) ( P2 - V )
LINE POLYGON ( P1 + V ) ( P2 + V )

LET V ( V * 1.5 )
COLOR YELLOW
LINETYPE DOT_CENTER
LINE POLYGON ( P1 - V ) ( P1 + V )
LINE POLYGON ( P2 - V ) ( P2 + V )
LET V ( ROT V 90 )
LINE POLYGON ( P1 + V ) ( P2 - V )
END_LOOP
COLOR WHITE
LINETYPE SOLID
END_DEFINE
È stato utile?