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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Visit all Components/Elements without interaction

lgüthle
7-Bedrock

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


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.
ACCEPTED SOLUTION

Accepted Solutions
Eike_Hauptmann
15-Moonstone
(To:FV)

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

View solution in original post

5 REPLIES 5

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..

FV
17-Peridot
17-Peridot
(To:lgüthle)

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.

Eike_Hauptmann
15-Moonstone
(To:FV)

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


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

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?

Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags