drawing a perpendicular line from a point on the line

Anonymous

drawing a perpendicular line from a point on the line

Anonymous
Not applicable

How to drawing a perpendicular line from a point on the line ?

0 Likes
Reply
Accepted solutions (3)
77,412 Views
22 Replies
Replies (22)

imadHabash
Mentor
Mentor
Accepted solution

Hi and Welcome to AutoDesk forum,

 

the solution exist on turning on your ortho F8 . But if you have oblique lines first you have to make your UCS with that oblique line.

 

Command: UCS
Current ucs name: *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis] <World>:

 

 

 

Imad Habash

EESignature

0 Likes

ВeekeeCZ
Consultant
Consultant
Accepted solution
Or you can draw XLINE.

BeKirra
Advisor
Advisor
Accepted solution

@Anonymous wrote:

How to drawing a perpendicular line from a point on the line ?


You may try this:

1) Setup "Object Snap" on you drawing by using command osnap. Then tick the "Perpendicular" box in the pop up dialog.

2) Draw a line starting from a point then move your cursor slowly to an existing line. click the point on the line where you see a green mark indicating your drawing line is now perpendicular to the existing line.

 

HTH

Please mark "Accept as Solution" and "Like" if my reply resolves the issue and it will help when others need helps.
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²

Anonymous
Not applicable

Dear Mr. ah2m67

 

Please find the attached screen cast for your reference

 

To enable the osnap mode hold shift key and right click to enable the option

 

Hope this could help you

 

Regards

Di****h.MC

0 Likes

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

How to drawing a perpendicular line from a point on the line ?


I think most other Replies have misunderstood what you want to do.  Several are about the ordinary PERpendicular Object Snap mode, which is PERpendicular to something.  As I read it [it seems pretty clear from your wording], you want to draw perpendicular from something, and without necessarily anything else around that you can go PERpendicular to.  You can do that without needing to change the UCS as has been suggested, by using the "<angle" format and feeding in the angle perpendicular to the object [in your request, a Line, but any appropriate object] at the specified point.  Try this:

