- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
Could you please help me with the following. I wrote a Navisworks Manage 2013 Plug-in which takes a model and adds requirements to it from an external source. All fine on that part. Somewhere in the routine I loop through the selectionsets I created.
The trick now is, I want to assign to each modelitem of that selectionset the requirements as a custom property. I am able to do so using the ComApi/ComApiBridge (code given below).
// get the selection in COM
ComApi.InwOpSelection comSelectionOut =
ComApiBridge.ComApiBridge.ToInwOpSelection(aSelSet.ExplicitModelItems );
foreach ( ComApi.InwOaPath3 oPath in comSelectionOut.Paths() )
{
// get properties collection of the path
ComApi.InwGUIPropertyNode2 propn =
(ComApi.InwGUIPropertyNode2)state.GetGUIPropertyNode(oPath, true);
// add the new property category to the path
propn.SetUserDefined(0, "Eisen",
"Eisen", newPvec);
}
The result is that when I select an object in the model it perfectly shows the Requirements tab called "Eisen". See the picture below (ps. dont worry that there are two tabs showing "Eisen", thats correct (for now 🙂 ).
I now want to have the Requirements showing in the 'Child' of those ModelItems as well, that is in the case of the example given above, the 'Solid' (see picture below). I have been trying to do so with all sorts of methods from the ComApi, but I just am not able to succeed.
I tried things like the code snippet below, but just cant get it to work.
ComApi.InwGUIPropertyNode2 propn2 = (ComApi.InwGUIPropertyNode2)state.GetGUIPropertyNode(oPath.Nodes().Last, true);
Could you please point me in the right direction on how to get the Requirement (i.e. "Eisen") also at the ModelItem "Solid" (and others).
Thanks in advance!
All the best,
Jeroen
Solved! Go to Solution.