#16
|
||||
|
||||
Re: Point Angle
OK, I think I finally understand exactly what you want the macro to do. Try this one.
Code:
DEFINE Stretch_line LOCAL Pick_pnt1 LOCAL Pick_pnt2 LOCAL Pick_type LOCAL Epnt_1 LOCAL Epnt_2 LOCAL Line_angle LOCAL Line_length LOCAL Seg_1 LOCAL Seg_2 LOCAL Keep_pnt LOCAL Pick_dist LOCAL Theta LOCAL Trim_dist LOCAL Trim_pnt LOOP LOOP READ PNT 'Indicate line, near end to extend.' Pick_pnt1 INQ_ELEM Pick_pnt1 LET Pick_type (INQ 403) EXIT_IF (Pick_type=LINE) END_LOOP LET Epnt_1 (INQ 101) LET Epnt_2 (INQ 102) MEASURE_DISTANCE Epnt_1 Epnt_2 LET Line_length (INQ 3) MEASURE_DISTANCE Pick_pnt1 Epnt_1 LET Seg_1 (INQ 3) MEASURE_DISTANCE Pick_pnt1 Epnt_2 LET Seg_2 (INQ 3) IF (Seg_1 > Seg_2) LET Keep_pnt Epnt_1 LET Line_angle (ANG(Epnt_2-Epnt_1)) ELSE LET Keep_pnt Epnt_2 LET Line_angle (ANG(Epnt_1-Epnt_2)) END_IF LOOP READ PNT 'Indicate next point.' RUBBER_LINE_ANG Keep_pnt Line_angle Pick_pnt2 EXIT_IF (Pick_pnt2<>Keep_pnt) END_LOOP MEASURE_DISTANCE Keep_pnt Pick_pnt2 LET Pick_dist (INQ 3) LET Pick_angle (ANG(Pick_pnt2-Keep_pnt)) LET Theta (Pick_angle - Line_angle) LET Trim_dist (Pick_dist*(COS Theta)) LET Trim_pnt (Keep_pnt + (PNT_XY (Trim_dist*(COS Line_angle)) (Trim_dist*(SIN Line_angle)))) MODIFY Pick_pnt1 SCALE CENTER Keep_pnt (Trim_dist/Line_length) END_LOOP END_DEFINE
__________________
John Scheffel |
#17
|
|||
|
|||
Re: Point Angle
Thank You It's Work Correctly.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|