I need VBA code to loop in layouts only

I need VBA code to loop in layouts only

Anonymous
Not applicable
862 Views
3 Replies
Message 1 of 4

I need VBA code to loop in layouts only

Anonymous
Not applicable
I need VBA Code to know how to loop in layouts object only to print all layouts except model space layout, inside the Current opened file
0 Likes
863 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
This should get you started.

Private Sub LayoutsOnly()
Dim objLayout As ACADLayout

For Each objLayout In ThisDrawing.Layouts
If objLayout.Name = "Model" Then
MsgBox "Skipping tab"
Else
MsgBox "Plot layout tab"
End If
Next objLayout
End Sub


--
I support two teams: The Red Sox and whoever beats the Yankees.

wrote in message news:4845946@discussion.autodesk.com...
I need VBA Code to know how to loop in layouts object only to print all
layouts except model space layout, inside the Current opened file
0 Likes
Message 3 of 4

Anonymous
Not applicable
in addition, you may also want to review the plot config for each...

[code]
Sub test()
Dim oLayout As AcadLayout

For Each oLayout In ThisDrawing.Layouts
If oLayout.Name <> "Model" Then
With oLayout
.ConfigName = "HP DesignJet 800.pc3"
.UseStandardScale = True
.StandardScale = ac1_1
.ScaleLineweights = True
.PlotType = acExtents
.PlotRotation = ac0degrees
.CanonicalMediaName = "User1309"
.PlotWithPlotStyles = True
.StyleSheet = "Oberer.ctb"
.RefreshPlotDeviceInfo
End With
End If
Next
End Sub
[/code]
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks alot It's working
there is another Example

Private Sub LayoutsOnly()
Dim objLayout As ACADLayout

For Each objLayout In ThisDrawing.Layouts

If strcomp(objLayout.Name,"model",VBTextstring) = -1Then

MsgBox objLayout.Name

Next objLayout
End Sub
apreciate your Effort ,
Thanks.....
0 Likes