jesset Posted May 3, 2017 Posted May 3, 2017 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? Quote
Dadgad Posted May 4, 2017 Posted May 4, 2017 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. Quote
BIGAL Posted May 4, 2017 Posted May 4, 2017 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 Quote
jesset Posted May 4, 2017 Author Posted May 4, 2017 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. Quote
tombu Posted May 5, 2017 Posted May 5, 2017 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: ^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: ^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! Quote
YZ Posted May 8, 2017 Posted May 8, 2017 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. Quote
tombu Posted May 9, 2017 Posted May 9, 2017 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.