PDA

View Full Version : Offset my rogue polylines



hyposmurf
20th Jun 2003, 02:58 pm
Im sure someone else asked this question before,cant find it though.Its possible to offset some polylines but how do I offset a polyline that bends horizontal and vertical?When they offset ,they zig zag across my drawing which useless. :( If Im leaving an offset gap either side of pipework(shown as polyline),so that one pipe appears to run under the other,I have to form my own cutting edges then trim,its quite slow when I'm repeatedly doing this!Anyone got any ideas?

robfowler
24th Jun 2003, 07:32 am
Seemingly there is a known bug with offsetting polylines which are some distance from the origin of the drawing. You could try setting your UCS close to the polyline before offsetting it.

Over in the Acad NG a person called Jamie Duncan wrote the following lisp to provide a solution to the problem:



(defun c:ofp (/ ss1 pt1 pt2 offdist en1 looper cosmo)
(defun getthatpoly (/ temp)
(setq temp T)
(while temp
(while (not (setq ss1 (ssget ":S"))))
(if (or (= (cdr (assoc 0 (entget (ssname ss1 0)))) "POLYLINE")
(= (cdr (assoc 0 (entget (ssname ss1 0)))) "LWPOLYLINE")
)
(setq temp nil)
(princ "\nSelect a Polyline!:")
)
)
)
(initget 7)
(setq offdist (getdist "\nInput Offset Distance:")
looper T
pt2 '(0 0)
)
(setq cosmo (getvar "osmode"))(setvar "osmode" 0)
(while looper
(getthatpoly)
(initget "eXit")
&#40;setq pt1 &#40;getpoint "\nIndicate Offset Point <eXit>&#58;"&#41;&#41;
&#40;if &#40;or &#40;= 'str &#40;type pt1&#41;&#41;&#40;= pt1 nil&#41;&#41;
&#40;setq looper nil&#41;
&#40;progn
&#40;command ".move" ss1 "" pt1 pt2&#41;
&#40;command ".offset" offdist &#40;ssname ss1 0&#41; pt2 ""&#41;
&#40;setq ss1 &#40;ssadd &#40;entlast&#41; ss1&#41;&#41;
&#40;command ".move" ss1 "" pt2 pt1&#41;
&#40;setq ss1 &#40;ssadd&#41;&#41;
&#41;
&#41;
&#41;
&#40;setvar "osmode" cosmo&#41;
&#41;



You may want to give it a try.

The other part of your post sounds like a lisp routine is needed to speed up a repetitive task - sorry can't help you there - I haven't done lisp programming!

Rob.