<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem With Plotting Routine in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/problem-with-plotting-routine/m-p/2826229#M63051</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build a plotting script but it keeps dying in the middle.&amp;nbsp; I do not want to use the publish engine so i am using the command interface.&amp;nbsp; Here's the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    &amp;lt;CommandMethod("MB_PlotAllTabs")&amp;gt; _
    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 &amp;lt;&amp;gt; 1 Then
            StartNum = StartNum + PrinterINISettingLines * LayoutSize
        End If
        StopNum = LinesBeforePrinterSettings + PrinterINISettingLines * LayoutSize
        Do Until StartNum &amp;gt; 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&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to be dying just before "LayoutName" in the PlotString var.&amp;nbsp;&amp;nbsp; But when it gets to the msgbox and i output the string everything is populated.&amp;nbsp; Am i doing something stupidly wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2010 14:17:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-11-15T14:17:52Z</dc:date>
    <item>
      <title>Problem With Plotting Routine</title>
      <link>https://forums.autodesk.com/t5/net-forum/problem-with-plotting-routine/m-p/2826229#M63051</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build a plotting script but it keeps dying in the middle.&amp;nbsp; I do not want to use the publish engine so i am using the command interface.&amp;nbsp; Here's the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    &amp;lt;CommandMethod("MB_PlotAllTabs")&amp;gt; _
    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 &amp;lt;&amp;gt; 1 Then
            StartNum = StartNum + PrinterINISettingLines * LayoutSize
        End If
        StopNum = LinesBeforePrinterSettings + PrinterINISettingLines * LayoutSize
        Do Until StartNum &amp;gt; 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&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to be dying just before "LayoutName" in the PlotString var.&amp;nbsp;&amp;nbsp; But when it gets to the msgbox and i output the string everything is populated.&amp;nbsp; Am i doing something stupidly wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2010 14:17:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problem-with-plotting-routine/m-p/2826229#M63051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-11-15T14:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Plotting Routine</title>
      <link>https://forums.autodesk.com/t5/net-forum/problem-with-plotting-routine/m-p/2826449#M63052</link>
      <description>&lt;P&gt;Have you tried this from the command line manually?&amp;nbsp; If not, give it a try.&amp;nbsp; Set&amp;nbsp;filedia = 0, and cmddia = 0, and start with "-plot".&amp;nbsp; I have an old vba script that does this but it sends&amp;nbsp;lines 1 at a time, like:&lt;/P&gt;&lt;P&gt;ThisDrawing.SendCommand "-PLOT" &amp;amp; vbCr&lt;/P&gt;&lt;P&gt;ThisDrawing.SendCommand "yes"&amp;nbsp;&amp;amp; vbCr&lt;/P&gt;&lt;P&gt;In your example, that would be:&lt;/P&gt;&lt;P&gt;acDoc.SendStringToExecute("-plot", etc&lt;/P&gt;&lt;P&gt;I have converted this VBA to .net and&amp;nbsp;while much more verbose, I prefer the managed api methods and publish engine.&amp;nbsp; My users appreciate the info I have added to&amp;nbsp;plotprogressdialog.&lt;/P&gt;&lt;P&gt;The&amp;nbsp;converted "plot" solution has been discussed&amp;nbsp;in this forum and there is a good example here:&amp;nbsp;&lt;A href="http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html" target="_blank" rel="nofollow"&gt;http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%20.NET%20Developer's%20Guide/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;under "Define layouts and plot".&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2010 16:53:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/problem-with-plotting-routine/m-p/2826449#M63052</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2010-11-15T16:53:04Z</dc:date>
    </item>
  </channel>
</rss>

