AutoCAD - Drawing lines at constant offset using the Draw Line command?

AutoCAD - Drawing lines at constant offset using the Draw Line command?

Over-Dose
Advocate Advocate
2,094 Views
6 Replies
Message 1 of 7

AutoCAD - Drawing lines at constant offset using the Draw Line command?

Over-Dose
Advocate
Advocate

Hi.

 

I'm using AutoCAD 2023 on Windows 10.

 

I'm currently producing a drawing that has an X-ref base (which I've made to print lightly) and the new lines I'm drawing in various places need to be at a set distance away from the base x-ref geometry.

 

Is there a way (or command) in AutoCAD that allows me to draw (and OSNAP to) a fixed distance away from existing geometry (e.g. 100mm or 150mm or whatever)? So that I can set the value, draw at an offset where I need to, and then set the value back to the default behaviour (e.g. 0) when I'm finished?

 

My process at the moment is to draw lines matching the existing x-ref geometry and then manually offset these line/polylines by whatever distance required. It would be one less command/sequence if I could "offset" my drawing lines as I create them.

 

Thanks. 🙂

0 Likes
2,095 Views
6 Replies
Replies (6)
Message 2 of 7

ВeekeeCZ
Consultant
Consultant

Explore MLINE, then you possibly explode it.

0 Likes
Message 3 of 7

j.palmeL29YX
Mentor
Mentor

If you have only straight lines (no arcs nor other curves) you can try the MLINE command. 

The offset of the Mlinestyle should be 1 (see image), the distance from the given geometry can be set by an appropriate scale factor. 

 

>>Click<<

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 4 of 7

Over-Dose
Advocate
Advocate

@ВeekeeCZ + @j.palmeL29YX - This option came pretty close to what I was hoping to achieve.

 

However, this isn't entirely worth using, as it leaves me having to do extra steps of exploding and then assigning line/polyline properties after the exploding.

 

Example: If it was possible to set the one line of the MLINE to defpoints, and then give additional properties to the line you want to see (e.g. global width etc), this would have been a clear winner for what I need right now.

 

So, close but no cigar I'm afraid. But thanks for the suggestion anyway. 🙂

0 Likes
Message 5 of 7

ВeekeeCZ
Consultant
Consultant

You can try this routine. It automates right offset just after a pline is drawn. 

 

HERE  is how to use a LISP in case you need it.

If you need the left one too... you'll figure.

 

(vl-load-com)
(defun c:Poline ( / e p a next f) (or *poffset* (setq *poffset* (abs (getvar 'offsetdist)))) (setq *poffset* (cond ((getreal (strcat "\nSpecify offset <" (rtos *poffset*) ">: "))) (*poffset*))) (while (or (not next) ; True on first time, nil on next (setq f (getpoint "\nSpecify start point: "))) ; nil for stop (setq next T) (command "_.pline") (if f (command "_non" f)) (while (< 0 (getvar 'cmdactive)) (command pause)) (setq e (entlast) p (vlax-curve-getstartPoint e) a (angle '(0 0 0) (vlax-curve-getFirstDeriv e (vlax-curve-getParamAtPoint e p)))) (command "_.offset" "_e" "_y" *poffset* (list e (trans p 0 1)) (trans (polar p (- a (* pi 0.5)) 1) 0 1) "")) (princ) )

 

0 Likes
Message 6 of 7

j.palmeL29YX
Mentor
Mentor

@Over-Dose wrote:

... close but no cigar . 🙂


 

The quality of an answer depends on the quality of the question ...  😉

 

SCNR

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 7 of 7

Over-Dose
Advocate
Advocate

@j.palmeL29YX wrote:

@Over-Dose wrote:

... close but no cigar . 🙂


 

The quality of an answer depends on the quality of the question ...  😉

 

SCNR


Judging by the fact that two separate responders both recommended the same function/command, would indicate that the quality of the question was absolutely fantastic.

 

However, the said provided proposal was not entirely useful in this context. That doesn't mean that the command is useless for other instances, just not what I was looking for. 😉

 

@ВeekeeCZ - Thanks for that. I'll give it a shot when I have some time and revert back with any update if this happens to achieve what I originally asked. 🙂

0 Likes