Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am in the process of building an add-in button. When clicked, it will execute the Model Checker from Autodesk Interoperability Tools. Following the provided guidelines, I am progressing through the necessary steps. However, there is a prerequisite to create an IPreBuiltOptionsService before initializing a new service. How should I set up the pre-built options in this context?
ModelCheckList.xml - https://interoperability.autodesk.com/modelchecker/hostedchecks/bestpractices-2022.xml
public CheckSet GetCurrentCheckSet(Document doc)
{
string checkSetPath = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"Resources",
"ModelCheckList.xml");
// Create an instance of a class that implements IPreBuiltOptionsService
IPreBuiltOptionsService preBuiltOptionsService = { };
var service = new CheckSetService(preBuiltOptionsService);
var checkSet = service.GetCheckSet(checkSetPath);
var runStateRepository = new RunStateRepository(doc);
var runState = runStateRepository.GetRunState();
if (runState != null)
{
Utility.SetCheckSetFromRunState(checkSet, runState);
}
return checkSet;
}
Solved! Go to Solution.