Skip to main content
Jul 23, 2014 6:08 AM UTC
Question

Small macro for Drafting to interactively change the distance of hatches

If the distance of the selected hatching is;

- between 0 and 10, the increment is 1,

- between 10 and 100, the increment is 10,

- between 100 and 1000, the increment is 100,

- above 1000, the distance is kept to 1000.

The increment is in current unit.

For example, to increase the distance:       Hach_chg_int_inc 1

and to decrease the distance:       Hach_chg_int_inc -1

The increment can be made finer or coarser. For example:      Hach_chg_int_inc 0.5    or   Hach_chg_int_inc 2

DEFINE Hach_chg_int_inc

  PARAMETER Pm

  LOCAL Cloture

  LOCAL Interval

  LOCAL Pt

  LOOP

    READ PNT "Select hatching for changing the distance" Pt

    INQ_ENV 1 LET Cloture (INQ 2)

    INQ_SELECTED_ELEM HATCHING PICK_VP_PNT Cloture Pt

    LET Interval ( INQ 3 )

    IF ( Interval < 10 )

      LET Interval ( Interval + Pm*1 )

      IF ( Interval < 0 ) LET interval 0 END_IF

    ELSE_IF (( Interval >= 10 ) AND ( Interval < 100) )

      LET Interval ( Interval + Pm*10)

      IF ( Interval < 10 ) LET interval 9 END_IF

    ELSE_IF (( Interval >= 100 ) AND ( Interval < 1000) )

      LET Interval ( Interval + Pm*100)

      IF ( Interval < 100 ) LET interval 90 END_IF

    ELSE

      IF ( Pm = -1 )

        LET Interval 900

      ELSE

        LET Interval 1000

      END_IF

    END_IF

    CHANGE_HATCH_DIST Interval PICK_VP_PNT Cloture Pt

  END_LOOP

END_DEFINE