Drawing Template File Location

Drawing Template File Location

mordend
Enthusiast Enthusiast
1,958 Views
2 Replies
Message 1 of 3

Drawing Template File Location

mordend
Enthusiast
Enthusiast

Does anyone know how to access the "Drawing Template File Location" path from options?

 

I assume its through Application.GetSystemVariable() like the Support file search paths, but I don't know what the system variable name is?

 

Or is there a way to view a list of the system variable names available to Application.GetSystemVariable()?

0 Likes
Accepted solutions (1)
1,959 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

 

You can get or set the templates folder via the Application.Preferences COM object.

dynamic preferences = Autodesk.AutoCAD.ApplicationServices.Application.Preferences;
string templatePath = preferences.Files.TemplateDWGPath;

or just get it via the TemplatePath environment variable

string templatePath = HostApplicationServices.Current.GetEnvironmentVariable("TemplatePath");


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3

mordend
Enthusiast
Enthusiast
string templatePath = HostApplicationServices.Current.GetEnvironmentVariable("TemplatePath");

Works for me, thank you sir.

0 Likes