Below code shows the procedure to set the default drawing template to AutoCAD. So, once you set the template path, AutoCAD opens the template file automatically, without asking the user for template selection during “New” command.
<CommandMethod("setTempalatePath")> _
Public Shared Sub setTempalatePath()
Dim acadApp As Object = Application.AcadApplication
Dim files As Object = acadApp.Preferences.Files
Application.ShowAlertDialog("Old template file : " _
+ files.QNewTemplateFile)
‘Give full path…
files.QNewTemplateFile = "c:\MyTemplates\acad.dwt"
Application.ShowAlertDialog("new template file : " _
+ files.QNewTemplateFile)
End Sub

Leave a Reply