Setting up IPreBuiltOptionsService options for CheckSet in AIT.

Setting up IPreBuiltOptionsService options for CheckSet in AIT.

shrey_shahE5SN4
Explorer Explorer
364 Views
1 Reply
Message 1 of 2

Setting up IPreBuiltOptionsService options for CheckSet in AIT.

shrey_shahE5SN4
Explorer
Explorer

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;
}

 

0 Likes
Accepted solutions (1)
365 Views
1 Reply
Reply (1)
Message 2 of 2

JasonKunkel
Collaborator
Collaborator
Accepted solution

Sorry for the confusion. The help page updates did not finalize. We've updated the online help with the information for IPreBuiltOptionsService and updated the sample code as well. You may need to do a hard refresh in your browser to see the new pages. They sometimes cache more than expected.


Jason Kunkel
Senior Practice Manager, Architecture and Engineering
CADD Microsystems Blog
RVIT Blog | Twitter | LinkedIn