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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to force all parts in an assembly to regenerate?

cstarnes
10-Marble

How to force all parts in an assembly to regenerate?

I have an analysis feature in each part in an assembly that reads cost from an excel spreadsheet and stores it in a parameter. It works fine, as long as the part regenerates. The problem is, how can I force all parts to regenerate when I regen the assembly, after updating the spreadsheet with new cost info?

The only way I've found to get a part's excel analysis feature to update is if I modify the geometry and force a full regen. That of course is impractical in a large assembly, when all I want to do is update a parameter value in every part.


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.
13 REPLIES 13
TomU
23-Emerald IV
(To:cstarnes)

Maybe try the config option "regen_solid_before_save".

Hi,

use Search Tool to select all parts - see following picture.

select.png

After clicking Close, move mouse cursor into graphics window, press right mouse button and use Regenerate command from context menu.

Note: I am not sure if this procedure resolves your problem, because I did not test it.

MH


Martin Hanák

Thanks, but that still doesn't force a regen unless part(s) have changed.

BillRyan
15-Moonstone
(To:cstarnes)

Interesting that you are trying to add Cost information to a CAD object...

As an alternate approach, have you tried to use the "edit Attributes" UI in the workspace to easily modify and populate the cost attribute?  Or maybe you are not in Windchill...but this does open up another possibility of eliminating the need to regenerate if you were.

Capture.JPG

No Windchill here Bill....just good old-fashioned Pro/E (err...  Creo) 

Hi,

I did some testing and realized that your parts must contain relation which inserts cost value from specific excel cell into model parameter, this something like

COST=XL_1_1:FID_ANALYSIS1

I created example data in CR2 M070 for you, see attached zip file.

The only file which contains Excel analysis is excel_anls_costs.prt

Relations which transfer cost values are defined in excel_anls.asm

How to use my data:

  1. open excel_anls_costs.xls, modify cost values, save
  2. open excel_anls.asm, expand excel_anls_costs.prt, initiate edit definition of Excel analysis feature, click green mark
  3. regenerate excel_anls.asm twice !!!

To see regenerate result, show cost parameter in Model Tree column.

MH


Martin Hanák

MH,


Here is what I am actually doing in each part's relations:

UNIT_COST = UNIT_COST:FID_EXCEL_COST

COST = LENGTH * UNIT_COST

Where in this case, UNIT_COST is a cost per inch of an extrusion. In purchased parts and components, UNIT_COST would just be the total cost, and the second line would simply be:

COST = UNIT_COST

By doing it this way with a common parameter name, I was able to create a mapkey that inserts the excel_analysis and writes the relations to any part very quickly.

I'll play around with your example post back here.

Thanks much!

EDIT:

I haven't looked at your example yet, but I'm guessing you are reading each part's cost from within the assembly, and then assigning a bunch of relations to transfer the cost downward into each part. Something like:

COST:2 = XL_1_1:FID_ANALYSIS1
COST:3 = XL_1_2:FID_ANALYSIS1

...

...

While this would work (I think), it doesn't help with my task of updating hundreds of assemblies... as each assembly would be unique and need a new set of relations written for it's parts

What I really need to do is add this intelligence into the parts, so that they can just be copied into all assembly folders once the modification is done. Then if I can get the assembly to force it's parts to regenerate, all will be updated as needed.

Hi,

your guess concerning my example data is correct .

Another tip concerning automation of your problem. I hope you can solve "regeneration problem" using trail file.

Procedure 1.

  1. launch Creo
  2. open a part
  3. start Edit Definition of EXCEL_COST analysis feature and finish it using Green check mark button immediately
  4. regenerate part twice
  5. save part
  6. end Creo session
  7. now you have trail representing the above procedure

Procedure 2.

  • extract header from trail file
  • extract code representing steps 2.-5. from Procedure 1
  • make script reading list of part names which makes new trail file containing the header and instance of code for every part name

Procedure 3.

  • create list of parts used in specific assembly
  • run script to prepare trail file
  • launch Creo and run trail file
  • open assembly to see "regeneration results"

Note: I hope you can use TrailMaker mentioned on Trailmaker 0.3 page to automate "regeneration" (download link available at the bottom of the page).

MH


Martin Hanák

Hi,