(defun pf ()
  (strcat
    "<"
    (angtos
      (+
        (angle
          '(0 0 0)
          (vlax-curve-getFirstDeriv
            (setq ent (car (nentselp (getvar 'lastpoint)))); entity
            (vlax-curve-getParamAtPoint
              ent
              (osnap (getvar 'lastpoint) "_nea")
            ); ...Param
          ); ...FirstDeriv
        ); angle
        (/ pi 2); [perpendicular]
      ); +
      (getvar 'aunits) 8
    ); rtos
  ); strcat
); defun
(vl-load-com)

 

 

Include that in your acaddoc.lsp file if you have one, or save that to a file with a .lsp filetype ending, named whatever you want [I would call it something like PerFrom.lsp], and APPLOAD it.

 

It is written to be used after you have given whatever you're drawing a first point.  It's not restricted to drawing a Line, but can be used in drawing a Polyline, or for a Text rotation, or for the second point of a Move or Copy displacement, or for other purposes.  And it doesn't need to be a point on a Line that you start from , but can be on anything with linearity [Line, Polyline, Arc, Circle, Spline, Ellipse] -- anything that qualifies in the "curve" class for (vlax-curve-...) functions.

 

Usage:  in the case of your request -- drawing a Line perpendicular from another Line -- call up the Line command and give it a starting point at the place you want to draw perpendicular from on the existing Line [whether using NEArest or ENDpoint or MIDpoint Object Snap, or with Snap on if the existing Line was drawn that way, or whatever].  Then, when it's asking for the next point, type in (pf) [with the parentheses], which stands for "perpendicular from".  That will lock in the direction for drawing the new Line to perpendicular [in either direction] from the existing one.

 

Use it similarly for the other purposes mentioned -- any time it's asking for a next point when the previous point was on some object with linearity.  In drawing a Line or Polyline, it can also be used for the next Line or Polyline segment, and will lock the direction in to perpendicular from the latest segment.

 

If that works for you, you can put it into a menu item to pick on, if that's easier than typing it in.

 

[By the way, it isn't written to account for, and I haven't tried it in, other-than-World Coordinate Systems, but could probably be adjusted for that, if necessary.  It also wants the from point to be unambiguous, that is, if you pick at something like an INTersection, I don't think you can control which intersecting object it's going to find the perpendicular direction from.]

Kent Cooper, AIA

GrantsPirate
Mentor
Mentor

Rotating the UCS is very quick and easy.  UCS, OB, (pick line).  Draw with ortho on.  UCS, W to get back.  This can be easily automated to UO for object and UW for World and it is handy for lots of other scenarios as well. 


GrantsPirate
Piping and Mech. Designer
EXPERT ELITE MEMBER
Always save a copy of the drawing before trying anything suggested here.
----------------------------------------------------------------------------
If something I wrote can be interpreted two ways, and one of the ways makes you sad or angry, I meant the other one.

wwork
Participant
Participant

A two command drafting solution.

Place new line using deferred Perpendicular object snap. Move new line to desired location.

 

  1. Invoke the LINE command
    1. Specify the PERpendicular object snap (Shift+right-click-->Perpendicular).
    2. Touch existing line (See Deferred Perpendicular cursor badge.)
    3. Click to begin new line.
    4. Specify the NONe object snap (Shift+right-click-->None).
    5. Click endpoint of new line. (This line will be perpendicular to existing line.)
  2. MOVE new line to desired location.

3. If necessary use LENGTHEN, TRIM, EXTEND or FILLET to adjust length of new line.

Kent1Cooper
Consultant
Consultant

@GrantsPirate wrote:

Rotating the UCS is very quick and easy.  UCS, OB, (pick line).  Draw with ortho on.  .... 


That will serve for the specific situation in the OP's question [perpendicular from a Line], as well as to draw perpendicular from a Polyline line segment or a Circle at the given point.  But not for an Arc, Polyline arc segment, Ellipse, or Spline, any of which (pf) can handle.  Also, in addition to not needing to play with the UCS, (pf) is totally unaffected by whether or not Ortho is on.  And the UCS approach can't be used if you want to use something like this in mid-command [e.g. within a Line or Move or Copy or whatever command], because you'd have to get out of the command to change the UCS.

Kent Cooper, AIA
0 Likes

BeKirra
Advisor
Advisor

Oops! Kent is right and I didn't read the post carefully…

Apart from Kent and Imad's solutions, the command ".MoCoRo" from Express Tools also works as the 1st point on the existing line was specified.

Please mark "Accept as Solution" and "Like" if my reply resolves the issue and it will help when others need helps.
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²

Pointdump
Mentor
Mentor

A,

 

Welcome to the Autodesk Forum.

 

"...perpendicular line from a point on the line..."

 

The big question: are you wanting this in 2D or 3D? If 2D, then Object Snap Tracking will make it happen. Hover over the first line before making the second point of your new perpendicular line:

 

OST1.png

 

 

 

Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2024
0 Likes

Anonymous
Not applicable

Take polar settings and check " relative to last segment" instead of absolute by default 

0 Likes

Shaun-CityofKelso
Contributor
Contributor

Thanks!

0 Likes

Shaun-CityofKelso
Contributor
Contributor

Thank you so so much! Works like a charm.

0 Likes

Anonymous
Not applicable

@GrantsPirate Thank you. Very useful! Special for a beginner 🙂

Automate? I like that. It is like 'newobj = obj.method()' ?

Cheers.

0 Likes

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:

@Anonymous wrote:

How to drawing a perpendicular line from a point on the line ?


....  You can do that without needing to change the UCS as has been suggested, by using the "<angle" format and feeding in the angle perpendicular to the object ... at the specified point.  Try this:
.... save that to a file with a .lsp filetype ending, named whatever you want [I would call it something like PerFrom.lsp]....


I found that it doesn't work right when what you are trying to go Perpendicular From is a "heavy" Polyline, whether 2D or 3D.  Attached is an update that corrects that.

Kent Cooper, AIA

Yuzheng19711219BQQFP
Community Visitor
Community Visitor

After coping and pasting your code to notepad, and saving it as PerFrom.lsp, then "Appload" this routine in autocad plant 3d, to type "pf", it reflects

Command: PF
; error: unable to get ObjectID: nil

Any help is welcomed.

0 Likes

Kent1Cooper
Consultant
Consultant

It's not a command to be started at the Command: prompt, but a function that you call within another command.  For example, start a LINE command, pick a point on some object, then type in (pf) including the parentheses.  See the description at its first appearance [Message 6].  But don't paste code from there.  Use the file attached to the Message just before yours [16].

Kent Cooper, AIA
0 Likes

ВeekeeCZ
Consultant
Consultant

... how about to make it a command c:pf, then it could run with 'pf.

0 Likes

Kent1Cooper
Consultant
Consultant

@ВeekeeCZ wrote:

... how about to make it a command c:pf, then it could run with 'pf.


And what would you expect to happen if you typed in the command name PF without being in a command, and without a reference point?  If someone wanted a single-purpose command, for example one that would always and only start a LINE command perpendicular from something, that could be done.  But (pf) works for many other things, like MOVE or COPY displacements, the second point in a 2P Circle, the next segment in a Polyline, etc.

Kent Cooper, AIA
0 Likes