CHANGE SNAPANG BY SELECTING A LINE

CHANGE SNAPANG BY SELECTING A LINE

Sandervp
Advocate Advocate
3,698 Views
8 Replies
Message 1 of 9

CHANGE SNAPANG BY SELECTING A LINE

Sandervp
Advocate
Advocate

Hello everybody!

 

I've got a lot of lines in my drawing. Every line has got another angle. Because of this I need to my Snapangle very often using 2 points.

 

Is there a way to change the snapangle by selecting the line only instead of using 2 points?

 

Thank you

0 Likes
Accepted solutions (1)
3,699 Views
8 Replies
Replies (8)
Message 2 of 9

3wood
Advisor
Advisor

What I usually do is to change UCS, instead of changing SNAPANGLE.

UCS -> E, select a line.

Message 3 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Sandervp wrote:

.... 

I've got a lot of lines in my drawing. Every line has got another angle. Because of this I need to my Snapangle very often using 2 points.

 

Is there a way to change the snapangle by selecting the line only instead of using 2 points?

 

....

Here's my routine for that -- AlignSnapAng.lsp.  It contains two commands: AS, which only Aligns the Snap angle with the object, and ASB, which does that and also sets the SNAPBASE System Variable to a relevant point [varying depending on object type].  It works with many more entity types than just Lines [read the comments at the top].  In some cases the effect will be similar to UCS OBject, but in some cases different [for example, on an Ellipse, AS aligns the Snap angle to be tangent at the point of selection].

 

I am also attaching HatchOriginalBase.lsp, which is used by ASB when you select a Hatch pattern, to get the SNAPBASE setting at the origin from which that Hatch pattern was generated.  If you wouldn't use it that way, you can not bother with that file, and could even remove the Hatch possibility from that command.

Kent Cooper, AIA
Message 4 of 9

andrew
Enthusiast
Enthusiast

Hi all,

 

Sorry to necro this post, but my question is relevant.

 

We have a lisp that does a similar thing to this Alignsnapangle (we call it CHSA (change snap angle - which simply changes snapang to align with whatever line is selected). Anyway, neither of these work in a UCS (eg. when drawing elevations using point clouds).

 

Does anyone know of a lisp (or other ACAD function) that works in a similar way but in current UCS?

 

Many thanks.

0 Likes
Message 5 of 9

pendean
Community Legend
Community Legend
Lisp queries go here http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/bd-p/130 and remember to share you LISP's code as it may only need to be tweaked and not replaced
0 Likes
Message 6 of 9

Sandervp
Advocate
Advocate

Thanks Kent Cooper!

 

The AlignSnapAng.lsp is just what I was looking for!

0 Likes
Message 7 of 9

Sandervp
Advocate
Advocate

Hello Kent1Cooper,

 

I'm using your snapang lisp daily, but sometimes it doesn't work. The reason why is because the Z-value isn't zero. If the line doesn't have a start- and endpoint of Z=0, I have to use the normal snapang command.

 

What do I have to change in the lisp file to make it working with those lines?

 

Thank you

0 Likes
Message 8 of 9

pendean
Community Legend
Community Legend
SNAPANG is a 2D function, as is the LISP.
Sounds like you need to explore rotating your UCS and aligning with it as a solution instead. the LISP forum to ask for help with such coding is over here https://forums.autodesk.com/t5/autocad-customization/ct-p/AutoCADTopic1
0 Likes
Message 9 of 9

Kent1Cooper
Consultant
Consultant

@Sandervp wrote:

.... sometimes it doesn't work. The reason why is because the Z-value isn't zero. ....

 

What do I have to change in the lisp file to make it working with those lines?

....


If you want to align the Snap angle in the current drawing plane with the XY-only direction of something, ignoring any Z component(s), that shouldn't be too hard -- is that what you're after?  If you want to align it in 3 dimensions, as @pendean says, it will involve changing the User Coordinate System, and other questions will arise, most significantly that in 3D, for any two endpoints of an X axis, there are infinite options for the directions of the Y and Z axes -- would you have a criterion for determining which way the drawing plane should be oriented?

Kent Cooper, AIA
0 Likes