I tested Trailmaker successfully in CR2 M070. Trail file is attached. During my test all "regenerated files" were located in working directory.

EDIT: I also attached my test files.

MH


Martin Hanák

The -real- problem is PTC developers short-cut the regen process in order to make it seem faster. I know that customers don't like it when it takes time to recalculate but, it's like in Excel, setting recalc to manual and not updating external links because it goes faster. Of course, that sort of thing can lead to unexpected / undesired answers.

It would be better to have a button that forced full regen or, better, for a 'skip_full_regen' config option that can only be set on a per-session basis and cannot be persistent (not readable from config files,) so that the models are always completely up-to-date. For those who want to go fast, they can create a mapkey that sets the skip-it mode.

Obviously there's a need for loop detection so that regen can be interrupted against the possibility of endless loops.

The alternative would be more sophisticated detection of when changes are required. Since there is no way for Creo to ever know when the Excel data changes, there is no way to ever flag such models as being fully up to date. Every top level regen should regen every model that has an Excel analysis.

It goes even deeper than that. I discovered that if you set up a two-way excel analysis, where you both send a parameter to excel and then get a return value, it will update if a parameter or dimension is changed. But if you only have it set to read a value from excel, then it won't update unless geometry changes.

It's just beyond me. Why not just have a config option like "REGEN_EXCEL_ALWAYS", that updates the analysis feature on every regen whether you send a parameter or just want to read one.

I've been using Pro/E since version 14 back in the early/mid '90s, and some things just never change. For all of the power of Pro/E...errr...Creo, there is still that underlying theme of "Why in the #$@% can't they just add this simple solution to a major problem".

For example, being able to add a simple relation to an assembly like "TOTAL_COST = SUM(components:COST)". How hard can that be? People have been asking for that type of functionality for over two decades (at least, that I know of)...and as far as I can tell it's STILL not possible.

I just don't get it sometimes.

Since there is probably no way to force a complete regen, or worse, 2 regens if some buried routing has to parse out.

Let me suggest a Pro|Workaround (tm) that may just do it:

From your highest level assembly, change the units and have all the children change also.

Change it back.

That should regenerate everything twice.

However, I suggest you make a backup of that top level assembly; clear your session memory; select the backup folder as your working folder; and open the top level.  (clear memory and work on temporary copies).

Jose_Costa
6-Contributor
(To:cstarnes)

If you are going to use always the same parameter I suggest using the find tool to select all the analyses features:

2016-11-02 21_57_06-Search Tool_1.png

Then, supress, resume and regenerate. This may be a way to achieve what you are looking for.

Here is mapkey to do that:

mapkey $F2 @MAPKEY_NAMEAnalysis Regen;@MAPKEY_LABELAnalysis Regen;\

mapkey(continued) ~ Command `ProCmdMdlTreeSearch` ;\

mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio` 1 `Feature`;\

mapkey(continued) ~ Activate `selspecdlg0` `SelScopeCheck` 1;\

mapkey(continued) ~ Select `selspecdlg0` `RuleTab` 1 `Attributes`;\

mapkey(continued) ~ Select `selspecdlg0` `RuleTypes` 1 `Expression`;\

mapkey(continued) ~ Input `selspecdlg0` `ExtRulesLayout.ExtExprLayout.ExprParamsList` \

mapkey(continued) `UNIT_COST`;\

mapkey(continued) ~ Update `selspecdlg0` `ExtRulesLayout.ExtExprLayout.ExprParamsList` \

mapkey(continued) `UNIT_COST`;\

mapkey(continued) ~ Select `selspecdlg0` `ExtRulesLayout.ExtExprLayout.ExprOperandLabel` 1 ` * \

mapkey(continued) `;~ Activate `selspecdlg0` `EvaluateBtn`;\

mapkey(continued) ~ Select `selspecdlg0` `ResultList` -1;~ Activate `selspecdlg0` `ApplyBtn`;\

mapkey(continued) ~ Activate `selspecdlg0` `CancelButton`;~ Command `ProCmdSuppress` ;\

mapkey(continued) ~ Activate `del_sup_msg` `ok`;~ Command `ProCmdResume` ;\

mapkey(continued) ~ Command `ProCmdRegenAuto` ;

Just replace in lines 8 and 10 your parameter name.

Jose

Top Tags