Toolkit: ProMdlCombStateCreate() - How 2 add layer state
Hi,
was anyone of you able to define a new Combined State in a Creo model and add a layer state item to the array of items???
All the other items (Xsec, SimpRep, View, ExplodeState, StyleState) I am able to set, but not the layer state.
In my applications the layer state is simply being ignored (no error when adding a model item).
What I tried so far...
Because there is no function "ProLayerstateInit()" I used for my first try (do the initialization with ProModelitemByNameInit()) :
ProModelitem *CombStateItemArr;
ProLayerstate hLayerStateItem;
status = ProModelitemByNameInit (MyAssembly, PRO_LAYER_STATE, wLayerStateName, &hLayerStateItem);
status = ProArrayObjectAdd ((ProArray*)&CombStateItemArr, -1, 1, &hLayerStateItem);
My second try (get all layer states in the assembly with ProLayerstatesGet():
status = ProLayerstatesGet (MyAssembly, &LayerStateArr);
Then I loop through all array elements in LayerStateArray and check the name against the layer state name I want to set....
ANY IDEAS?
Otherwise I have to open a case with PTC.
Andreas Hellmann
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

