Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I have a Creo3 part which has an Input section with logic to prompt the user for certain parameters using the Regenerate Enter functionality. Depending on the parameters selected, logic around the features in ProProgram will turn features on and off. Each of the features require different parameters to drive the geometry.
I can also use the Regenerate Read File functionality and select a .txt file with all of the parameter names and values to generate the same geometry. Here is where I am running into problems. It seems that the order of the parameters in the .txt file matters and also not all of the parameters are populated from the values in the .txt file.
1) Does anyone know exactly how the Regenerate Read File functionality works?
2) Does Creo3 simply read in the parameter values in the order that they appear in the .txt file?
3) Why are some of the parameters ignored?
4) Does the logic around the parameters in the Input section affect this?
5) Does the logic around the part features and/or the relations on the features affect which parameters are populated?
Some additional details on my part...
The part file has an Input section that will prompt the user to enter "ctrlparam" which, depending on the value entered will turn on or off different features. Let's say that a "ctrlparam" == "01" turns on "feat1" and "feat1" requires parameter "A1" to drive the geometry. A value of "ctrlparam" == "02" turns on "feat2" and "feat2" requires parameter "A2" to drive the geometry.
Example1
If my "order.txt" file contents look like this:
ctrlparam = "01"
A1 = 10.00
A2 = 20.00
Regenerate Read File "order.txt" will not update the A2 parameter value. This doesn't cause a failure in the part because A2 is not needed, but how(and when) does Creo3 decide which parameters to populate?
Example2
If my "out_of_order.txt" file contents look like this:
A1 = 10.00
ctrlparam = "01"
A2 = 20.00
Regenerate Read File "out_of_order.txt" will not update the A1 or A2 parameter values. This may cause a failure as A1 is needed to control "feat1".
Anyone know what is going on 'under the hood' of Regenerate Read File functionality?
Hi,
1.) I think that the order of parameters in file must be the same as in menu when you select Enter command.
2.] Are your parameters mentioned in INPUT section model parameters ? I hope that you do not use feature dimensions or feature parameters.
3.] Look at following help pages for inspiration
MH
Thanks MH. I've built a very simple part in Creo3 to try to understand what is going on. The part takes a string parameter, "TRB" which for a value of "01" turns on a cylinder driven by a "DIA1" parameter. For "TRB" == "02, the cylinder is turned off and a rectangular protrusion is turned on, which has one of it's sides driven by a "LEN1" parameter. here's what the INPUT section looks like and these are typical part parameters:
The part is currently saved with these parameters:
The parts that I am having issues with are very complicated and there are some other parameters that are not being updated but I think it might be because they are not in the INPUT section. Unfortunately the INPUT section is many pages long with multiple nested loops, etc. so there's a lot to sort through. Making simple parts to test the logic is sometimes helpful. I've got a couple of other ideas to try next...
Well, I discovered a difference in this functionality between parts created in Creo2 and parts created in Creo3.
Part created in Creo2 example: part saved with the rectangle feature turned on (TRB = "02") and these values
Note that the LEN1 parameter updated even though the TRB parameter came after it in the input file. Is it because the default was already set to "02"? Let's find out...
After reading in the exact same input file, the LEN1 parameter still updated even though the TRB parameter came after it in the input file. This is good and works as I think it should in Creo2 and Creo3 WITH A PART THAT WAS CREATED IN CREO2. I even saved the Creo2 part in Creo3 and the test results were the same.
Next I created the same simple part in Creo3.
Results look the same as in the Creo2 part, but the LEN1 parameter was only updated because the default for TRB was already "02":
Changing the parameters to this for another trial, just as I did on the Creo2 created part:
After reading in the exact same input file I get a different result! This time the DIA1 parameter updated, I guess because the default value for the TRB was "01" and this time the LEN1 parameter did not update! The rectangle was turned on, but the value driving the feature was the default value of 3.0 instead of 30.0 from the input file.
<sigh>
Hi,
my suggestions:
1.]
In Program, create new simple INPUT section containing list of all input parameters (name+type+prompt), only.
2.]
Move IF-ELSE commands from current INPUT section into Relations.
3.]
Prepare files containing values - follow order from INPUT section.
Using the above method will resolve your problem.
MH
Thanks for the suggestion, but I need the logic around the INPUT section as most of the time Regenerate Enter Select All functionality is used and the users depend on this to know which parameters are needed. Reading from the .txt file only happens 40% of the time.
It's strange that by creating a part in Creo3, the functionality of this is different than creating the exact same simple part in Creo2. In my situation, I have very old parts that only had some features (unrelated to issue) added in Creo3 and the functionality changed.
Preparing files that follow the order of the INPUT section will work, but the files are being exported directly out of Creo and it seems that the order of the parameters comes from the order in which the parameters were created. It will require some extra programming to fix this, but I think it's doable.
Hi,
my last suggestion ... report changed Creo behavior to PTC Support. I give up another testing. Good luck .
MH