Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I extract all the Component Id's inside my assembly by following recrusive function .
private static void recursiveTraverseBOM(Model model, Session session) {
try {
if(model.GetType().equals(ModelType.MDL_ASSEMBLY)) { //We have an assembly Features components = ((Solid) model).ListFeaturesByType(null, FeatureType.FEATTYPE_COMPONENT); //MEMBERS OF COMPONENT for(int i = 0; i < components.getarraysize(); i++) { ComponentFeat component = (ComponentFeat) components.get(i);//next component String id=" "+ component.GetId()+" "; ModelDescriptor md = component.GetModelDescr(); Model componentModel = session.GetModelFromDescr(md);//get the model recursiveTraverseBOM(componentModel, session); } }
}catch(Exception e){
//do nothing..
}
}
Here i am gets all the Components Id's i need the Component path .I dont know how to get the Component path from a component .Please anybody help on this ...
Thanks Regards,
Diensh