Is there a way to add layouts from various drawings to a tool palette? I realize design center can be used to import layouts.
![]() |
|
![]() |
|
![]() |
|
![]() |
Is there a way to add layouts from various drawings to a tool palette? I realize design center can be used to import layouts.
You can create a command string to import a layout from another drawing. The command is LAYOUT with the TEMPLATE option and you would need to supply the filename and layout name for the source drawing and layout you want to import.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
If i had layout in a drawing located at ...L:\1 - SITE DEPARTMENT\3 - CAD\1 - C3D Template\Civil Sheet Templates\civil3d_XREF_DREF.dwg, what would that process look like?
Is this for full AutoCAD and not AutoCAD LT? If so, then you could use autolisp in your command, which could look like the following:
In AutoLISP, you will need to double the back slashes between folder names or replace each with a forward slash.Code:(command "_.layout" "Template" "L:\\1 - SITE DEPARTMENT\\3 - CAD\\1 - C3D Template\\Civil Sheet Templates\\civil3d_XREF_DREF.dwg" "Layout1")
Also, remember to change Layout1 to the specific layout name you are attempting to import.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
If you need Page Setups added to plot those layouts as well Lee Mac's Steal from Drawing works well http://www.lee-mac.com/steal.html
You would need to replace both the layout names and the Page Setup names.Code:^C^C^P(Steal "Template" "L:\\1 - SITE DEPARTMENT\\3 - CAD\\1 - C3D Template\\Civil Sheet Templates\\civil3d_XREF_DREF.dwg" (list (list "Page Setups" (list "11×17" "11×17 PDF"))(list "Layouts" (list "Layout1" "Layout2"))))
To import them with AutoCAD LT without lisp your macro would have to turn the system variable FILEDIA off first as inthen resetting FILEDIA afterwards.Code:FILEDIA 0 _.LAYOUT TEMPLATE "L:\\1 - SITE DEPARTMENT\\3 - CAD\\1 - C3D Template\\Civil Sheet Templates\\civil3d_XREF_DREF.dwg" "Layout1" FILEDIA 1
There is a palette from the out of the box tool palettes titled "Command Tool Samples". On that palette, there should be a tool labeled "VisualLisp Expression". You can copy that tool to your clipboard and then paste into a new palette. From there, you should be able to edit the tool's command sequence to similarly match the code provided in this thread.
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt
Thanks for the aid. I have successfully created the palettes with the desired outcome!!! Which leads me to an additional question...I am creating a new command to add to a custom toolbar. It will run a lisp routine located in the folder - L:\1 - SITE DEPARTMENT\3 - CAD\5 - LSP files\demo.lsp. What would the verbiage on the macro line look like ?
Is the AutoLISP routine already loaded?
If it is not already loaded, you will need to first load it using the LOAD AutoLISP function.
The backslashes will need to be doubled in the function call-out or replaced with a single forward slash for each. That is how AutoLISP works.Code:(load "C:\\Path\\To\\File.lsp")
Is the routine executable from the command line without parenthesis surrounding it? If it can be called without parenthesis, you will need to add the parenthesis in your macro.
You can then combine all of that into a macro to add to a Tool Palette command.Code:(c:NameOfRoutine)
The two ^c prefixing the macro are to escape from any currently running commands. Two escapes are typically used.Code:^c^c(load "C:\\Path\\To\\File.lsp")(c:NameOfRoutine)
If you have a technical question, please find the appropriate forum and ask it there.
You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
jUSt