Hi,
Ik ben een programmaa'tje aan het maken dat nieuwe layout tabs aanmaakt.
Dat is me gelukt, alleen nu wil ik dat de layout1 en layout2 tabs daarmee gelijk verwijderd worden.
Dus er moet gekeken worden of ze bestaan, en zo ja, dan verwijderd worden.
Heeft iemand een idee..?
groeten, Marcel..
In de onderstaande lijst staan de property values van een layout vla-object.
In dit geval de "Layout1"
_$ (vlax-dump-object a_layout t)
; IAcadLayout: The plot settings and visual properties of a model space or paper space block
; Property values:
; Application (RO) = #<VLA-OBJECT IAcadApplication 00d088b4>
; Block (RO) = #<VLA-OBJECT IAcadPaperSpace 0bc459d4>
; CanonicalMediaName = ""
; CenterPlot = 0
; ConfigName = "C:\\Program Files\\AutoCAD Map 2000i\\plotters\\DWF Classic.pc3"
; Document (RO) = #<VLA-OBJECT IAcadDocument 0145a858>
; Handle (RO) = "899E"
; HasExtensionDictionary (RO) = 0
; ModelType (RO) = 0
; Name = "Layout1"
; ObjectID (RO) = 2130271600
; ObjectName (RO) = "AcDbLayout"
; OwnerID (RO) = 2130271576
; PaperUnits = 0
; PlotHidden = 0
; PlotOrigin = (0.0 0.0)
; PlotRotation = 0
; PlotType = 5
; PlotViewportBorders = 0
; PlotViewportsFirst = -1
; PlotWithLineweights = -1
; PlotWithPlotStyles = -1
; ScaleLineweights = 0
; ShowPlotStyles = 0
; StandardScale = 16
; StyleSheet = ""
; TabOrder = 1
; UseStandardScale = -1
; ViewToPlot = ""
; Methods supported:
; CopyFrom (1)
; Delete ()
; GetCanonicalMediaNames ()
; GetCustomScale (2)
; GetExtensionDictionary ()
; GetLocaleMediaName (1)
; GetPaperMargins (2)
; GetPaperSize (2)
; GetPlotDeviceNames ()
; GetPlotStyleTableNames ()
; GetWindowToPlot (2)
; GetXData (3)
; RefreshPlotDeviceInfo ()
; SetCustomScale (2)
; SetWindowToPlot (2)
; SetXData (2)
T
Onder de methods supported staat de functie Delete.
Denk er aan dat je dit niet in een lus gebruikt. Na elke delete moet je de layout collection opnieuw benaderen.
Veel plezier.
Joop
Beste Marcel,
Heb je hier iets aan:
Sub MakDelLayout()
Dim oLayout As AcadLayout
On Error Resume Next
oLayput = ThisDrawing.Layouts.Item("NewLayout")
Set oLayout = ThisDrawing.Layouts.Add("NewLayout")
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("NewLayout")
On Error Resume Next
ThisDrawing.Layouts.Item("Layout1").Delete
On Error Resume Next
ThisDrawing.Layouts.Item("Layout2").Delete
End Sub
Met vriendelijke groet, HofCAD CSI.
Hi Joop en Hofcad,
Ik denk dat ik aan deze info wel iets ga hebben.
Hier ga ik komend weekend mee verder, dus ik laat nog wel iets horen.
groeten Marcel..