I have created a LISP that will offset a line in both directions. This is very useful when offseting lot lines to create build lines. Let me rephrase that it would be very usefule when creating build lines. If It could do the following:
Select upto if not more than 500 lines and offset each one a given distance (by the user) both directions. I am assuminig that all I need to do is wrap my existing code in a loop, but I am not very good at loops. I get lost once I start trying to write a loop.
Any and all help would be appreciated.
(defun c:mOffset ()
(startErrorTrap)
(setvar "cmdecho" 0)
(setq xLine (entsel "\nSelect Line: "))
(setq ent (entlast))
(setq entdata (entget ent))
(setq stpt (cdr (assoc 10 entdata)))
(setq endpt (cdr (assoc 11 entdata)))
(initget 7)
(setq dist (getdist "\nEnter Distance Between Lines: "))
(setq ang (angle stpt endpt))
(setq r90 (* pi 0.5))
(setq r270 (* pi 1.5))
(setq hdist (/ dist 1.0))
(setq usp (polar stpt (+ ang r90) hdist))
(setq uep (polar endpt (+ ang r90) hdist))
(setq lsp (polar stpt (- ang r90) hdist))
(setq lep (polar endpt (- ang r90) hdist))
(command "Line" usp uep "" "Line" lsp lep "")
(EndErrorTrap)
(princ)
);defun


Reply With Quote

