TheSwamp

CAD Forums => CAD General => Topic started by: DanB on October 05, 2012, 11:09:56 AM

Title: Perpendicular at midpoint
Post by: DanB on October 05, 2012, 11:09:56 AM
Every time I do this I think there might be a "better" way. Draw a line, any angle. Draw a second line perpendicular to the first line where the second line starts at the midpoint of the first line. This should create a "T" of sorts, lengths are not important for the excercise. I've always drawn the second line by starting a distance away from first, then back, perpendicular snap to the first line, move to midpoint. I'm not looking for a lisp routine or coding, just curious if there's a..different way..
Title: Re: Perpendicular at midpoint
Post by: Lee Mac on October 05, 2012, 11:19:30 AM
Maybe not 'better', but another way might be to set UCS to object and turn Orthomode on.
Title: Re: Perpendicular at midpoint
Post by: Rob... on October 05, 2012, 11:23:21 AM
Object snap tracking and polar tracking.
Title: Re: Perpendicular at midpoint
Post by: Mark on October 05, 2012, 11:25:47 AM
Code: [Select]
Command: line
Specify first point:
Specify next point or [Undo]:
Specify next point or [Undo]:

Command: SNAPANG
Enter new value for SNAPANG <0>:  Specify second point:

Command: line

Specify first point: mid
of
Specify next point or [Undo]:  <Ortho on>
Specify next point or [Undo]:
Title: Re: Perpendicular at midpoint
Post by: Lee Mac on October 05, 2012, 11:29:57 AM
I know you said you weren't looking for code, but here is a short snippet which may streamline the process a little:

Code: [Select]
(defun c:per ( / *error* e o p )
    (defun *error* ( m )
        (if o (progn (setvar 'orthomode o) (command "_.ucs" "_p")))
        (princ)
    )
    (if (and
            (setq p (getpoint "\nSpecify first point: "))
            (setq e (car (nentselp p)))
        )
        (progn
            (setq p (trans p 1 0))
            (command "_.ucs" "_ob" e)
            (setq o (getvar 'orthomode))
            (setvar 'orthomode 1)
            (command "_.line" "_non" (trans p 0 1))
            (while (< 0 (getvar 'cmdactive)) (command "\\"))
            (setvar 'orthomode o)
            (command "_.ucs" "_p")
        )
    )
    (princ)
)

(http://www.theswamp.org/lilly_pond/leemac/perpshortcut.gif)
Title: Re: Perpendicular at midpoint
Post by: DanB on October 05, 2012, 01:21:34 PM
Thanks all, always good to have a fresh look at some different methods. I like the snapang idea, going to try out Lee's code now.
Title: Re: Perpendicular at midpoint
Post by: danallen on October 05, 2012, 01:22:23 PM
grips!

pick line to highlight grips
pick midpoint
enter
enter (to get rotate)
c for copy
90 to rotate
enter

done!

Every time I do this I think there might be a "better" way. Draw a line, any angle. Draw a second line perpendicular to the first line where the second line starts at the midpoint of the first line. This should create a "T" of sorts, lengths are not important for the excercise. I've always drawn the second line by starting a distance away from first, then back, perpendicular snap to the first line, move to midpoint. I'm not looking for a lisp routine or coding, just curious if there's a..different way..
Title: Re: Perpendicular at midpoint
Post by: CAB on October 05, 2012, 02:06:38 PM
Several in this tread.
http://www.theswamp.org/index.php?topic=1468.msg389018#msg389018