Hi i am getting invalid input error message while assigning CanonicalMediaName=ANSI_E_(44.00_x_34.00_Inches)
please help on that
Please see the below VB.Net Code
Dim rasterObj As Autodesk.AutoCAD.Interop.Common.IAcadEntity
Dim Layout As Autodesk.AutoCAD.Interop.Common.AcadLayout
Dim l_SheetCount As Integer
Dim NewFile, codespot As String
Dim i As Integer
Dim resume2 As Boolean = True
Try
codespot = "SAP 1"
NewFile = "monochrome.ctb"
l_SheetCount = CInt(clsVariable.DrawingSheet)
codespot = "SAP 2"
Layout = Acad.ActiveDocument.ModelSpace.Layout
codespot = "SAP 3"
rasterObj = Layout.Block.Item(l_SheetCount - 1)
If Not (Layout.CanonicalMediaName = "ANSI_E_(44.00_x_34.00_Inches)") Then
Layout.CanonicalMediaName = "ANSI_E_(44.00_x_34.00_Inches)"
End If
Layout.PlotRotation = Autodesk.AutoCAD.Interop.Common.AcPlotRotation.ac0degrees
codespot = "SAP 5"
If Not (Layout.StyleSheet = NewFile) Then
Layout.StyleSheet = NewFile
If Not (Layout.StyleSheet = NewFile) Then ''if the style sheet can't be set, use none
Layout.StyleSheet = ""
End If
End If
codespot = "SAP 6"
Layout.PaperUnits = Autodesk.AutoCAD.Interop.Common.AcPlotPaperUnits.acInches
codespot = "SAP 7"
Layout.StandardScale = Autodesk.AutoCAD.Interop.Common.AcPlotScale.acScaleToFit
codespot = "SAP 8"
i = 0
'Layout = Acad.ActiveDocument.Layers.Add("Junk") 'commented prasad
Acad.ActiveDocument.Layers.Add("Junk")
'Set the layer named "Junk" the active layer for the current document
Acad.ActiveDocument.ActiveLayer = Acad.ActiveDocument.Layers.Item("Junk")
Acad.ActiveDocument.ActiveLayout.PlotType = Autodesk.AutoCAD.Interop.Common.AcPlotType.acExtents
Acad.ActiveDocument.ModelSpace.Layout.ConfigName = "HybridConverter.pc3" --Getting Error in this line
''Acad.ActiveDocument.Regen acActiveViewport
Acad.ActiveDocument.ModelSpace.Layout.RefreshPlotDeviceInfo()
Acad.ActiveDocument.ActiveLayer = Acad.ActiveDocument.Layers.Item("0")
Layout = Acad.ActiveDocument.Layers.Item("Junk")
Layout.Delete()
codespot = "SAP 9"
Application.DoEvents()
Acad.Update()
Application.DoEvents()