+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    7

    Question Macro - New Drawing with Client Templates/Layers

    Registered forum members do not see this ad.

    Hey guys!

    I am working on a macro where the user will click the button, the macro opens a script to open a new drawing with a client template, after that it'll load a couple of lisps and run those to setup the standard layers and automate the drawing layout portion.

    I am fairly new to this, I have noticed that the macro quits as soon as the script runs opening a new drawing. Is this a limitation with running a macro?

  2. #2
    Luminous Being Dadgad's Avatar
    Using
    AutoCAD 2013
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    5,973

    Default

    Why not just include those standard layers in the client specific .DWT (template)?
    You could also preload the Sheet into the Layout, so you hit the ground running.
    Volume and repetition do not validate opinions forged in the absence of thought.

  3. #3
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,815

    Default

    Agree with Dadgad, You can point the "NEW" to a different directory that holds all your client DWT's

    CONFIG, FILES, Template settings, Drawing file template location, your directory
    A man who never made mistakes never made anything

  4. #4
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2015
    Join Date
    Feb 2017
    Posts
    7

    Default

    Point taken with layers, going to rethink that bit.

    However, I am looking to automate the setup of the layouts as this changes project to project. Basically the lisp gets the user input for the type of layout (keyplan/plotplan/details) and how many layouts they need and creates those layouts with the proper titleblocks. Ideally, I'd have this lisp run after the new drawing template is loaded.

  5. #5
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    Like everyone else I don't understand why you would need a lisp for this?

    I have a drop-down in my Ribbon with a list of macros like this starts a new drawing using my "FL83-NF.dwt" template:
    Code:
    ^C^C^P(vla-activate (vla-Add (vla-get-Documents (vlax-get-acad-object)) (strcat (getvar "localrootprefix") "template" (chr 92) "AutoCAD Template" (chr 92) "FL83-NF.dwt")))
    Once I determine the layout size needed I use lisp to pop it in from another drop-down like this macro for an 11×17 border:
    Code:
    ^C^C^P(or C:Steal (load "StealV1-8.lsp"))(Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt") (list (list "Layouts" (list "11×17")))) .regen
    For that macro you'll need Lee Mac's Steal from Drawing routine.

    Don't forget to thank Lee if you use it!

  6. #6
    Senior Member
    Computer Details
    YZ's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    CORE I7 3770 3.4GHZ
    CPU:
    Intel Duo Core E6550 @ 2.33GHz
    RAM:
    16
    Graphics:
    NVIDIA Quadro K600
    Monitor:
    LG Flatron W2343T
    Discipline
    Surveying
    YZ's Discipline Details
    Occupation
    CAD Operator and Manager; Land Survey, Civil Design
    Discipline
    Surveying
    Details
    Topographic ground surveys for architects and engineers; Land Subdivisions; Civil Engineering Design.
    Using
    AutoCAD 2017
    Join Date
    Oct 2007
    Location
    Sydney, Australia
    Posts
    464

    Default

    If the Macro truncates after running the NEW command, perhaps an easy solution (until you can get them to work together) is to have 2 button macros next to each other in the ribbon. One creates the new dwg, the other runs the lisps that create the layers.

    If it were me I'd call scripts rather than lisp for building the layers, but whatever you are comfortable with (I am much more familiar with scripts). If you already have the lisp created then you definitely want to harness that.

  7. #7
    Super Member
    Computer Details
    tombu's Computer Details
    Operating System:
    Windows 7 64-bit
    Computer:
    Dell
    Discipline
    Civil
    tombu's Discipline Details
    Occupation
    Design Analyst
    Discipline
    Civil
    Details
    Small Street & Stormwater projects. Traffic Calming and other issues.
    Using
    Civil 3D 2018
    Join Date
    Dec 2010
    Location
    Tallahassee, FL USA
    Posts
    729

    Default

    Registered forum members do not see this ad.

    When adding or configuring layers in a drawing for a specific task like after importing shp files from GIS I'll import a Layer State to do it.

Similar Threads

  1. Replies: 2
    Last Post: 12th Aug 2015, 04:04 pm
  2. Client construction drawing full of un-needed layers
    By RichardLloyd in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 14th Jan 2014, 02:13 pm
  3. A button macro to Thaw frozen layers and Freeze thawed layers
    By YZ in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 17
    Last Post: 31st Jul 2012, 07:23 am
  4. Adding client Logo's to drawing title block
    By Wilbri in forum AutoCAD General
    Replies: 7
    Last Post: 21st Apr 2012, 03:36 pm
  5. Drawing Templates.
    By Nick-H- in forum AutoCAD General
    Replies: 12
    Last Post: 6th Nov 2009, 04:22 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts