Jump to content

Search the Community

Showing results for tags 'multiple 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...

Found 2 results

  1. I have been trying to write a multiple offset command but when I run my command, after I set the offset distance and select an object, I get the error message: no function definition: CAD. Any idea how I can fix this command? I would appreciate any help you guys could provide. ;* C:MOFFSET is a multiple offset command. It requires the user to show the ;* offset direction, select one object, tell how many times to offset it ;* and give a direction for the offset. It requires the User GET Functions. ;* (defun C:MOFFSET( / ent spt dist) (setq #mdist (udist 1 "" "Offset distance " #mdist nil)) ;the distance to offset (while (not (setq ent (entsel "\nSelect object to offset: ")))) ;get the object (setq spt (upoint 1 "" "Select side" nil (cad ent)) ;get which side #mnum (uint 5 "" "How many times " #mnum) ;# times );setq (setq dist #mdist) ;set a variable to the distance interval (repeat #mnum ;program loop (command "offset" dist ent spt "") ;run the offset command (setq dist (+ dist #mdist)) ;increment the offset distance );repeat (princ) ;clean ending );defun (princ) ;clean loading ;* The User GET functions I am using in this LISP are below and to my knowledge work fine, but I think it is easier to troubleshoot when you can test at the end. ;* UDIST: User interface distance function ;* BIT (0 for none) and KWD key word ("" for none) are same as for INITGET. ;* MSG is the prompt string, to which a default real is added as (nil ;* is for none), and a : is added. BPT is base point (nil for none). (defun udist (bit kwd msg def bpt / inp ) (if def ;test for a default (setq msg (strcat "\n" msg ": ") ;string'em with default bit (* 2 (fix (/ bit 2))) ;a default and no null bit code conflict so );setq ;this reduces bit by 1 if odd, to allow null (if (= " " (substr msg (strlen msg) 1)) ;no def, if last char is space (setq msg (strcat "\n" (substr msg 1 (1- (strlen msg))) ": ")) ;then strip space (setq msg (strcat "\n" msg ": ")) ;else msg OK ) );if,if (initget bit kwd) (setq inp (if bpt ;check for a base point (getdist msg bpt) ;and use it in the GET commands (getdist msg) ) );setq&if (if inp inp def) ;compare the results, return appropriate value );defun ;* ;* UPOINT User interface point function ;* BIT (1 for no null, 0 for none) and KWD key word ("" for none) are same as ;* for INITGET. MSG is the prompt string, to which a default point variable is ;* added as (nil is for none), and a : is added. BPT is base point (nil for none). (defun upoint (bit kwd msg def bpt / inp) (if def ;check for a default (setq pts (strcat (rtos (car def)) "," (rtos (cadr def)) ;formats X,Y 2D pt as string (if ;formats 3D ,Z if supplied and FLATLAND off (and (caddr def) (= 0 (getvar "FLATLAND"))) (strcat "," (rtos (caddr def))) "" ) );if&strcat msg (strcat "\n" msg ": ") ;string them with default bit (* 2 (fix (/ bit 2))) ;a default and no null bit code conflict so ) ;this reduces bit by 1 if odd, to allow null (if (= " " (substr msg (strlen msg) 1)) ;no def, if last char is space (setq msg (strcat "\n" (substr msg 1 (1- (strlen msg))) ": ")) ;then strip space (setq msg (strcat "\n" msg ": ")) ;else msg OK ) );if,if (initget bit kwd) (setq inp (if bpt ;check for base point (getpoint msg bpt) ;and use it (getpoint msg) ;but not if nil ) );setq&if (if inp inp def) ;evaluate results and return proper value );defun ;* ;* UINT: User interface integer function ;* BIT (0 for none) and KWD key word ("" for none) are same as for INITGET. ;* MSG is the prompt string, to which a default integer is added as (nil ;* for none), and a : is added. ;* (defun uint (bit kwd msg def / inp) (if def ;test for a default (setq msg (strcat "\n" msg ": ") ;string'em with default bit (* 2 (fix (/ bit 2))) ;a default and no null bit code conflict so ) ;this reduces bit by 1 if odd, to allow null (if (= " " (substr msg (strlen msg) 1)) ;no def, if last char is space (setq msg (strcat "\n" (substr msg 1 (1- (strlen msg))) ": ")) ;then strip space (setq msg (strcat "\n" msg ": ")) ;else msg OK ) );if,if (initget bit kwd) (setq inp (getint msg)) ;use the GETINT function (if inp inp def) ;compare the results, return appropriate value );defun ;*
  2. 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 "") ) )
×
×
  • Create New...