Cancel
Showing results for 
Search instead for 
Did you mean: 

Getting list of Parts

Pioneer
Pioneer

Hi All,

 

i need to get a complete list of parts and assembly located under "Parts"  under Object Tree as a dropdown list.

I dont know which code i have to use to get it. 

 

Thanx 

3 REPLIES

Re: Getting list of Parts

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Luisy,

 

You can use this code:

        public TxObjectList GetListOfParts()
        {
            TxObjectList components = TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants(new TxTypeFilter(typeof(TxComponent)));

            TxObjectList planningComponents = components.PlanningRepresentations;
            TxTypeFilter partsFilter = new TxTypeFilter(typeof(TxPlanningPart));
            TxObjectList planningParts = partsFilter.Filter(planningComponents);
            TxObjectList engineeringParts = planningParts.EngineeringRepresentations;

            return engineeringParts;
        }

Best Regards,

Diana

Re: Getting list of Parts

Pioneer
Pioneer

Thank you Diana,

 

I am trying to get List of parts in windows form. I want to make a windows form in which i press the button named "List" and i get the list of parts into Listview control of windows form application.

 

and i also i have worked only in Windows forms application. You ghave replied a code for getting list of parts, where i should write it and how can i implement to process simulate. Bcz in training of process simulate it is not shown.

Re: Getting list of Parts

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Luisy,

 

You can check this video on how to add UI to your commands in Process Simulate. 

On how to populate a list control, check the MSDN forums, it is a standard Windows Forms control.

 

We also have a library of our custom controls - Tecnomatix.Engineering.UI.dll

 

Best Regards,

DianaG