I have a .NET add-in written in C# that works well for importing a profile:
// Access the Preferences object AcadPreferences acPrefComObj = (AcadPreferences)Application.Preferences; // Load the OFC AutoCAD Profile acPrefComObj.Profiles.ImportProfile("ACAD_Profile", @"C:\CADContent\2019\acad\profiles\ACAD_Profile.arg",true);
What I can't figure out is how to set the profile as active. I just don't see where the API allows it. Any ideas?
Solved! Go to Solution.
Solved by ThomasRambach. Go to Solution.
acPrefComObj.Profiles.ActiveProfile="[the profile name]"
Before importing a profile with given name, I'd check if the Profiles collection has a profile with the same name, or a profile with the same is current (ActiveProfile), and decide what to do.
Norman Yuan
Can't find what you're looking for? Ask the community or share your knowledge.