I need to add an annotation feature note to ~300 parts. I wrote a maco that will add the feature and it seems to work well. I tried setting up distributed batch to call this macro that adds the feature and then saves the file to the working directory. The process will run processing ~10 parts at a time and states it completed my 105 test objects successfully. However, when I go to the output file location there are only about 40 new parts in there. If I run the distributed batch process with only one of the objects it "missed" in the object list it will work fine on that file. How can I troubleshoot this or is there a better way to do this?
Solved! Go to Solution.
@motormayhem wrote:
I need to add an annotation feature note to ~300 parts. I wrote a maco that will add the feature and it seems to work well. I tried setting up distributed batch to call this macro that adds the feature and then saves the file to the working directory. The process will run processing ~10 parts at a time and states it completed my 105 test objects successfully. However, when I go to the output file location there are only about 40 new parts in there. If I run the distributed batch process with only one of the objects it "missed" in the object list it will work fine on that file. How can I troubleshoot this or is there a better way to do this?
If I were you I would use trail file.
Step 1: Launch Creo, modify 1 part, end Creo session ... trail file is created.
Step 2: Using trail file generated in Step 1 generate new trail file repeating the code related to 1st part.
Step 3: Launch Creo and play trail file generated in Step 2.
@motormayhem wrote:
I need to add an annotation feature note to ~300 parts. I wrote a maco that will add the feature and it seems to work well. I tried setting up distributed batch to call this macro that adds the feature and then saves the file to the working directory. The process will run processing ~10 parts at a time and states it completed my 105 test objects successfully. However, when I go to the output file location there are only about 40 new parts in there. If I run the distributed batch process with only one of the objects it "missed" in the object list it will work fine on that file. How can I troubleshoot this or is there a better way to do this?
If I were you I would use trail file.
Step 1: Launch Creo, modify 1 part, end Creo session ... trail file is created.
Step 2: Using trail file generated in Step 1 generate new trail file repeating the code related to 1st part.
Step 3: Launch Creo and play trail file generated in Step 2.
Hmm ok. I believe I came across another post where you wrote some code to help develop the repeating trail file correct? Would that work here? I wouldn't need the macro as the trail file would cover the operations required to add in the annotation feature? Essentially is ends up being one long trail file with the operations for each file in it, is that correct?
I believe I came across another post where you wrote some code to help develop the repeating trail file correct?
Would that work here?
I wouldn't need the macro as the trail file would cover the operations required to add in the annotation feature?
Essentially is ends up being one long trail file with the operations for each file in it, is that correct?
So the trail file method is working for this application. I am only doing one run of this so for this project I'm just going to stick with the trail file method.
It's bit of a side question, but certainly related. My trail file is supposed to add a note to a CAD file. I tried to set it up to find and attach the note to the first coordinate system it finds in the part, however, it does not appear to succeed in finding the CS in every file. The first CS name is not always the same ID or name so I'd really like it to just pick the first one it can find in a list regardless of what it is. Below is how my trail file is selecting the CS. Essentially ctrl+F->Look for CS->History Tab->Rule=ID, Criteria ID<1000->Select the first item in the list and move on to defining the note.
However, it misses some files because it doesn't auto select the first item in the list. Is there a more robust way to pick the first coordinate system? It doesn't matter what CS it selects in the model as long as it attaches the note to a CS in the model.
@motormayhem wrote:
So the trail file method is working for this application. I am only doing one run of this so for this project I'm just going to stick with the trail file method.
It's bit of a side question, but certainly related. My trail file is supposed to add a note to a CAD file. I tried to set it up to find and attach the note to the first coordinate system it finds in the part, however, it does not appear to succeed in finding the CS in every file. The first CS name is not always the same ID or name so I'd really like it to just pick the first one it can find in a list regardless of what it is. Below is how my trail file is selecting the CS. Essentially ctrl+F->Look for CS->History Tab->Rule=ID, Criteria ID<1000->Select the first item in the list and move on to defining the note.
However, it misses some files because it doesn't auto select the first item in the list. Is there a more robust way to pick the first coordinate system? It doesn't matter what CS it selects in the model as long as it attaches the note to a CS in the model.
Hi,
the first thing that occurred to me ... (testing in Creo Parametric 4.0 M120)
1.]
Set model tree to display 1 additional column >>> Feat Type.
Save this model tree setting to tree.cfg file.
Set config.pro option ... mdl_tree_cfg_file path_to_tree.cfg
2.]
Get your file list, generate trail_no_1.txt and play it.
trail_no_1 functionality:
Open every file from the list and save model tree contents into modelname.txt file.
Example of output file:
Model Name Feat Type
-----------------------------------------------
AFX_PRJ_I_BEAM_1.PRT
Materials
YZ Datum Plane
XZ Datum Plane
XY Datum Plane
CS0 Coordinate System
CS3 Coordinate System
CS_S Coordinate System
CS_E Coordinate System
Protrusion id 31 Protrusion
A_1 Datum Axis
Datum Point id 1461 Datum Point
Group PROFILE_LENGTH_DIM Group Head
Insert Here
3.]
Get your file list + list of model tree output files, generate trail_no_2.txt and play it.
Retrieve the name of first CSYS from model tree output file (for every model). Use the name to search/select CSYS via trail.
trail_no_2 functionality:
Open every file from the list and attach note to first CSYS.
While a Trail File can be useful - they are difficult to prune down, setup and make useful (heavy debug cycle). They are a bit like a sledge hammer for ALL nails in the end - assuming everything is a "nail" that needs to be hit - vs a program / script that can evaluate if something needs to be done.
For a situation like this... CREOSON can easily be used to load models, look for annotations (notes) and then allow you to decide to process the model or not running your mapkey. It is quite easy to do via Python (CREOPYSON) or JavaScript (included in the CREOSON distribution).
If you prefer the dBatch approach and Trail Files... then CREOSON is also good for identifying which models need to be processed vs hitting everything with the same script (risky).
Hope that helps.
Dave