[Search tip detail and code files using keywords, tip number, author name, etc ]
 
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Exaggerated Offset
Tip# 4502 By Leland Leahy On 13-Jul-2015
0
Rated By 0 users Downloaded : 216
Categories : 2D Operations
Software type : AutoCAD 2016
Rename File To : exo.lsp
This AutoLISP routine was developed for working with AutoCAD profiles views with exaggerated scales.

Leland uses this routine in the civil engineering industry when working with profile views with exaggerated scales.

For example, with a scale of 1”=20’ horizontal and 1”=5’ vertical, you would set the exaggeration to 4, and this command will scale your offsets X 4 to generate the correct geometry.

After you load the LISP file, run the command EXO, enter the scale factor, and proceed with the Offset command.

 

Average Rating:
0


User comments
Comment by Maeding,James
Posted on 2015-07-13 13:42:33
Note that in civil engineering, it is improper to offset pipes at any slope other than 0 (flat). Normally you copy vertically (dist x exaggeration) to get a pipe wall or other "offset". However, for items with steep slopes, that is actually not correct either. Try drawing a pipe at 45 deg on a 10x exagg grid. The copy vert by 40', then also offset by 40'. Then copy and paste as block, and set y scale to .1 to get back to 1x exagg. Then explode and look at distances. Neither are 4, and the offset method of the attached lisp is like 18! So IMO as a career pipeline designer, the attached lisp is not appropriate at all for civil work. Please copy vertically, not offset. Thanks
Comment by Seslar,David
Posted on 2015-07-13 15:32:23
The Autocad Offset command - which the posted .lsp uses - is only valid for line segments parallel to the horizontal or vertical grid lines only for any exaggerated profile as JM noted. This version uses the Copy command (in the subroutine) and tests that selected entity is a line or polyline before copying: (defun c:EXO ( / ) (setvar "cmdecho" 0) (setq PRSF PRSF) (if (= PRSF nil) (progn (setq HSF (getreal " Enter Horizontal scale factor: ")) (setq VSF (getreal " Enter Vertial scale factor: ")) (setq PRSF (/ HSF VSF))) ) ;;;end if (setq OLDOSM (getvar "osmode")) (setvar "osmode" 0) (setq VOFFSET (getreal " Enter vertical offset: ")) (setq VOFFSETA (* VOFFSET PRSF)) (setq VOFFSETPT (list 0 VOFFSETA)) (setq EXITDOOR nil) (while (null EXITDOOR) (setq THISENT (entsel " Select non-vertical line/polyline to offset: ")) (setq TENAME (car THISENT)) (setq EDATA (entget TENAME)) (setq ETYPE (cdr (assoc 0 EDATA))) (if (= "LINE" ETYPE) (OffsetMe)) (if (= "POLYLINE" ETYPE) (OffsetMe)) (if (= "LWPOLYLINE" ETYPE) (OffsetMe)) (setq EXITDOOR (getstring " <Return> to repeat, enter 'X' to exit: ")) (if (= EXITDOOR "") (setq EXITDOOR nil)) ) ;;;end While (setvar "osmode" OLDOSM) (princ) ) ;; (defun OffsetMe ( / ) (command "copy" TENAME "" "0,0" VOFFSETPT) )
Comment by Seslar,David
Posted on 2015-07-14 15:18:25
Oops - I didn't realize that the text would wrap and nest the comments into the code when pasted. This version removes the comments: (defun c:EXO ( / ) (setvar "cmdecho" 0) (setq PRSF PRSF) (if (= PRSF nil) (progn (setq HSF (getreal " Enter Horizontal scale factor: ")) (setq VSF (getreal " Enter Vertial scale factor: ")) (setq PRSF (/ HSF VSF))) ) (setq OLDOSM (getvar "osmode")) (setvar "osmode" 0) (setq VOFFSET (getreal " Enter vertical offset: ")) (setq VOFFSETA (* VOFFSET PRSF)) (setq VOFFSETPT (list 0 VOFFSETA)) (setq EXITDOOR nil) (while (null EXITDOOR) (setq THISENT (entsel " Select non-vertical line/polyline to offset: ")) (setq TENAME (car THISENT)) (setq EDATA (entget TENAME)) (setq ETYPE (cdr (assoc 0 EDATA))) (if (= "LINE" ETYPE) (OffsetMe)) (if (= "POLYLINE" ETYPE) (OffsetMe)) (if (= "LWPOLYLINE" ETYPE) (OffsetMe)) (setq EXITDOOR (getstring " <Return> to repeat, enter 'X' to exit: ")) (if (= EXITDOOR "") (setq EXITDOOR nil)) ) (setvar "osmode" OLDOSM) (princ) ) (defun OffsetMe ( / ) (command "copy" TENAME "" "0,0" VOFFSETPT) )