Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command for advancing to the next layout 1

Status
Not open for further replies.

Darken99

Mechanical
Apr 5, 2005
135
I am looking for the command line command to advance to the next layout. I don't want to use layout names since they could be different.

Thanks in advance.
 
Replies continue below

Recommended for you

Darken99,

why do you need a command line command?
I use the shortkeys ctrl+pageup/down

Lothar

ADT 2004
ACAD 2002
 
I want to write lisp programs that involve multiple layouts.
 
In vlisp, get the Layouts collection and then toggle through it (set the property of the active layout to the one you want).

"Everybody is ignorant, only on different subjects." — Will Rogers
 
I will explain what I want to do.

I have a drawing Library of 700+ drawings. Each drawing contains 2 to 15 layouts. I want to set up lisp programs to do batch changes to plot options, ploting & block updates. None of the drawings have the same layout names, so that isn't an option. Is there no command to advance to the next layout?

Thanks again
 
The way I suggested does that. Cycle through the layout collection (all of the layouts) and then one by one (setting them as active layout), run your setups.

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Heres an example...

(vl-load-com)
(setq ThisDwg (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
(vlax-for each (vla-get-Layouts ThisDwg)
(vla-put-activelayout ThisDwg each)
(YOUR STUFF GOES HERE)
)

"Everybody is ignorant, only on different subjects." — Will Rogers
 
Ok, I am now a step closer.

I am warming up by writing a lisp program to print all the layouts. I can get them all to print off, but they are in layout alphabetical order and not the order they appear in AutoCAD.

Any ideas how to fix this?

Thanks
 
Ok I am also working on a program for changing all my layouts to windows default printer. I am getting an error at the end of the program. It does what I want but I am unable to get it to batch because of the error.


This is the lisp program I am working on.

(vl-load-com)
(setq ThisDwg (vla-Get-ActiveDocument (vlax-Get-Acad-Object)))
(vlax-for each (vla-get-Layouts ThisDwg)
(vla-put-activelayout ThisDwg each)
(COMMAND "-ZOOM" "E")
(COMMAND "-PLOT" "Y" "" "Default Windows System Printer.pc3" "LETTER" "" "" "" "E" "" "" "" "" "" "" "" "" "" "Y" "n" )
)



This is the command line info. It seems to want to update the drawing the way I want, but it kills it after each drawing is completed.



Command: layup
Regenerating model - caching viewports.
ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: E
Command: PLOT Detailed plot configuration? [Yes/No] <No>: Y
Enter a layout name or [?] <Model>: Enter an output device name or [?] <None>:
Default Windows System Printer.pc3 Enter paper size or [?] <Letter>: LETTER
Enter paper units [Inches/Millimeters] <Inches>: Enter drawing orientation
[Portrait/Landscape] <Landscape>: Plot upside down? [Yes/No] <No>: Enter plot
area [Display/Extents/Limits/View/Window] <Display>: E Enter plot scale
(Plotted Inches=Drawing Units) or [Fit] <Fit>: Enter plot offset (x,y) or
<0.00,0.00>: Plot with plot styles? [Yes/No] <Yes>: Enter plot style
table name or [?] (enter . for none) <Default R14 pen assignments.ctb>:
Command: LAYUP Unknown command "LAYUP". Press F1 for help.
Command: LAYUP Unknown command "LAYUP". Press F1 for help.
Command: LAYUP Unknown command "LAYUP". Press F1 for help.
Command: LAYUP Unknown command "LAYUP". Press F1 for help.
Command: LAYUP Unknown command "LAYUP". Press F1 for help.
Command: Y Unknown command "Y". Press F1 for help.
Command: n Unknown command "N". Press F1 for help.
Command: Restoring cached viewports - Regenerating layout.
ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: E
Command: PLOT Detailed plot configuration? [Yes/No] <No>: Y
Enter a layout name or [?] <VENT TUBE>: Enter an output device name or [?]
<\\S1\HP LaserJet 8150 Series PS>: Default Windows System Printer.pc3 Enter
paper size or [?] <Letter>: LETTER Enter paper units [Inches/Millimeters]
<Inches>: Enter drawing orientation [Portrait/Landscape] <Landscape>: Plot
upside down? [Yes/No] <No>: Enter plot area
[Display/Extents/Limits/View/Window] <Extents>: E Enter plot scale (Plotted
Inches=Drawing Units) or [Fit] <1=1.01>: Enter plot offset (x,y) or

<Center>: Plot with plot styles? [Yes/No] <Yes>: Enter plot style table name or
[?] (enter . for none) <monochrome.ctb>: Plot with lineweights? [Yes/No] <Yes>:
Scale lineweights with plot scale? [Yes/No] <No>: Plot paper space first?
[Yes/No] <No>: Hide paperspace objects? [Yes/No] <No>: Write the plot to a file
[Yes/No] <N>: Save changes to page setup [Yes/No]? <N> Y Proceed with plot
[Yes/No] <Y>: n
Command: ; error: no function definition: LEYPLOT
Command: *Cancel*
Command: *Cancel*
Command: <Switching to: Model>
Restoring cached viewports.​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor