Display full version of the post: Invalid Input error while assign configure value

PrasadUddanti
05.04.2016, 11:33
Hi I am using Autocad 2014 APIwhile developing Autocad application i am getting some errorswhile assign plotter value (HybridConverter.pc3)to comfigname getting invalid input error message .please help on that Please see the below VB.Net CodeDim rasterObj As Autodesk.AutoCAD.Interop.Common.IAcadEntityDim Layout As Autodesk.AutoCAD.Interop.Common.AcadLayoutDim l_SheetCount As IntegerDim NewFile, codespot As StringDim i As IntegerDim resume2 As Boolean = TrueTrycodespot = "SAP 1"NewFile = "monochrome.ctb"l_SheetCount = CInt(clsVariable.DrawingSheet)codespot = "SAP 2"Layout = Acad.ActiveDocument.ModelSpace.Layoutcodespot = "SAP 3"rasterObj = Layout.Block.Item(l_SheetCount - 1)If Not (Layout.CanonicalMediaName = "ANSI_E_(44.00_x_34.00_Inches)") ThenLayout.CanonicalMediaName = "ANSI_E_(44.00_x_34.00_Inches)"End IfLayout.PlotRotation = Autodesk.AutoCAD.Interop.Common.AcPlotRotation.ac0degreescodespot = "SAP 5"If Not (Layout.StyleSheet = NewFile) ThenLayout.StyleSheet = NewFileIf Not (Layout.StyleSheet = NewFile) Then ''if the style sheet can't be set, use noneLayout.StyleSheet = ""End IfEnd Ifcodespot = "SAP 6"Layout.PaperUnits = Autodesk.AutoCAD.Interop.Common.AcPlotPaperUnits.acInchescodespot = "SAP 7"Layout.StandardScale = Autodesk.AutoCAD.Interop.Common.AcPlotScale.acScaleToFitcodespot = "SAP 8"i = 0'Layout = Acad.ActiveDocument.Layers.Add("Junk") 'commented prasadAcad.ActiveDocument.Layers.Add("Junk")'Set the layer named "Junk" the active layer for the current documentAcad.ActiveDocument.ActiveLayer = Acad.ActiveDocument.Layers.Item("Junk")Acad.ActiveDocument.ActiveLayout.PlotType = Autodesk.AutoCAD.Interop.Common.AcPlotType.acExtentsAcad.ActiveDocument.ModelSpace.Layout.ConfigName = "HybridConverter.pc3" --Getting Error in this line''Acad.ActiveDocument.Regen acActiveViewportAcad.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()