<?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 Re: Visual Basic.NET plot multiple drawings in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070773#M77000</link>
    <description>Hi i am doing a parametric program using VBA,Vlisp,AutoCAD. am converting to Vb.Net and CAD2006. can you please help me  to insert the external drawings (sideview.dwg, Topview.dwg) in active drawing file Using VB.Net......&lt;BR /&gt;
&lt;BR /&gt;
It will help me a lot &lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance</description>
    <pubDate>Thu, 24 Jan 2008 07:47:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-24T07:47:14Z</dc:date>
    <item>
      <title>Visual Basic.NET plot multiple drawings</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070771#M76998</link>
      <description>Hey Everyone,&lt;BR /&gt;
I have been using vb.net for about3 or 4 months now. i have made a program that reads the location of drawings from a word file and then copies and renames the file. i am interested in having my program print the drawings using autocad. Here is a copy of the code i am using.&lt;BR /&gt;
&lt;BR /&gt;
        ' Autodesk AutoCAD 2000 or above and Universal Document Converter&lt;BR /&gt;
        ' should be installed on your PC&lt;BR /&gt;
&lt;BR /&gt;
        ' Define constants&lt;BR /&gt;
        Const acExtents = 1&lt;BR /&gt;
        Const acScaleToFit = 0&lt;BR /&gt;
&lt;BR /&gt;
        ' Run AutoCAD as COM-server&lt;BR /&gt;
        On Error Resume Next&lt;BR /&gt;
        Dim App As Object&lt;BR /&gt;
        'Dim App As New AutoCAD.AcadApplication&lt;BR /&gt;
        Dim Drawing As Object&lt;BR /&gt;
        Dim Layout As Object&lt;BR /&gt;
        Dim ActiveSpace As Object&lt;BR /&gt;
        Dim n As Integer = 0&lt;BR /&gt;
        Dim DrawType As String = ""&lt;BR /&gt;
        Dim FilePath As String = ""&lt;BR /&gt;
        Dim MyDwg As String = ""&lt;BR /&gt;
        Dim Dwg As Object&lt;BR /&gt;
        Dim DwgClass As String = ""&lt;BR /&gt;
        Dim k As Integer = 0&lt;BR /&gt;
        Dim strFilePath As String = ""&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
        App = CreateObject("AutoCAD.Application")&lt;BR /&gt;
&lt;BR /&gt;
        For n = 0 To DataGridView1.RowCount - 1 'Determines what File Type the user selected it was, and whether or not the user select a file type.&lt;BR /&gt;
            If DataGridView1.Item(2, n).Value = "False" And DataGridView1.Item(3, n).Value = "False" And DataGridView1.Item(4, n).Value = "False" Then 'Determines whether or not the user select a file type.&lt;BR /&gt;
                MsgBox("You must select what type of drawing " &amp;amp; DataGridView1.Item(0, n).Value &amp;amp; " is.", CType(vbOKOnly + vbCritical, MsgBoxStyle))&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            End If&lt;BR /&gt;
        Next n&lt;BR /&gt;
        For n = 0 To DataGridView1.RowCount - 1 'Determines what File Type that the user selected&lt;BR /&gt;
            MyDwg = DataGridView1.Item(0, n).Value&lt;BR /&gt;
            MsgBox(MyDwg)&lt;BR /&gt;
            If DataGridView1.Item(2, n).Value = "True" Then&lt;BR /&gt;
                DrawType = ".dwg"&lt;BR /&gt;
            ElseIf DataGridView1.Item(3, n).Value = "True" Then&lt;BR /&gt;
                DrawType = ".idw"&lt;BR /&gt;
            ElseIf DataGridView1.Item(4, n).Value = "True" Then&lt;BR /&gt;
                DrawType = ".pdf"&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox("You must select what type of drawing " &amp;amp; DataGridView1.Item(0, n).Value &amp;amp; " is.", CType(vbOKOnly + vbCritical, MsgBoxStyle))&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            End If&lt;BR /&gt;
