'Code By @ClintBrown3D 'Originally posted at https://clintbrown.co.uk/automatic-drawings-With-ilogic/ 'Check if this is a drawing file Dim doc = ThisDoc.Document If doc.DocumentType = kDrawingDocumentObject Then End If 'In parts & asemblies - Write file name and path to temp text file oWrite = System.IO.File.CreateText("C:\TempPath\part.txt") oWrite.WriteLine(ThisDoc.PathAndFileName(True)) oWrite.Close() oFilePather = ThisDoc.Path & "\" 'In parts & asemblies - Write new drawing name to temp text file oWrite = System.IO.File.CreateText("C:\TempPath\" & ThisDoc.FileName & ".txt") oWrite.WriteLine(oFilePather & ThisDoc.FileName & ".dwg") oWrite.Close() 'Read Drawing name from text file oRead = System.IO.File.OpenText("C:\TempPath\" & ThisDoc.FileName & ".txt") EntireFile1 = oRead.ReadLine() oRead.Close() oDrawingName = EntireFile1 'Copy the Template file > keep templates saved in your project workspace, you need a separate part and assembly template Dim oCopyFiler As String = "www.clintbrown.co.uk" If doc.DocumentType = kPartDocumentObject Then oCopyFiler = "Q:\Autodesk\Erik's Macros\Erik\Part Drawing Template Single.dwg" Else End If ' Check if drawing exists - If it does, opening existing drawing If System.IO.File.Exists(oDrawingName & DWGType) Then MessageBox.Show("Drawing already exists > Opening Existing Drawing", "@ClintBrown3D") ThisDoc.Launch(oDrawingName & DWGType) Return End If 'Launch New drawing Dim oNewFiler As String = EntireFile1 System.IO.File.Copy(oCopyFiler,oNewFiler,(True)) ThisDoc.Launch(oNewFiler)