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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Create an assembly simprep from user defined part simpreps?

mcrist
8-Gravel

Create an assembly simprep from user defined part simpreps?

We have common hardware and parts that have a custom simprep named NHA_SIMPLE. This simprep is in most of our hardware. When that hardware is included in an assembly, we would like to make an assembly level NHA_SIMPLE rep that includes the parts, but uses the user defined simprep. It looks like this should be possible with ProSimprepActionInit, however, there is no action for a user defined simprep. During creation of an assembly simprep, is there a way to include the user defined rep of a component?

6 REPLIES 6
kdirth
21-Topaz I
(To:mcrist)

Yes.  If I understand what you want it is fairly easy.  When defining the simplified rep, select User Defined in the simplified rep definition box.  From the popup box select the desired rep to use in the assembly simplified rep.

 

rep1.jpgrep2.JPG

 

 

 


There is always more to learn in Creo.
mcrist
8-Gravel
(To:kdirth)

I see how to do it manually, but how do you select these user defined reps with Toolkit when making an assembly rep?

mcrist
8-Gravel
(To:mcrist)

Rereading my original post, I was not clear in my request. I apologize for the confusion. We would like to automate the process of creating an assembly simprep. The components in the assembly all have a user defined simprep (for example, called NHA_SIMPLE) that would be included in an assembly simprep of the same name. Using Toolkit, I think the function to call is ProSimprepAction, but when filling in the ProSimprepActionInit function, it doesn't appear that there is a way to select the user defined representation. Is it possible to create an assembly rep from other user defined component reps?

RPN
17-Peridot
17-Peridot
(To:mcrist)

As far I knew, you cannot have from one model multiple sreps open in one session. What will happen if you activate the srep just before assemble, because the model handle is the same? Or activate the srep just after assembling?

FV
17-Peridot
17-Peridot
(To:mcrist)

Hi all,

The most of the code is in TestSimpRep.c in 'examples' directory.

The program flow as follow:

  • retrieve the main assembly
  • determine a name for a new simprep - the name has to be unique - if NHA_SIMPLE was used already, something else needs to be made, for example NHA_SIMPLE_1 and so on...
  • collect all ProAsmcomppath from the simprep to be copied, (one could use ProSolidDispCompVisit with ProAsmcompVisibilityGet) - ProAsmcomppath collection will be in the context of the subassembly model.
  • update all members in ProAsmcomppath collection to the top level assembly context.
  • use the updated ProAsmcomppath collection to create a new simprep in the top level assembly with the default action PRO_SIMPREP_EXCLUDE and the action for ProSimprepitem's being PRO_SIMPREP_INCLUDE

This is all.

HIH.

FV.

 


@mcrist wrote:

Rereading my original post, I was not clear in my request. I apologize for the confusion. We would like to automate the process of creating an assembly simprep. The components in the assembly all have a user defined simprep (for example, called NHA_SIMPLE) that would be included in an assembly simprep of the same name. Using Toolkit, I think the function to call is ProSimprepAction, but when filling in the ProSimprepActionInit function, it doesn't appear that there is a way to select the user defined representation. Is it possible to create an assembly rep from other user defined component reps?


 

 

mcrist
8-Gravel
(To:FV)

I think this gets me much closer to the answer. In TestSimpRep.c, around line 161 is a call to ProSimprepMdlnameRetrieve. The third and fourth options control selecting a user defined rep when the third option is PRO_SIMPREP_USER_DEFINED, and the fourth option is the name of the user defined rep.

 

Thank you!

Announcements


Top Tags