CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 5628
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedErrror Message :invalid in CanonicalMediaName

 Post Reply Post Reply
Author
PrasadUddanti View Drop Down
Newbie
Newbie


Joined: 05.Apr.2016
Location: India
Using: AUTOCAD 2014
Status: Offline
Points: 6
Direct Link To This Post Topic: Errror Message :invalid in CanonicalMediaName
    Posted: 06.Apr.2016 at 17:24
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()
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,319 seconds.