Setting default drawing template to AutoCAD

By Virupaksha Aithal

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


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading