Errror Message :invalid input while assigning CanonicalMediaName

Errror Message :invalid input while assigning CanonicalMediaName

Anonymous
Not applicable
368 Views
1 Reply
Message 1 of 2

Errror Message :invalid input while assigning CanonicalMediaName

Anonymous
Not applicable

Hi I am using Autocad 2014 API

 

while developing Autocad application i am getting some errors

 

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()

0 Likes
369 Views
1 Reply
Reply (1)
Message 2 of 2

john.vellek
Alumni
Alumni

Hi prasad.uddnti,

 

I suggest that you post this question in the AutoDesk .NET forum to get some replies. .NET


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes