Restricting Line direction

Restricting Line direction

Anonymous
Not applicable
298 Views
5 Replies
Message 1 of 6

Restricting Line direction

Anonymous
Not applicable
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
0 Likes
299 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
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
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks antmjr

I will give a try.

Is there any other way.

Sri
0 Likes
Message 4 of 6

Anonymous
Not applicable
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 "srinivasan" wrote in message news:1029827.1101883518301.JavaMail.jive@jiveforum2.autodesk.com... > 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
0 Likes
Message 5 of 6

Anonymous
Not applicable
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
0 Likes
Message 6 of 6

Anonymous
Not applicable
what an idiot I’m! you don’t need a block: simply draw a 1 dwgUnit length Line with the direction angle you wish; then scale it by picking on the screen
0 Likes