Restricting Line direction

Discussion in 'AutoCAD' started by srinivasan, Dec 1, 2004.

  1. srinivasan

    srinivasan Guest

    Hello all

    I am using getpoint method in the vba to get the start point and secondt point with respect to the start point.
    Now what i need is to prevent the user to move only along
    the zero angle direction from the start point.
    If i am using ortho i am able to move in 180,90 and 270 directions also.
    How to prevent the user along a particular direction for the second point.

    Thanks in advance
    Sri
     
    srinivasan, Dec 1, 2004
    #1
  2. srinivasan

    antmjr Guest

    I'd rotate the ucs and set the orthomode on. To rotate the ucs via vba, you
    need the X and Y vectors; otherwise you can use sendcommand "ucs" "new"
    "zaxis" and so on
     
    antmjr, Dec 1, 2004
    #2
  3. srinivasan

    srinivasan Guest

    Thanks antmjr

    I will give a try.

    Is there any other way.

    Sri
     
    srinivasan, Dec 2, 2004
    #3
  4. FWIW,

    You could put your GetPoint in a loop that will only exit if:
    1) X(second pt) > X(first pt) and
    2) Y(second pt) - Y(first pt) is approximately 0.0 (fuzzy equal)

    Then if you wanted to be mean, you could turn off ORTHO and they'd never be
    able to draw a line straight enough. :)

    But really, if they click a point that is not valid, you could either MsgBox
    them, or just ignore it... they'll learn quick that it has to go to the
    right.

    Or... another thought popped into my head... you could let them pick *any*
    point, and calculate the X-component of it yourself... if the X component is
    negative, just use 0.

    James


    point with respect to the start point.
     
    James Belshan, Dec 2, 2004
    #4
  5. srinivasan

    antmjr Guest

    another way: you could insert a block (maybe *U block), consisting of a line of 1 dwgUnit length, having the insertion point in StartPoint of the line and the rotation angle you wish ; then you scale the block (using the same insertion point as base point) and enter the scalefactor by picking a point on the screen; eventually you explode the block to get your line
     
    antmjr, Dec 2, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.