&lt;BR /&gt;
            Dwg = Split(MyDwg, "-") 'Splits the Drawing Name (MyDwg) into an array&lt;BR /&gt;
            DwgClass = Dwg(2)&lt;BR /&gt;
            Trim$(DwgClass)&lt;BR /&gt;
            MsgBox(DwgClass)&lt;BR /&gt;
            For k = 0 To UBound(CType(Dwg, Array))&lt;BR /&gt;
                Dwg(k) = Trim$(Dwg(k))&lt;BR /&gt;
            Next k&lt;BR /&gt;
            If DwgClass Like "###" Then '### stands for 3 numeric values&lt;BR /&gt;
                MyDwg = Dwg(0) &amp;amp; "-" &amp;amp; Dwg(1) &amp;amp; "-" &amp;amp; Dwg(2)&lt;BR /&gt;
            ElseIf DwgClass Like "###[A-Z]" Then '### stands for 3 numeric values and [A-Z] is a wildcard of only these letters and are Capital&lt;BR /&gt;
                MyDwg = Dwg(0) &amp;amp; "-" &amp;amp; Dwg(1) &amp;amp; "-" &amp;amp; Dwg(2)&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox("There seems to be a problem with the drawings class.", vbOKOnly + vbCritical)&lt;BR /&gt;
            End If&lt;BR /&gt;
            MsgBox(DwgClass)&lt;BR /&gt;
            Select Case Microsoft.VisualBasic.Left$(DwgClass, 1)&lt;BR /&gt;
                Case "2"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.PIDText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.PIDText gets folder structure from config file)&lt;BR /&gt;
                Case "3"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.VesselText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.VesselText gets folder structure from config file&lt;BR /&gt;
                Case "4"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.StructuralText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.StructuralText gets folder structure from config file&lt;BR /&gt;
                Case "5"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.PipingText &amp;amp; MyDwg &amp;amp; DrawType ''My.Settings.PipingText gets folder structure from config file&lt;BR /&gt;
                Case "6"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.ISOText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.ISOText gets folder structure from config file&lt;BR /&gt;
                Case "7"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.InstElecText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.InstElecText gets folder structure from config file&lt;BR /&gt;
                Case "8"&lt;BR /&gt;
                    strFilePath = strelement &amp;amp; My.Settings.MembraneTubesText &amp;amp; MyDwg &amp;amp; DrawType 'My.Settings.MembraneTubesText gets folder structure from config file&lt;BR /&gt;
                Case Else&lt;BR /&gt;
                    MsgBox(DwgClass &amp;amp; " - This Is An Invalid Drawing Class", CType(vbOKOnly + vbCritical, MsgBoxStyle))&lt;BR /&gt;
            End Select&lt;BR /&gt;
&lt;BR /&gt;
            App.Preferences.System.SingleDocumentMode = False&lt;BR /&gt;
&lt;BR /&gt;
            Drawing = App.Documents.Open(strFilePath, False)&lt;BR /&gt;
            If Drawing = Not Nothing Then&lt;BR /&gt;
&lt;BR /&gt;
                ' Change AutoCAD preferences for scaling the drawing to page&lt;BR /&gt;
                If Drawing.ActiveSpace = 0 Then&lt;BR /&gt;
&lt;BR /&gt;
                    ActiveSpace = Drawing.PaperSpace&lt;BR /&gt;
                    Layout = ActiveSpace.Layout&lt;BR /&gt;
&lt;BR /&gt;
                Else&lt;BR /&gt;
&lt;BR /&gt;
                    ActiveSpace = Drawing.ModelSpace&lt;BR /&gt;
                    Layout = ActiveSpace.Layout&lt;BR /&gt;
&lt;BR /&gt;
                End If&lt;BR /&gt;
&lt;BR /&gt;
                Layout.PlotType = acExtents&lt;BR /&gt;
                Layout.UseStandardScale = True&lt;BR /&gt;
                Layout.StandardScale = acScaleToFit&lt;BR /&gt;
&lt;BR /&gt;
                ' Plot the drawing&lt;BR /&gt;
                Call Drawing.Plot.PlotToDevice("Dell AIO Printer A920.pc3")&lt;BR /&gt;
&lt;BR /&gt;
                ' Close drawing&lt;BR /&gt;
                Drawing.Close(False)&lt;BR /&gt;
                Drawing = Nothing&lt;BR /&gt;
&lt;BR /&gt;
            End If&lt;BR /&gt;
            System.Threading.Thread.Sleep(30000) 'added so that there is a chance for the drawing to print out before the other one starts.&lt;BR /&gt;
        Next n&lt;BR /&gt;
&lt;BR /&gt;
I cant use the AutoCAD API because this is suppose to work for multiple versions of autocad. I am sure That there is a better way but i do not know how. Can anyone help me.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Dan</description>
      <pubDate>Mon, 17 Sep 2007 23:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070771#M76998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-09-17T23:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.NET plot multiple drawings</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070772#M76999</link>
      <description>Sorry I forgot to add, this code works for ploting 1 file but i want to plot multiple files. If i don't have the sleep function then the file that is printed is the last file on the list. Is there a way that I can tell when autocad is ready to recieve another plot command. Thanks,&lt;BR /&gt;
Dan503</description>
      <pubDate>Thu, 13 Dec 2007 15:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070772#M76999</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-12-13T15:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.NET plot multiple drawings</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070773#M77000</link>
      <description>Hi i am doing a parametric program using VBA,Vlisp,AutoCAD. am converting to Vb.Net and CAD2006. can you please help me  to insert the external drawings (sideview.dwg, Topview.dwg) in active drawing file Using VB.Net......&lt;BR /&gt;
&lt;BR /&gt;
It will help me a lot &lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance</description>
      <pubDate>Thu, 24 Jan 2008 07:47:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070773#M77000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-24T07:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Visual Basic.NET plot multiple drawings</title>
      <link>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070774#M77001</link>
      <description>You need to change the BACKGROUNDPLOT system variable to 0 otherwise Acad will try and print over the previous.</description>
      <pubDate>Fri, 17 Apr 2009 08:09:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/visual-basic-net-plot-multiple-drawings/m-p/2070774#M77001</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-17T08:09:15Z</dc:date>
    </item>
  </channel>
</rss>

