Solved
Extract all the part Id in a session using Jlink
I need to extract all the component Id's inside the model .
//Arraylist to stores the ID ,NAME
ArrayList <String> std1=new ArrayList<String>();
//GET SESSION Session session=pfcGlobal.GetProESession(); //GET MODEL Model mod=session.GetCurrentModel(); //Set Model=Null Model model = null; //GET ASSEMBLY Assembly asm = (Assembly) session.GetActiveModel(); //Get the Feautres in an Assembly Features components = asm.ListFeaturesByType(null, FeatureType.FEATTYPE_COMPONENT); //CREATE MODELS Models models = Models.create(); //MEMBERS OF COMPONENT for(int i = 0; i < components.getarraysize(); i++) { //GET COMPONENT ComponentFeat component = (ComponentFeat) components.get(i); //MODELDESCRIPTOR TO LOAD MODEL ModelDescriptor md = component.GetModelDescr(); //LOAD MODEL model = session.GetModelFromDescr(md); //EXTRACT THE NAME AND ID String nameid=""+model.GetFullName()+" - "+ component.GetId()+" "; //ADD THE ID AND NAME TO LIST std1.add(nameid); //if model is assembly then again iterate }
The above code extract all the components id into the list.The code extract only the first level components.Its not able to go for all level.I want to extract all the level components Id into my list .please Help me to solve this.Thanks in advance

