Skip to main content
12-Amethyst
December 2, 2016
Solved

Get a Saved Filter for reading a structure

  • December 2, 2016
  • 2 replies
  • 4826 views

In the Windchill GUI, on the structure tab (info page of a WTPart), I can define and reuse Filter for the configuration. See the following immage:

screenshot_2016-12-02_000751.jpg

I would like to export the part structure using one of the saved filter I created in Windchill.  My first approach is to try to find the instance of ConfigSpec, but I could not really find the way to go.

Is the following a good starting point or should I look for "Filter" instead of ConfigSpec?:

ConfigService.getConfigSpecFor(NavCriteriaContext(....)) 

Thanks,

LM

Best answer by lmouchard

There is a direct way of getting the Filter for WTPart structure:

NavigationCriteria navigationCriteria = NavigationCriteriaHelper.service.getNavigationCriteria("MyFilter");

I am not quite sure how to get the Filter for structure of WTDocument, it could be thsnls one of the other methods of the service.

Loïc

2 replies

lmouchard12-AmethystAuthor
12-Amethyst
December 6, 2016

Hi all,

after some deeper researches, I think we should be able to get the configuration from the NavigationCriteria. I could create a Navigation Criteria Context, but I suppose I need the application name use by Windchill to store the Filters... With the following code, I am able to retrieve the default ConfigSpec for the part in the 'list'

NavCriteriaContext navCriteriaContext = new NavCriteriaContext();

navCriteriaContext.setApplicableType(WTPart.class);

// navCriteriaContext.setApplicationName("???");

navCriteriaContext.setSeeds(list);

WTPartGetConfigSpecForDelegate delegate = new WTPartGetConfigSpecForDelegate();

List configSpecs = delegate.getConfigSpecFor(navCriteriaContext);

Does someone know has a tip what could be used as application name, or eventually whether I am on the right track?

Thanks,

LM

lmouchard12-AmethystAuthorAnswer
12-Amethyst
December 6, 2016

There is a direct way of getting the Filter for WTPart structure:

NavigationCriteria navigationCriteria = NavigationCriteriaHelper.service.getNavigationCriteria("MyFilter");

I am not quite sure how to get the Filter for structure of WTDocument, it could be thsnls one of the other methods of the service.

Loïc

1-Visitor
September 10, 2017

Hi all,

 

                      Please let me know how to derive the part structure based on Saved filter, whether it is feasible, if yes then, please let me know the brief information & Supported API's, would be helpful for us..

 

Thanks,

Srinivasan.