Jump to content

Search the Community

Showing results for tags 'offset'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Hello, I currently use a routine that offsets a line in both directions based on a specified distance in the routine. After we run the command we usually have to select the two offset lines and put them on a specific layer, in this case "Structure". I am trying to just add to the routine so the offset lines are automatically put on that layer for us but for some reason when we run the routine its putting all 3 lines (the original, and the two offset lines) on that layer. Can someone review it over and respond. Thanks (defun C:OFF (/ pickEnt pickObj offDist) (vl-load-com) (setq offDist 0.0812) (while (setq pickEnt (entsel)) (cond ((and pickEnt (setq pickObj (vlax-EName->vla-Object (car pickEnt))) offDist) (vla-put-layer pickObj "STRUCTURE" ) (vla-Offset pickObj offDist) (vla-Offset pickObj (- offDist)) ) ) ;_ end of cond ) ;_ end of while (princ) ) ;_ end of defun
  2. What is the problem? It's not working when am offsetting its not coming, (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq ilyrc(getstring(strcat "\Specify insulation layer <" (vl-princ-to-string ilyr)"> : "))) (setq layers (vla-get-Layers doc)) (setq ilyr (vla-Add layers ilyrc)) (setq plyr (vla-get-ActiveLayer doc))) (function (lambda (x) (vla-offset x (+ *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (+ iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr) (vla-offset x (- *ff)) (vla-put-layer (vlax-EName->vla-Object (entlast))plyr) (vla-offset x (- iszo)) (vla-put-layer (vlax-EName->vla-Object (entlast))ilyr)))
  3. I use vla-PlotToFile to plot dwg to pdf with acWindow plottype, but pdf is offset。 please help,thanks。 (defun c:myplot ( / ) (vl-load-com) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (setvar "CMDECHO" 0) (setvar "BLIPMODE" 0) (setvar "OSMODE" 0) ;(setvar "LAYOUTREGENCTL" 1) (setq lyout (vla-get-activelayout adoc)) (setq styleSheet "monochrome.ctb") (setq cfgName "AutoCAD PDF (High Quality Print).pc3") (vla-RefreshPlotDeviceInfo lyout) (vla-put-ConfigName lyout CfgName) (vla-put-PaperUnits lyout acMillimeters) (vla-put-plotrotation lyout ac0degrees) (vla-put-PlotType lyout acWindow) (vla-put-CanonicalMediaName lyout "ISO_full_bleed_A3_(420.00_x_297.00_mm)") (vla-put-PlotWithLineweights lyout :vlax-false) (vla-put-PlotWithPlotStyles lyout :vlax-true) (vla-put-StyleSheet lyout styleSheet) (vla-put-CenterPlot lyout :vlax-true) (vla-put-plotrotation lyout ac0degrees) (vla-put-activelayout adoc lyout) (setq ss (ssget "X" '((0 . "INSERT") (2 . "bztk") (67 . 0)))) (setq i -1) (repeat (sslength ss) (setq i (1+ i)) (setq tk_ent (ssname ss i)) (vla-GetBoundingBox (vlax-ename->vla-object tk_ent) 'minpoint 'maxpoint) (setq pointTemp1 (vlax-make-safearray vlax-vbDouble '(0 . 1))) (vlax-safearray-put-element pointTemp1 0 (vlax-safearray-get-element minpoint 0)) (vlax-safearray-put-element pointTemp1 1 (vlax-safearray-get-element minpoint 1)) (setq pointTemp2 (vlax-make-safearray vlax-vbDouble '(0 . 1))) (vlax-safearray-put-element pointTemp2 0 (vlax-safearray-get-element maxpoint 0)) (vlax-safearray-put-element pointTemp2 1 (vlax-safearray-get-element maxpoint 1)) (vla-SetWindowToPlot lyout pointTemp1 pointTemp2) (vla-put-activelayout adoc lyout) (vla-PlotToFile (vla-get-Plot adoc) (strcat (getvar 'dwgprefix) "draw" (itoa i))) ) (setvar "BLIPMODE" 0) (setvar "OSMODE" 231 ) (setvar "CMDECHO" 1) ) test.dwg
  4. Good morning, how are you? I have a problem with a lisp that I was using since 2011. Until last week it was working normally, but this week lisp keeps returning this error: ** Error: no function definition: nil **. My autocad is 2016, it's on a laptop with windows 10. I tried some solutions: I reinstalled the program, reinstalled a newer version. All without success. So I tried it on my old desktop pc. It's autocad 2012, and Lisp ran normally. One more step: I installed 2018 and loaded the Lisp ... it worked normally. Now I do not know what else to do. Format the laptop? Is there anything else I can do? This is the LISP: ;;--------------------------=={ Dynamic Offset }==-----------------------------;; ;; ;; ;; Allows the user to dynamically offset multiple objects simultaneously, by ;; ;; either specifying the offset distance via mouse-click, or at the ;; ;; command-line. The command-line default will remember the last offset entered ;; ;; by the user. ;; ;; ;; ;; Object Snap functionality is retained, and the on-screen offset distance is ;; ;; determined by the nearest object in the offset selection set. ;; ;; ;; ;; The user can use the +/- keys to change the number of offsets, or, ;; ;; alternatively, the user can press 'N' and specify the number of offsets ;; ;; directly. ;; ;; ;; ;; The user can also press 'S' during object offset to change the layer, ;; ;; linetype, lineweight, and colour of the resultant offset objects. ;; ;; ;; ;; By pressing TAB the user can switch modes between offsetting both sides or ;; ;; just one side of an object. ;; ;; ;; ;; The toggle for retaining or deleting the original Objects can be altered by ;; ;; pressing 'D'. The user can hold SHIFT to highlight the offset entities. ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; FUNCTION SYNTAX: DynOff ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; Author: Lee Mac, Copyright © October 2009 - www.lee-mac.com ;; ;; ;; ;;-------------------------------------------------------------------------------;; ;; ;; ;; Version: ;; ;; ;; ;; 1.0: 17/10/2009 - First Release ;; ;;-------------------------------------------------------------------------------;; ;; 1.1: 19/10/2009 - Added Object Snap functionality ;; ;;-------------------------------------------------------------------------------;; ;; 1.2: 20/10/2009 - Added Multiple Offset Option ;; ;;-------------------------------------------------------------------------------;; ;; 1.3: 21/10/2009 - Updated Object Snap Coding ;; ;;-------------------------------------------------------------------------------;; ;; 1.4: 23/10/2009 - Updated Offset Number Options ;; ;; - Added option to specify Offset factor. ;; ;;-------------------------------------------------------------------------------;; ;; 1.5: 29/10/2009 - Added Settings Dialog. ;; ;;-------------------------------------------------------------------------------;; ;; 1.6: 08/12/2009 - Added option to only offset object on one side. ;; ;;-------------------------------------------------------------------------------;; ;; 1.7: 10/12/2009 - Added option to delete original objects. ;; ;;-------------------------------------------------------------------------------;; ;; 1.8: 14/12/2009 - Added ability to offset to the center of two objects. ;; ;;-------------------------------------------------------------------------------;; ;; 1.9: 16/12/2009 - Modified method for spacing multiple offsets. ;; ;; - Improved OSnap Coding. ;; ;;-------------------------------------------------------------------------------;; ;; 2.0: 18/12/2009 - Added colour change for offset entities. ;; ;; - Fixed Bug when using Offset Factor. ;; ;;-------------------------------------------------------------------------------;; ;; 2.1: 21/12/2009 - Updated code to check for Express Tools. ;; ;;-------------------------------------------------------------------------------;; (defun c:DynOff (/ ;; --=={ Local Functions }==-- *error* clean DynOff_Sub txt2num ;; --=={ Local Variables }==-- CODE CPT DATA DCFNAME DCTITLE DOC DRFT E1 E2 ELST ENTLST ET EXFLAG GR I IOBJ K MSG OBJ OBJLST OFF OOBJ OPT OSGRV OSTR PROP RLST SS X ;; --=={ Global Variables }==-- ; *dynOff ~ Default Offset Distance ; *dynNum ~ Default Offset Number ; *dynFac ~ Default Offset Factor ; *dynMod ~ Default Offset Mode (bit-coded) ; *dynDel ~ Default Delete Option ; *DynOffDefaults* ~ Default Dialog Settings ) (setq dcfname "LMAC_DynOff_V2.1.dcl" dcTitle "Dynamic Offset V2.1 Settings") (or *dynOff (setq *dynOff 10.0)) (or *dynNum (setq *dynNum 1 )) (or *dynFac (setq *dynFac 1.0)) (or *dynMod (setq *dynMod 2 )) (or *dynDel (setq *dynDel nil)) (or *DynOffDefaults* (setq *DynOffDefaults* '("1" "1" 256 256 "*Source*" "*Source*" ;; Layer "ByLayer" "ByLayer" ;; Linetype "ByLayer" "ByLayer"))) ;; Lineweight (setq k -1) (setq *DynOffDefaults* (mapcar (function (lambda (value) (cond ( (<= 4 (setq k (1+ k)) 5) (if (tblsearch "LAYER" value) value "*Source*")) ( (<= 6 k 7) (if (tblsearch "LTYPE" value) value "ByLayer")) (t value)))) *DynOffDefaults*)) (setq dynMode (nth *dynMod '(1 2 3))) ;; --=={ Error Handler }==-- (defun *error* (err) (setq eLst (clean eLst)) (and doc (vla-EndUndoMark doc)) (or (wcmatch (strcase err) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " err " **"))) (redraw) (princ)) ;;-------------------------------------------------------------------------------;; (defun clean (lst / lst) (cond (lst (mapcar (function (lambda (object) (if (not (vlax-erased-p object)) (vla-delete object)))) lst) (setq lst nil)))) (defun DynOff_Sub (obj off / rLst oObj iObj i) (if (vl-catch-all-error-p (vl-catch-all-apply (function (lambda ( ) (if (= 1 (logand 1 dynmode)) (progn (setq i 3 oObj (vlax-invoke obj 'Offset off)) (if (or (and et (not (acet-sys-shift-down))) (not et)) ;; -- Mod 2.0 -- (foreach prop '(color layer linetype lineweight) (mapcar (function (lambda (object / val) (if (or (vl-position (setq val (nth i *DynOffDefaults*)) '(256 "*Source*")) (and (= i 3) (= "1" (cadr *DynOffDefaults*)))) (vlax-put-property object prop (vlax-get-property obj prop)) (vlax-put-property object prop (if (< i 9) val (eval (read (strcat "acLnWt" val)))))))) oObj) (setq i (+ i 2)))))) (if (= 2 (logand 2 dynmode)) (progn (setq i 2 iObj (vlax-invoke obj 'Offset (- off))) (if (or (and et (not (acet-sys-shift-down))) (not et)) ;; -- Mod 2.0 -- (foreach prop '(color layer linetype lineweight) (mapcar (function (lambda (object / val) (if (or (vl-position (setq val (nth i *DynOffDefaults*)) '(256 "*Source*")) (and (= i 2) (= "1" (car *DynOffDefaults*)))) (vlax-put-property object prop (vlax-get-property obj prop)) (vlax-put-property object prop (if (< i 8) val (eval (read (strcat "acLnWt" val)))))))) iObj) (setq i (+ i 2)))))) (setq rLst (append oObj iObj)))))) (clean (append oObj iObj)) rLst)) (defun txt2num (txt) (cond ((distof txt 5)) ((distof txt 2)) ((distof txt 1)) ((distof txt 4)) ((distof txt 3)))) (defun GetOffLen (num fac / result) (setq result 0.) (while (not (minusp (setq num (1- num)))) (setq result (+ result (expt fac num)))) result) (setq et (not (vl-catch-all-error-p (vl-catch-all-apply (function (lambda nil (acet-sys-shift-down))))))) (or et (princ "\nExpress Tools not Loaded - Shift option not Available.")) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)) drft (vla-get-drafting (vla-get-preferences (vlax-get-acad-object))) osGrv (osmode-grvecs-lst (vla-get-AutoSnapMarkerColor drft) (vla-get-AutoSnapMarkerSize drft))) (cond ( (not (DC_Write dcfname)) (princ "\nDCL File could not be Written.")) (t (if (setq ss (ssget "_:L" '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (progn (vla-StartUndoMark doc) (setq ObjLst (mapcar 'vlax-ename->vla-object (setq EntLst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) oStr "") (setq msg '(strcat "\n[TAB] Mode, [+/-] Offset [N]umber, Offset [F]actor" "\n[C]enter, [S]ettings" (if et ", [SHIFT] Show Offsets" "") ", [D]elete Original = " (if *dynDel "Yes" "No") "\nSpecify Offset <" (vl-princ-to-string *dynOff) "> : ")) (princ (eval msg)) (while (progn (setq gr (grread 't 15 0) code (car gr) data (cadr gr)) (redraw) (cond ( (and (= 5 code) (listp data)) (setq EntLst (vl-sort EntLst (function (lambda (a b) (< (distance data (vlax-curve-getClosestPointto a data)) (distance data (vlax-curve-getClosestPointto b data))))))) (setq cPt (vlax-curve-getClosestPointto (car entLst) data) off (/ (distance cPt data) (GetOffLen *dynNum *dynFac))) ;; -- Mod 2.0 -- (grdraw cPt data 3 1) (setq eLst (clean eLst)) (if (and (< 0 (getvar "OSMODE") 16384) (setq oPt (vl-remove-if (function null) (mapcar (function (lambda (x / o) (if (setq o (osnap data x)) (list (distance data o) o x data)))) (get_osmode))))) (setq oPt (cdar (vl-sort oPt (function (lambda (a b) (< (car a) (car b))))))) (setq oPt nil)) (and oPt (OsMark oPt)) (foreach obj ObjLst (setq i -1 x 0.) (repeat *dynNum (setq eLst (append eLst (cond ((DynOff_Sub obj (* (setq x (+ x (expt *dynFac (setq i (1+ i))))) off))) ((clean eLst))))))) (if (and eLst et (acet-sys-shift-down)) (mapcar (function (lambda (x) (vla-put-color x acBlue))) eLst)) ;; -- Mod 2.0 -- t) ( (= code 25) nil) ( (and (= code 3) (listp data)) (clean eLst) (setq *dynOff off) (setq cPt (vlax-curve-getClosestPointto (car entLst) data)) (if (and (< 0 (getvar "OSMODE") 16384) (setq oPt (vl-remove-if (function null) (mapcar (function (lambda (x / o) (if (setq o (osnap data x)) (list (distance data o) o x data)))) (get_osmode))))) (setq oPt (cdar (vl-sort oPt (function (lambda (a b) (< (car a) (car b)))))) data (osnap (caddr oPt) (cadr oPt)) *dynOff (/ (distance (vlax-curve-getClosestPointto (car entLst) data) data) (GetOffLen *dynNum *dynFac))) ;; -- Mod 1.9 -- (setq oPt nil)) (foreach obj ObjLst (setq i -1 x 0.) (repeat *dynNum (setq eLst (append eLst (cond ((DynOff_Sub obj (* (setq x (+ x (expt *dynFac (setq i (1+ i))))) *dynoff))) ((clean eLst))))))) nil) ( (= code 2) (cond ( (or (= 46 data) (< 47 data 58)) (setq oStr (strcat oStr (chr data))) (princ (chr data))) ( (vl-position data '(67 99)) (clean eLst) (while (progn (setq e1 (entsel "\nSelect First Object: ")) (cond ( (vl-consp e1) (if (wcmatch (cdr (assoc 0 (entget (car e1)))) "ARC,CIRCLE,ELLIPSE,*LINE") (while (progn (setq e2 (car (entsel "\nSelect Second Object: "))) (cond ( (eq 'ENAME (type e2)) (if (wcmatch (cdr (assoc 0 (entget e2))) "ARC,CIRCLE,ELLIPSE,*LINE") (progn (setq p1 (vlax-curve-getClosestPointto (car e1) (cadr e1)) p2 (vlax-curve-getClosestPointto e2 p1)) (setq *dynOff (/ (distance p1 p2) (GetOffLen (1+ *dynNum) *dynFac))) ;; -- Mod 2.0 -- (foreach obj ObjLst (setq i -1 x 0.) (repeat *dynNum (setq eLst (append eLst (cond ( (DynOff_Sub obj (* (setq x (+ x (expt *dynFac (setq i (1+ i))))) *dynoff))) ( (clean eLst))))))) (setq exFlag nil)) (princ "\nInvalid Object Selected."))) ( (setq exFlag t) nil)))) (princ "\nInvalid Object Selected."))) ( (setq exFlag t) nil)))) exFlag) ( (vl-position data '(43 61)) (setq *dynNum (1+ *dynNum))) ( (vl-position data '(68 100)) (setq *dynDel (not *dynDel)) (princ (strcat "\nOriginal Objects " (if *dynDel "will" "will not") " be Deleted" (eval msg)))) ( (vl-position data '(78 110)) (initget 6) (setq *dynNum (cond ((getint (strcat "\nSpecify Number of Offsets <" (itoa *dynNum) "> : "))) (*dynNum))) (princ (eval msg))) ( (= data 6) (cond ( (< 0 (getvar "OSMODE") 16384) (setvar "OSMODE" (+ 16384 (getvar "OSMODE"))) (princ "\n<Osnap off>")) (t (setvar "OSMODE" (- (getvar "OSMODE") 16384)) (princ "\n<Osnap on>"))) (princ (eval msg))) ( (= data 9) (setq dynmode (cond ( (= 2 *dynMod) (setq *dynMod 0) 1) ( (nth (setq *dynMod (1+ *dynMod)) '(1 2 3)))))) ( (vl-position data '(70 102)) (initget 6) (setq *DynFac (cond ((getreal (strcat "\nSpecify Offset Factor <" (vl-princ-to-string *dynFac) "> : "))) (*dynFac))) (princ (eval msg))) ( (vl-position data '(83 115)) (Off_Settings dcfname (vlax-ename->vla-object (car EntLst))) t) ( (= data 45) (cond ( (= 1 *dynNum) (princ (strcat "\nMinimum Offset Number Reached." (eval msg)))) (t (setq *dynNum (1- *dynNum))))) ( (and (< 0 (strlen oStr)) (= data 8)) (setq oStr (substr oStr 1 (1- (strlen oStr)))) (princ (vl-list->string '(8 32 8)))) ( (vl-position data '(13 32)) (cond ( (zerop (strlen oStr)) (clean eLst) (foreach obj ObjLst (setq i -1 x 0.) (repeat *dynNum (setq eLst (append eLst (cond ( (DynOff_Sub obj (* (setq x (+ x (expt *dynFac (setq i (1+ i))))) *dynoff))) ( (clean eLst))))))) nil) ( (setq off (txt2num oStr)) (clean eLst) (setq *dynOff off) (foreach obj ObjLst (setq i -1 x 0.) (repeat *dynNum (setq eLst (append eLst (cond ( (DynOff_Sub obj (* (setq x (+ x (expt *dynFac (setq i (1+ i))))) off))) ( (clean eLst))))))) nil) (t (princ "\nInvalid Offset Entered.") (princ (eval msg)) (setq oStr "")))) (t ))) (t )))) (if *dynDel (mapcar (function vla-delete) ObjLst)) (vla-EndUndoMark doc))))) (princ)) (defun osMark (o / s) (setq s (/ (getvar "VIEWSIZE") (cadr (getvar "SCREENSIZE"))) o (cons (trans (car o) 1 3) (cdr o))) (grvecs (cdr (assoc (cadr o) osGrv)) (list (list s 0. 0. (caar o)) (list 0. s 0. (cadar o)) (list 0. 0. s 0.) (list 0. 0. 0. 1.)))) (defun get_osmode nil ; by Evgeniy Elpanov (mapcar (function cdr) (vl-remove-if (function (lambda (x) (zerop (logand (getvar "OSMODE") (car x))))) '((1 . "_end") (2 . "_mid") (4 . "_cen") (8 . "_nod") (16 . "_qua") (32 . "_int") (64 . "_ins") (128 . "_per") (256 . "_tan") (512 . "_nea") (2048 . "_app"))))) (defun osmode-grvecs-lst (col ass / -ASS ASS COL) ; By Evgeniy Elpanov (Modified by Lee Mac) (setq -ass (- ass)) (list (list "_end" col (list -ass -ass) (list -ass ass) col (list (1- -ass) (1- -ass)) (list (1- -ass) (1+ ass)) col (list -ass ass) (list ass ass) col (list (1- -ass) (1+ ass)) (list (1+ ass) (1+ ass)) col (list ass ass) (list ass -ass) col (list (1+ ass) (1+ ass)) (list (1+ ass) (1- -ass)) col (list ass -ass) (list -ass -ass) col (list (1+ ass) (1- -ass)) (list (1- -ass) (1- -ass))) (list "_mid" col (list -ass -ass) (list 0. ass) col (list (1- -ass) (1- -ass)) (list 0. (1+ ass)) col (list 0. ass) (list ass -ass) col (list 0. (1+ ass)) (list (1+ ass) (1- -ass)) col (list ass -ass) (list -ass -ass) col (list (1+ ass) (1- -ass)) (list (1- -ass) (1- -ass))) (list "_cen" 7 (list (* -ass 0.2) 0.) (list (* ass 0.2) 0.) 7 (list 0. (* -ass 0.2)) (list 0. (* ass 0.2)) col (list -ass 0.) (list (* -ass 0.86) (* ass 0.5)) col (list (* -ass 0.86) (* ass 0.5)) (list (* -ass 0.5) (* ass 0.86)) col (list (* -ass 0.5) (* ass 0.86)) (list 0. ass) col (list 0. ass) (list (* ass 0.5) (* ass 0.86)) col (list (* ass 0.5) (* ass 0.86)) (list (* ass 0.86) (* ass 0.5)) col (list (* ass 0.86) (* ass 0.5)) (list ass 0.) col (list ass 0.) (list (* ass 0.86) (* -ass 0.5)) col (list (* ass 0.86) (* -ass 0.5)) (list (* ass 0.5) (* -ass 0.86)) col (list (* ass 0.5) (* -ass 0.86)) (list 0. -ass) col (list 0. -ass)(list (* -ass 0.5) (* -ass 0.86)) col (list (* -ass 0.5) (* -ass 0.86)) (list (* -ass 0.86) (* -ass 0.5)) col (list (* -ass 0.86) (* -ass 0.5)) (list -ass 0.)) (list "_nod" col (list -ass -ass) (list ass ass) col (list -ass ass) (list ass -ass) col (list -ass 0.) (list (* -ass 0.86) (* ass 0.5)) col (list (* -ass 0.86) (* ass 0.5)) (list (* -ass 0.5) (* ass 0.86)) col (list (* -ass 0.5) (* ass 0.86)) (list 0. ass) col (list 0. ass) (list (* ass 0.5) (* ass 0.86)) col (list (* ass 0.5) (* ass 0.86)) (list (* ass 0.86) (* ass 0.5)) col (list (* ass 0.86) (* ass 0.5)) (list ass 0.) col (list ass 0.) (list (* ass 0.86) (* -ass 0.5)) col (list (* ass 0.86) (* -ass 0.5)) (list (* ass 0.5) (* -ass 0.86)) col (list (* ass 0.5) (* -ass 0.86)) (list 0. -ass) col (list 0. -ass)(list (* -ass 0.5) (* -ass 0.86)) col (list (* -ass 0.5) (* -ass 0.86)) (list (* -ass 0.86) (* -ass 0.5)) col (list (* -ass 0.86) (* -ass 0.5)) (list -ass 0.)) (list "_qua" col (list 0. -ass) (list -ass 0.) col (list 0. (1- -ass)) (list (1- -ass) 0.) col (list -ass 0.) (list 0. ass) col (list (1- -ass) 0.) (list 0. (1+ ass)) col (list 0. ass) (list ass 0.) col (list 0. (1+ ass)) (list (1+ ass) 0.) col (list ass 0.) (list 0. -ass) col (list (1+ ass) 0.) (list 0. (1- -ass))) (list "_int" col (list -ass -ass) (list ass ass) col (list -ass (1+ -ass)) (list ass (1+ ass)) col (list (1+ -ass) -ass) (list (1+ ass) ass) col (list -ass ass) (list ass -ass) col (list -ass (1+ ass)) (list ass (1+ -ass)) col (list (1+ -ass) ass) (list (1+ ass) -ass)) (list "_ins" col (list (* -ass 0.1) (* -ass 0.1)) (list -ass (* -ass 0.1)) col (list -ass (* -ass 0.1)) (list -ass ass) col (list -ass ass) (list (* ass 0.1) ass) col (list (* ass 0.1) ass) (list (* ass 0.1) (* ass 0.1)) col (list (* ass 0.1) (* ass 0.1)) (list ass (* ass 0.1)) col (list ass (* ass 0.1)) (list ass -ass) col (list ass -ass) (list (* -ass 0.1) -ass) col (list (* -ass 0.1) -ass) (list (* -ass 0.1) (* -ass 0.1)) col (list (1- (* -ass 0.1)) (1- (* -ass 0.1))) (list (1- -ass) (1- (* -ass 0.1))) col (list (1- -ass) (1- (* -ass 0.1))) (list (1- -ass) (1+ ass)) col (list (1- -ass) (1+ ass)) (list (1+ (* ass 0.1)) (1+ ass)) col (list (1+ (* ass 0.1)) (1+ ass)) (list (1+ (* ass 0.1)) (1+ (* ass 0.1))) col (list (1+ (* ass 0.1)) (1+ (* ass 0.1))) (list (1+ ass) (1+ (* ass 0.1))) col (list (1+ ass) (1+ (* ass 0.1))) (list (1+ ass) (1- -ass)) col (list (1+ ass) (1- -ass)) (list (1- (* -ass 0.1)) (1- -ass)) col (list (1- (* -ass 0.1)) (1- -ass)) (list (1- (* -ass 0.1)) (1- (* -ass 0.1)))) (list "_tan" col (list -ass ass) (list ass ass) col (list (1- -ass) (1+ ass)) (list (1+ ass) (1+ ass)) col (list -ass 0.) (list (* -ass 0.86) (* ass 0.5)) col (list (* -ass 0.86) (* ass 0.5)) (list (* -ass 0.5) (* ass 0.86)) col (list (* -ass 0.5) (* ass 0.86)) (list 0. ass) col (list 0. ass) (list (* ass 0.5) (* ass 0.86)) col (list (* ass 0.5) (* ass 0.86)) (list (* ass 0.86) (* ass 0.5)) col (list (* ass 0.86) (* ass 0.5)) (list ass 0.) col (list ass 0.) (list (* ass 0.86) (* -ass 0.5)) col (list (* ass 0.86) (* -ass 0.5)) (list (* ass 0.5) (* -ass 0.86)) col (list (* ass 0.5) (* -ass 0.86)) (list 0. -ass) col (list 0. -ass)(list (* -ass 0.5) (* -ass 0.86)) col (list (* -ass 0.5)(* -ass 0.86)) (list (* -ass 0.86) (* -ass 0.5)) col (list (* -ass 0.86)(* -ass 0.5)) (list -ass 0.)) (list "_per" col (list -ass -ass) (list -ass ass) col (list (1- -ass) (1- -ass)) (list (1- -ass) (1+ ass)) col (list ass -ass) (list -ass -ass) col (list (1+ ass) (1- -ass)) (list (1- -ass) (1- -ass)) col (list -ass 0.) (list 0. 0.) col (list -ass -1.) (list 0. -1.) col (list 0. 0.) (list 0. -ass) col (list -1. 0.) (list -1. -ass)) (list "_nea" col (list -ass -ass) (list ass ass) col (list -ass ass) (list ass ass) col (list (1- -ass) (1+ ass)) (list (1+ ass) (1+ ass)) col (list -ass ass) (list ass -ass) col (list ass -ass) (list -ass -ass) col (list (1+ ass) (1- -ass)) (list (1- -ass) (1- -ass))) (list "_app" col (list -ass -ass) (list ass ass) col (list ass -ass) (list -ass ass) col (list -ass -ass) (list -ass ass) col (list (1- -ass) (1- -ass)) (list (1- -ass) (1+ ass)) col (list -ass ass) (list ass ass) col (list (1- -ass) (1+ ass)) (list (1+ ass) (1+ ass)) col (list ass ass) (list ass -ass) col (list (1+ ass) (1+ ass)) (list (1+ ass) (1- -ass)) col (list ass -ass) (list -ass -ass) col (list (1+ ass) (1- -ass)) (list (1- -ass) (1- -ass))))) ;; ----=={ DCL Section }==---- (defun Off_Settings (fname obj / mklst img layCol mk_arc lays dcTag lLay lLin bsCol bsflag) (mapcar 'set '(*dyniCols *dynoCols *dyniCol *dynoCol *dynilay *dynolay *dynilin *dynolin *dyniwgt *dynowgt) *DynOffDefaults*) (defun mklst (key lst) (start_list key) (mapcar 'add_list lst) (end_list)) (defun img (key col) (start_image key) (fill_image 0 0 (dimx_tile key) (dimy_tile key) col) (end_image)) (setq doc (cond (doc) ((vla-get-ActiveDocument (vlax-get-acad-object)))) lays (vla-get-layers doc)) (defun layCol (lay) (vla-get-color (vla-item lays lay))) (setq bsCol (cond ( (vl-position (setq bsCol (vla-get-Color obj)) '(256 0)) (setq bsflag t) (layCol (vla-get-Layer obj))) (bsCol))) (defun mk_arc nil (vec_arc (if (= "1" *dyniCols) (if bsFlag (laycol (if (eq "*Source*" *dynilay) (vla-get-layer obj) *dynilay)) bsCol) (if (= 256 *dyniCol) (if (eq "*Source*" *dynilay) bsCol (laycol *dynilay)) *dyniCol)) bsCol (if (= "1" *dynoCols) (if bsFlag (laycol (if (eq "*Source*" *dynolay) (vla-get-layer obj) *dynolay)) bsCol) (if (= 256 *dynoCol) (if (eq "*Source*" *dynolay) bsCol (laycol *dynolay)) *dynoCol)))) (cond ( (<= (setq dcTag (load_dialog fname)) 0) (princ "\nDialog File not Found.")) ( (not (new_dialog "dsett" dcTag)) (princ "\nSettings Dialog could not be Loaded.")) (t (vlax-for lay (vla-get-layers doc) (setq lLay (cons (vla-get-Name lay) lLay))) (setq lLay (cons "*Source*" (acad_strlsort lLay))) (vlax-for lin (vla-get-linetypes doc) (setq lLin (cons (vla-get-Name lin) lLin))) (setq lLin (append '("*Source*" "ByLayer") (acad_strlsort (cddr (reverse lLin))))) (setq lWgt '("*Source*" "ByLayer" "000" "005" "009" "013" "015" "018" "020" "025" "030" "035" "040" "050" "053" "060" "070" "080" "090" "100" "106" "120" "140" "158" "200" "211")) (mapcar 'mklst '("ilay" "olay" "ilin" "olin" "olw" "ilw") (list lLay lLay lLin lLin lWgt lWgt)) (mapcar 'set_tile '("ilay" "olay" "ilin" "olin" "ilw" "olw") (mapcar 'itoa (mapcar 'vl-position (list *dyniLay *dynoLay *dyniLin *dynoLin *dyniWgt *dynoWgt) (list lLay lLay lLin lLin lWgt lWgt)))) (set_tile "icols" *dyniCols) (set_tile "ocols" *dynoCols) (set_tile "dtitle" dcTitle) (mode_tile "icol" (atoi (get_tile "icols"))) (mode_tile "ocol" (atoi (get_tile "ocols"))) (logo) (mk_arc) (mapcar 'img '("icol" "ocol") (list *dyniCol *dynoCol)) (action_tile "ilay" (vl-prin1-to-string (quote (progn (setq *dynilay (nth (atoi $value) lLay)) (mk_arc))))) (action_tile "olay" (vl-prin1-to-string (quote (progn (setq *dynolay (nth (atoi $value) lLay)) (mk_arc))))) (action_tile "ilin" (vl-prin1-to-string (quote (progn (setq *dyniLin (nth (atoi $value) lLin)))))) (action_tile "olin" (vl-prin1-to-string (quote (progn (setq *dynoLin (nth (atoi $value) lLin)))))) (action_tile "ilw" (vl-prin1-to-string (quote (progn (setq *dyniWgt (nth (atoi $value) lWgt)))))) (action_tile "olw" (vl-prin1-to-string (quote (progn (setq *dynoWgt (nth (atoi $value) lWgt)))))) (action_tile "icol" (vl-prin1-to-string (quote (progn (setq *dyniCol (cond ((acad_colordlg *dyniCol)) (*dyniCol))) (img "icol" *dyniCol) (mk_arc))))) (action_tile "ocol" (vl-prin1-to-string (quote (progn (setq *dynoCol (cond ((acad_colordlg *dynoCol)) (*dynoCol))) (img "ocol" *dynoCol) (mk_arc))))) (action_tile "icols" (vl-prin1-to-string (quote (progn (mode_tile "icol" (atoi (setq *dyniCols $value))) (mk_arc))))) (action_tile "ocols" (vl-prin1-to-string (quote (progn (mode_tile "ocol" (atoi (setq *dynoCols $value))) (mk_arc))))) (action_tile "accept" (vl-prin1-to-string (quote (progn (setq *DynOffDefaults* (list *dyniCols *dynoCols *dyniCol *dynoCol *dynilay *dynolay *dynilin *dynolin *dyniwgt *dynowgt)) (done_dialog))))) (action_tile "cancel" "(done_dialog)") (start_dialog) (unload_dialog dcTag)))) (defun DC_Write (fname / wPath ofile) (if (not (findfile fname)) (if (setq wPath (findfile "ACAD.PAT")) (progn (setq wPath (vl-filename-directory wPath)) (or (eq "\\" (substr wPath (strlen wPath))) (setq wPath (strcat wPath "\\"))) (setq ofile (open (strcat wPath fname) "w")) (foreach str '( "//-------------------=={ Dynamic Offset }==-------------------//" "// //" "// DynOff.dcl for use in conjunction with DynOff.lsp //" "//------------------------------------------------------------//" "// Author: Lee Mac, Copyright © 2009 - www.lee-mac.com //" "//------------------------------------------------------------//" "" "// Sub-Assembly Definitions" "" "pop : popup_list { fixed_width = false; alignment = centered; }" "col : image_button { alignment = centered; height = 1.5; width = 4.0;" " fixed_width = true; fixed_height = true; color = 2; }" "" "// Main Dialog" "" "dsett : dialog { key = \"dtitle\";" " spacer;" " : row {" " : boxed_column { label = \"Offset Preview\"; fixed_width = false; " " : boxed_row { label = \"Outer Colour\"; fixed_width = true;" " alignment = centered;" " spacer;" " : col { key = \"ocol\"; }" " spacer;" " : toggle { key = \"ocols\"; label = \"Source\"; }" " spacer;" " } // boxed_row" " : image { key = \"dimage\"; alignment = centered;" " width = 24.64 ; fixed_width = true;" " height = 11.39; fixed_height = true; color = -2; }" " : boxed_row { label = \"Inner Colour\"; fixed_width = true;" " alignment = centered;" " spacer;" " : col { key = \"icol\"; }" " spacer;" " : toggle { key = \"icols\"; label = \"Source\"; }" " spacer;" " } // boxed_row" " } // column" " : column { " " : boxed_column { label = \"Outer Offset\";" " : pop { label = \"Layer:\"; key = \"olay\"; }" " : pop { label = \"Linetype:\"; key = \"olin\"; }" " : pop { label = \"Lineweight:\"; key = \"olw\" ; }" " spacer;" " } // boxed_column" " spacer;" " : boxed_column { label = \"Inner Offset\";" " : pop { label = \"Layer:\"; key = \"ilay\"; }" " : pop { label = \"Linetype:\"; key = \"ilin\"; }" " : pop { label = \"Lineweight:\"; key = \"ilw\" ; }" " spacer;" " } // boxed_column" " } // column" " } // row" " spacer;" " : row {" " : spacer { width = 19.33; height = 3.18; }" " ok_cancel;" " spacer;" " : image { key = \"logo\" ; alignment = centered;" " width = 19.33; fixed_width = true;" " height = 3.18; fixed_height = true; color = -15; }" " } // row" "} // dialog" "" "//------------------------------------------------------------//" "// End of File //" "//------------------------------------------------------------//" ) (write-line str ofile)) (close ofile) t) nil) t)) (defun logo nil (start_image "logo") (mapcar 'vector_image '(24 21 19 18 17 16 15 14 1 1 0 0 17 8 0 0 1 1 1 1 8 8 7 7 7 7 7 7 33 33 35 37 38 39 41 48 47 46 46 54 52 51 50 49 41 42 43 44 45 46 46 47 47 48 48 48 48 48 49 49 49 49 48 48 48 47 47 44 46 47 48 49 49 50 50 51 52 52 53 53 53 53 53 53 53 52 52 52 52 51 51 51 51 52 54 54 55 56 58 59 60 62 70 70 68 67 65 64 62 61 59 58 57 55 64 63 63 63 63 62 61 71 70 69 69 69 69 69 68 69 69 69 47 26 27 28 28 28 28 28 27 27 26 25 36 34 33 33 33 46 46 47 77 77 77 76 75 74 73 73 73 72 72 72 72 72 72 72 72 73 73 74 75 79 76 76 76 75 75 75 75 75 76 76 76 77 77 78 78 79 80 81 83 84 85 86 93 76 77 87 87 81 80 88 88 88 88 86 86 94 93 92 92 92 92 92 92 93 113 113 112 111 109 108 107 105 109 111 112 113 113 113 96 94 93 93 93 93 93 94 95 96 97 98 99 101 102 104 105 107 108 104 103 101 100 100 99 99 98 98 98 98 98 99 100 102 103 104 101 99 98 96 94 105 107 108 109 110 112 113 114 114 114 112 111 110 108 107 105 103 102) '(16 18 19 20 21 21 21 21 22 23 23 24 24 0 0 0 1 2 3 21 21 21 20 19 18 1 1 0 1 1 2 2 3 4 5 5 4 3 3 1 1 2 3 4 5 6 7 9 10 12 12 13 15 16 18 19 21 23 25 25 27 28 30 31 33 34 35 40 38 37 36 34 34 33 31 30 28 28 26 25 23 21 21 19 18 16 15 14 13 11 10 10 9 8 7 6 5 4 3 3 2 2 0 0 0 0 0 0 0 0 0 0 0 0 1 20 21 22 22 23 24 24 23 23 22 21 20 4 3 2 2 0 0 0 1 2 2 4 4 20 21 23 23 24 24 23 22 21 20 1 1 0 4 5 6 7 8 9 11 12 13 15 16 18 20 20 22 23 25 26 27 29 30 34 30 29 27 26 24 22 21 19 18 16 15 13 12 12 10 9 8 7 6 5 4 4 3 3 3 4 10 10 12 12 19 19 20 21 22 22 21 21 20 19 6 6 5 3 13 14 15 16 17 18 19 19 20 19 18 17 15 14 5 9 11 12 14 14 16 17 18 19 20 21 21 22 22 22 22 21 21 20 19 19 18 18 17 16 14 12 11 10 8 7 6 6 5 5 3 3 3 3 3 5 5 6 6 6 7 7 7 7 6 5 4 4 3 3 3 3 3) '(21 19 18 17 16 15 14 8 1 0 0 17 24 0 0 1 1 1 1 1 8 7 7 7 7 7 7 8 33 35 37 38 39 41 41 47 46 46 46 52 51 50 49 48 42 43 44 45 46 46 47 47 48 48 48 48 48 49 49 49 49 48 48 48 47 47 44 46 47 48 49 49 50 50 51 52 52 53 53 53 53 53 53 53 52 52 52 52 51 51 51 51 52 54 54 55 56 58 59 60 62 64 70 68 67 65 64 62 61 59 58 57 55 54 63 63 63 63 62 61 71 70 69 69 69 69 69 68 69 69 69 70 26 27 28 28 28 28 28 27 27 26 25 36 34 33 33 33 33 46 47 47 77 77 76 75 74 73 73 73 72 72 72 72 72 72 72 72 73 73 74 75 79 76 76 76 75 75 75 75 75 76 76 76 77 77 78 78 79 80 81 83 84 85 86 87 76 77 77 87 81 80 88 88 88 88 86 86 94 93 92 92 92 92 92 92 93 93 113 112 111 109 108 107 105 104 111 112 113 113 113 113 94 93 93 93 93 93 94 95 96 97 98 99 101 102 104 105 107 108 109 103 101 100 100 99 99 98 98 98 98 98 99 100 102 103 104 105 99 98 96 94 96 107 108 109 110 112 113 114 114 114 112 111 110 108 107 105 103 102 101) '(18 19 20 21 21 21 21 21 23 23 24 24 16 0 0 1 2 3 21 22 21 20 19 18 1 1 0 0 1 2 2 3 4 5 5 4 3 3 1 1 2 3 4 5 6 7 9 10 12 12 13 15 16 18 19 21 23 25 25 27 28 30 31 33 34 35 40 38 37 36 34 34 33 31 30 28 28 26 25 23 21 21 19 18 16 15 14 13 11 10 10 9 8 7 6 5 4 3 3 2 2 1 0 0 0 0 0 0 0 0 0 0 0 1 20 21 22 22 23 24 24 23 23 22 21 20 4 3 2 2 0 0 0 1 2 2 4 4 20 21 23 23 24 24 23 22 21 20 1 1 0 0 5 6 7 8 9 11 12 13 15 16 18 20 20 22 23 25 26 27 29 30 34 30 29 27 26 24 22 21 19 18 16 15 13 12 12 10 9 8 7 6 5 4 4 4 3 3 4 10 10 12 12 19 19 20 21 22 22 21 21 20 19 6 6 5 3 3 14 15 16 17 18 19 19 20 19 18 17 15 14 13 9 11 12 14 14 16 17 18 19 20 21 21 22 22 22 22 21 21 20 19 19 18 18 17 16 14 12 11 10 8 7 6 6 5 5 5 3 3 3 3 5 5 6 6 6 7 7 7 7 6 5 4 4 3 3 3 3 3 3) '(14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166 166)) (end_image)) (defun vec_arc (iCol bCol oCol) (start_image "dimage") (mapcar 'vector_image '(0 48 48 48 48 47 46 45 44 43 42 40 39 37 35 33 31 29 26 24 21 19 16 14 11 8 5 2) '(0 146 143 141 138 135 132 130 127 124 122 119 117 115 113 111 109 107 105 104 103 101 100 99 99 98 98 97) '(0 48 48 48 47 46 45 44 43 42 40 39 37 35 33 31 29 26 24 21 19 16 14 11 8 5 2 0) '(0 143 141 138 135 132 130 127 124 122 119 117 115 113 111 109 107 105 104 103 101 100 99 99 98 98 97 97) (list iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol iCol)) (mapcar 'vector_image '(0 42 39 35 32 28 25 21 18 14 10 7 3 42 39 35 32 28 25 21 18 14 10 7 3 71 69 66 63 60 58 55 52 48 45 71 69 66 63 60 58 55 52 48 45 93 92 90 89 88 86 84 82 80 78 76 74 93 92 90 89 88 86 84 82 80 78 76 74 97 97 97 97 96 96 95 94 97 97 97 97 96 96 95 94) '(0 58 57 55 54 53 52 51 50 50 49 49 49 58 57 55 54 53 52 51 50 50 49 49 49 80 77 75 72 70 68 65 63 62 60 80 77 75 72 70 68 65 63 62 60 117 114 111 107 104 101 97 94 91 88 85 82 117 114 111 107 104 101 97 94 91 88 85 82 146 143 139 135 132 128 125 121 146 143 139 135 132 128 125 121) '(0 39 35 32 28 25 21 18 14 10 7 3 0 39 35 32 28 25 21 18 14 10 7 3 0 69 66 63 60 58 55 52 48 45 42 69 66 63 60 58 55 52 48 45 42 92 90 89 88 86 84 82 80 78 76 74 71 92 90 89 88 86 84 82 80 78 76 74 71 97 97 97 96 96 95 94 93 97 97 97 96 96 95 94 93) '(0 57 55 54 53 52 51 50 50 49 49 49 48 57 55 54 53 52 51 50 50 49 49 49 48 77 75 72 70 68 65 63 62 60 58 77 75 72 70 68 65 63 62 60 58 114 111 107 104 101 97 94 91 88 85 82 80 114 111 107 104 101 97 94 91 88 85 82 80 143 139 135 132 128 125 121 117 143 139 135 132 128 125 121 117) (list bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol bCol)) (mapcar 'vector_image '(56 51 47 43 39 35 30 26 22 17 13 8 4 0 106 103 100 97 93 90 86 83 79 75 72 68 64 60 146 146 146 146 145 144 144 143 142 141 139 138 137 135 133 131 129 127 125 123 120 118 115 112 109) '(11 9 8 6 5 4 3 2 1 1 0 0 0 0 46 42 39 36 34 31 28 25 23 21 18 16 14 12 146 142 137 133 129 124 120 115 111 107 103 98 94 90 86 82 78 74 70 67 63 59 56 52 49) '(51 47 43 39 35 30 26 22 17 13 8 4 0 0 103 100 97 93 90 86 83 79 75 72 68 64 60 56 146 146 146 145 144 144 143 142 141 139 138 137 135 133 131 129 127 125 123 120 118 115 112 109 106) '(9 8 6 5 4 3 2 1 1 0 0 0 0 0 42 39 36 34 31 28 25 23 21 18 16 14 12 11 142 137 133 129 124 120 115 111 107 103 98 94 90 86 82 78 74 70 67 63 59 56 52 49 46) (list oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol oCol)) (end_image)) (vl-load-com) (princ "\n:: DynOff.lsp | Version 2.1 | © Lee Mac 2009 www.lee-mac.com ::") (princ "\n:: Type \"DynOff\" to Invoke ::") (princ) ;;-------------------------------------------------------------------------------;; ;; End of File ;; ;;-------------------------------------------------------------------------------;; Thank you all!! dynoffv2-1.lsp
  5. Hi Writers! here i am again with new question. I am looking for a lisp to Offset line by a selection set values. i really wanted to get an intersection point after offsetting so that i can draw circle at each intersection. but i have values till outer of circle, i know the radius of circle. Process may be like this. Select Values Get Circle radius from user add with selected values select Line offset in positive direction by added values repeat once to offset another line. please help me to find a lisp. Thank you..
  6. Hi, i'm looking for a lisp that will offset a line to a distance of 1.875 and change the color from blue to white. thanks.
  7. I am hoping this will be a simple fix, but searching for the answer has turned up nothing. If I offset a self-intersecting polyline, it trims the offset anywhere that it crosses the original polyline. I am looking for a way for the offset to continue through self intersections untrimmed. My hope is that the self-trimming is a "feature", and that there is a way to turn it off, perhaps through a system variable or something. If not, the only way I can think to fix it is to write my own custom offset which doesn't sound very efficient. ps. Although I'm posting this in the general autocad area, I'm open to solutions that require autolisp. The reason I'm looking for this answer is to be used in an automated routine once I get past this hurdle. ***edit*** I found this thread , but it doesn't give a solution (aside from "use an ancient version on AutoCAD").
  8. Hi, I am an Electrical Engineer and I am drawing lighting plan on autocad. Can anybody do like this wiring lisp ?
  9. Hello everybody I do drawings that have to have call outs. However, sometimes the call out line crosses with lines of the drawing so every call out line has to have an offset of .025, this way, the line only touches the item im calling. Currently, I do an outside offset on the line both ways, then I use trim and cut everything inside. Sometimes my figures have up to 50 call outs and I have to do this process that is very time consuming. Is there a way I could to this faster? I thought maybe i could put a blank line below my callout line, that had the width of the offset. Or maybe two blank rectangles that had the space of the line between them. I'm new in AutoCad and I'm having some trouble trying to solve this. Note. I copy and paste my drawings to word with paste special Picture (Windows Metafile) so it has to look the same as autocad. Example. Last picture is the result I need.
  10. My lisp program runs the offset command, then immediately uses entlast to get the newly created polyline and add it to a selection set. There is a bug using this method, though, since offset creates multiple entities any time the offset distance is large enough to make it collide with itself. I am trying to find a way to get those additional polylines, but entlast only grabs the most recent. I am at a loss. The only things I can think of right now are to either write my own custom offset routine or to select everything in the drawing before and after the offset, then deselect the selection from before. Both methods sound inefficient. Does anybody have a better way of going about this? I found a few posts where people asked similar questions about this problem, but each one found a workaround specific to their case instead of addressing the issue of getting more than one recent entities which are output at the same time. For reference, here is what I'm talking about by multiple entities being created when it self-intersects:
  11. I am so close to getting this code to perform but need some final touches and manipulaton.. Currently it offsets all text on a specific layer and copy's and moves it up "0.15" which is what we already have doing with another layer we use in our drawings. (we use this to add specific descriptions above a labeled point.) What I am looking for now is to change the code so that instead of offseting/copying/moving every string of text on DEFICIENCY layer within the drawing, I would like for it to prompt me which individual string of text I would like to offset - i.e. ("\nSelect Text to Offset: "), THEN after I make that selection it offset/copy/move that string up "0.15" and be put on DEFICIENCY layer with its respective properties... Hoping someone can chime in soon and thank you all for the support!
  12. I have a polyline, which is made of lines and arcs. One or more arc could have radius smaller than offset distance (offset direction to inside of arc). Basically autacad says "Cannot offset that object". In this case i must xplode polyline and offset other part of polyline without the problematic arc, chamfer them and make it polline again. Is there any workaround? Many times I have to draw polylines and offset them and it drives my crazy
  13. 1st Post, woot woot. I searched through many of the existing forums but couldn't find one that addressed this issue... I work a lot with polylines, to create design contours. I usually have a contour at the bottom or top of a hill, then I use the 'offset' command to offset the line to conform to a 3:1 slope as far as I need, to tie into the existing topo. My problem is, after offsetting all these plines, they are all at the same elevation as the original line. Is there a faster way to change the elevation than clicking on a line, entering the elevation in the properties window, clicking on a new line, wash-rinse-repeat? This is very tedious, especially with 20+ offset lines each time. Or is there a way to offset with increasing/decreasing elevations each time? Thanks
  14. HI all, I'm trying to plot in model space and the printer is cutting off part of the drawing. I choose plot-->extents --> center the plot --> fit to paper. The x coord is always 0, however the y coord is always at .09280. I've tried adjusting the y to 0, and unchecking the plot, but the cutoff always happens. Keep in mind, this is in a handful of drawings. I've plotted to a different plotter (XEROX) and it works perfectly fine. I've switched the PLOTOFFSET variable and it makes the problem worse. My fear is this is a driver issue, Canon doesn't support this plotter anymore. Many thanks for any help. autocad map3d 2012, win7.
  15. I really need a lisp to find the ends of the lines then offset from those ends by [.25] and insert a solid "donut" at the ends of a line or multiple lines. I have the donut lisp we are currently using as well as another lisp I found on the web that is verrrrrry close to what I am needing. See below for the lisp and pics of what the current code does and what I am looking for. THANKS IN ADVANCE to everyone in the forums, your help is greatly appreciated! Here is the Solid Donut command I use. We call them bb's. (defun c:bb () (command "donut" "0" ".0670")(PRINC)) Here is the lisp I found that is sort of close. Courtesy of KENT1COOPER via AutoDesk Forums: (DEFUN C:CMARK (/ CRAD SS LN) (SETQ CRAD 0.0335) (SETQ SS (SSGET "X" '((0 . "LINE")))) (REPEAT (SSLENGTH SS) (SETQ LN (ENTGET (SSNAME SS 0))) (ENTMAKE (LIST '(0 . "CIRCLE") (ASSOC 10 LN) (CONS 40 CRAD) ) ) (ENTMAKE (LIST '(0 . "CIRCLE") (CONS 10 (CDR (ASSOC 11 LN))) (CONS 40 CRAD) ) ) (SSDEL (SSNAME SS 0) SS) ) ) current routine: new routine: (what I would like to try and get it to do)
  16. Hello all, I work primarily in the piping industry and we do not use Autocad 3D Plant because we aren't in the design industry but rather more in the maintenance part of it. That being said we do not have the piping slope hatching functionality. See Photo for slope hatching example. We use this for 45 degrees, rolled 45 degrees and rolled 90 degree elbows. If someone can chime in a maybe share something that would be useful to us to aid in the automation of creating this hatch quickly I would greatly appreciate it.
  17. Hi, I have a drawing with lots of circles (all different sizes). I need to shrink all the circles by .1mm. I need an 'ugway' to help my autocad kung fu.
  18. Why cannot I offset this shape 1.0 mm towards outside? I have attached the original dwg file here. Thank you very much! cannot offset.dwg
  19. Hi, I'm having a problem with OSNAP and am not sure what I'm doing wrong. As you can see from the attached photo, I am using offset to create a parallel line to the one selected (the leftmost line) that I am trying to place tangent to the circle in the center. However, the tangent snap points (which should be visible in the picture) aren't working properly and cause the line to snap to a position inside the circle rather than tangent to it. My command process is offset -> through -> select line -> select TAN onsnap option -> hover over circle near desired tangent point. Any help would be appreciated. Thanks!
  20. Hello, I have a Drawing in which I need to draw thousands of parallel lines (offset) on different distances. Is there anyway or Lisp Routine which can help me to Draw all the offsets at once for each line. see the screenshot below for reference. Thank You, Regards, Sidhu
  21. Just came across this neat little LISP routine. Works perfect for me and my guys because we insulated pipe and this eliminates having to click click click click to constantly offset lines both ways. (defun C:OFF2 (/ pickEnt pickObj offDist) (vl-load-com) (setvar "ErrNo" 0) (while (and (not (setq pickEnt (entsel))) (/= 52 (getvar "ErrNo")))) (cond ((and pickEnt (setq pickObj (vlax-EName->vla-Object (car pickEnt))) (progn (initget 6) (setq offDist (getdist "\nSpecify offset distance: ")))) (vla-Offset pickObj offDist) (vla-Offset pickObj (- offDist)) (I:PutCL pickObj))) (princ)) (defun I:PutCL (myObj / linetypes ltName) (setq linetypes (vla-Get-Linetypes (vla-Get-Document myObj)) ltName "Center") (cond ((vl-catch-all-error-p (vl-catch-all-apply 'vla-Item (list linetypes ltName))) (vla-Load linetypes ltName (cond ((= (getvar "Measurement") 0) "Acad.lin") ("AcadISO.lin"))))) (vla-Put-Linetype myObj ltName)) Question: Can someone have a look and instead of prompting for offset distance (since we already have a standard set distance ALWAYS) of 0.812 so thats what I would need. Also can someone add a for multiple piece? God bless!
  22. obscurejack

    Rhino issue: solid modeling

    Hello! I'm a noob in rhino and I found some problems by making a polysurface solid: my problem is that I have two elements: a sphere and a twisted pyramid, joined by boolean union which I can't offset to add an internal thicken. when I do it (with "solid" option activated) it just creates a polysurface inside it, without creating an emptiness in it. I can't even make a boolean difference, boolean 2 objects or neither a solid subtraction that work with polysurfaces which surfaces do not intersect each other. Indeed, when I make a section to see how it is inside there's no hole but only the sectioned edges of the offset polysurf. H E L P!!!!
  23. Guys, I got this code, to do a multiple offset, it works good, but I need to do one complementation in that, the direction of final objects, the code doesn't allow you choose it, every time the code draw the offset line above of objects, It's possible fix it? Indicating the direction of end offset lines... Thanks in advance... (defun c:mo (/ plines ; selection set of polylines ext ; extrnal point dist ; distance to offset poly ; a polyline from plines plist ; the list of poly del ; polyline to delete int ; internal point i layer) (command "undo" "begin") (princ "select polylines") (setq plines (ssget) i 0 ext (getvar "limmax") dist (getdist "distance = ") ) (repeat (sslength plines) (setq poly (ssname plines i)) (setq plist (entget poly)) (command "offset" dist poly ext "") ;(setq del (entlast) ;int (polar ;(cdr (assoc 10 (entget del))) ;(angle ;(cdr (assoc 10 (entget del))) ;(cdr (assoc 10 plist))) ;(* 2 (distance (cdr (assoc 10 plist)) ;(cdr (assoc 10 (entget del))))))) ;(command "offset" dist poly int "") ;(entdel del) (setq i (1+ i)) ) (command "undo" "end") (if (= "Y" (strcase (getstring "\ndelete initial polylines? (Y/N) = ")) ) (command "erase" plines "") ) )
  24. I have a paper plan set of a sidewalk that contains several simple horizontal curves. I've managed to use the curve data to replicate the sidewalk centerline in my CAD file. The outside edge of the sidewalk is kind of a zig-zag polygon line. To locate change of direction corners in the zig-zag line I was given the location point as a station along the trail and offset distance from trail centerline. My question is how do I easily locate a point along the curve at a specified station. I've managed to do a few using the MEASURE command and I insert a block at the specified station as a distance from the point of curvature. This works, but is very cumbersome and on top of that every time I insert the block it inserts 4 of them at the specified length that I entered. Please let me know if anyone has a quicker method. Also, if you know how to fix my problem with the MEASURE command I would appreciate that as well. Thanks,
  25. Jerome2013

    AutoCAD assignment

    I just want to know the steps how to do this (referred to attached file). I got dizzy :ouch:
×
×
  • Create New...