Message 1 of 2
Problem With Plotting Routine
Not applicable
11-15-2010
06:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Guys,
I am trying to build a plotting script but it keeps dying in the middle. I do not want to use the publish engine so i am using the command interface. Here's the code.
<CommandMethod("MB_PlotAllTabs")> _
Public Sub MB_PlotAllTabs()
Dim LayoutSize As Integer = 1
Dim myTabList As SortedDictionary(Of Integer, String).ValueCollection = LayoutTabList()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim StartNum As Integer = New Integer
Dim StopNum As Integer = New Integer
Dim LinesBeforePrinterSettings As Integer = 16
Dim PrinterINISettingLines As Integer = 7
Dim INIValueArr(0 To 6) As String
Dim i As Integer = 0
Dim PlotString As String = Nothing
StartNum = LinesBeforePrinterSettings + 1
If LayoutSize <> 1 Then
StartNum = StartNum + PrinterINISettingLines * LayoutSize
End If
StopNum = LinesBeforePrinterSettings + PrinterINISettingLines * LayoutSize
Do Until StartNum > StopNum
INIValueArr(i) = GetINISetting(StartNum)
MsgBox(INIValueArr(i), MsgBoxStyle.OkOnly)
i += 1
StartNum += 1
Loop
Dim DeviceName As String = INIValueArr(0)
Dim PaperName As String = INIValueArr(1)
Dim PrintUnits As String = INIValueArr(2)
Dim PrintScale As String = INIValueArr(3)
Dim PrintOffset As String = INIValueArr(4)
Dim PrintOrient As String = INIValueArr(5)
Dim PrintStyle As String = INIValueArr(6)
For Each LayoutName In myTabList
PlotString = "-plot Yes " + LayoutName + " " + DeviceName + " " + PaperName + " " + PrintUnits + " " + PrintOrient + " No Layout " + PrintScale + " " + PrintOffset + " Yes " + PrintStyle + " Yes Yes No No No N Y"
MsgBox(PlotString, MsgBoxStyle.OkOnly)
acDoc.SendStringToExecute(PlotString, True, False, False)
Next
End Sub
It seems to be dying just before "LayoutName" in the PlotString var. But when it gets to the msgbox and i output the string everything is populated. Am i doing something stupidly wrong here?
Thanks in advance.