cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Visit all Components/Elements without interaction

SOLVED
Highlighted
Newbie

Visit all Components/Elements without interaction

hey

I am using Creo 2.0 (Date Code M120) with TK/OTK.

In sample applications I found in the internet you can select a feature (via ProSolidFeatVisit()) and in return you'll get a model and information about the feature.

I would like to visit all of the components/elements/features (whatever the modules a model is build of are called) and retrieve all the information without any user interaction.

Basically I want to:

  1. start creo with desired *.prt/*.asm-file
  2. auto-select all features/components/elements (without user interaction)
    1. retrieve all the information (like dimensions,...) (without user interaction)
  3. close creo / save information somehow/somewhere

Any Ideas?

regards,

Luis Güthle

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Visit all Components/Elements without interaction

You can also use :

- ProMdlDependenciesList in a loop with C++ vektor or Map (e.g. Hashmap) would be good

- Filter out whats the right ones you wanna get (ProMdlTypeGet()) you can directly make search through your C++ vektor or reversive function with the hasmap (whats better for you to handle)

- ProSolidDimensionVisit inside a for loop run through all dimensions and get the informations you want

I think about something like this :

pushCurrentModelInVektor

for (int i = 0; i < vector.length; i++) {

  if (ProMdlType(vector.at(i)) == ASM) {

    if (model not in vector) vector.add(submdl);

  }

}

for (int i = 0; vector.length; i++) {

  if (ProMdlType(vector.at(i)) == PRT) { 

    ProSolidDimensionVisit(vector.at(i));

  }

}

Br,

Eike

5 REPLIES 5

Re: Visit all Components/Elements without interaction

To be more specific:

  • At the beginning I would basically want to visit all of the dimensions

So if I got a *asm file I imagine I have to visit all *.prt inside the asm and inside the *.prt all the elements wich consist of dimensions?!

I found an example: "..\protoolkit\protk_appls\pt_examples\pt_dbase\TestDimension.c" .."ProTestFeatureDimensionsCollect()" seems like a promising function.. I am trying to get this work for my own code..

Re: Visit all Components/Elements without interaction

Hi all,

Luis, search source code in toolkit examples for ProUtilAsmTraverse function. It is defined somewhere in UtilVisit.c ( don't remember exact file name).

HIH.

Feliks.

Re: Visit all Components/Elements without interaction

You can also use :

- ProMdlDependenciesList in a loop with C++ vektor or Map (e.g. Hashmap) would be good

- Filter out whats the right ones you wanna get (ProMdlTypeGet()) you can directly make search through your C++ vektor or reversive function with the hasmap (whats better for you to handle)

- ProSolidDimensionVisit inside a for loop run through all dimensions and get the informations you want

I think about something like this :

pushCurrentModelInVektor

for (int i = 0; i < vector.length; i++) {

  if (ProMdlType(vector.at(i)) == ASM) {

    if (model not in vector) vector.add(submdl);

  }

}

for (int i = 0; vector.length; i++) {

  if (ProMdlType(vector.at(i)) == PRT) { 

    ProSolidDimensionVisit(vector.at(i));

  }

}

Br,

Eike

Re: Visit all Components/Elements without interaction


Hi EikeFlorianPetersen

You gave perfect solution but there is another workaround for above problem.

Here I write another approach for same

Step 1: Get Current Handler using ProMdlCurrentGet()

Step 2: Visit Model Tree using  ProSilidVisit()

Step 3: Filter for Part and Asm using ProMdlType()

Step 4: Now Visit ProSolidDimensionVisit() and write into text

Re: Visit all Components/Elements without interaction

Nikhil Daslaniya schrieb:

Step 2: Visit Model Tree using  ProSilidVisit()

I only found "ProSolidVisitAction" in TK docu.. and it refers to ProDrawingSolidsVisit which is for drawings?