Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello to all,
I have a part containing simple program (I am using Pro/PROGRAM functionality). I want to read input values from file. Unfortunatelly I cannot find the description of format for such input file. PTC Help and PTC Knowledge Base didn't help... Do you have some tip or link to PTC source ?
I use Creo Parametric 2.0 M020.
Martin Hanak
Solved! Go to Solution.
Hey Martin
Try this :
I assume you have the Pro/Program part ..... but I'll add it in case anyone else misses this step
In Pro/Program:
INPUT
DESIGNER STRING
ANY_NUMBER NUMBER
END INPUT
DESIGNER is a parameter of STRING type
ANY_NUMBER is a parameter of REAL NUMBER type
In the text file:
DESIGNER = "you"
NUMBER = 22.9
When you regen you get the pop-up that wants to know where the values inside the INPUT statement are coming from.
Select Read File and input the name of the text file
Voila!
Would it help to output a few files and see how they are formatted? Maybe a point file and a relations file?
Hey Martin
Try this :
I assume you have the Pro/Program part ..... but I'll add it in case anyone else misses this step
In Pro/Program:
INPUT
DESIGNER STRING
ANY_NUMBER NUMBER
END INPUT
DESIGNER is a parameter of STRING type
ANY_NUMBER is a parameter of REAL NUMBER type
In the text file:
DESIGNER = "you"
NUMBER = 22.9
When you regen you get the pop-up that wants to know where the values inside the INPUT statement are coming from.
Select Read File and input the name of the text file
Voila!
Hello Jody,
thank you for your answer. Your solution works well in Creo Parametric 2.0 M020+. I wish PTC will add this information into their Help Center...
A little correction for other users:
---
Text file contents:
DESIGNER = "you"
ANY_NUMBER = 22.9
Best regards
Martin Hanak
where do i put the txt file on my system? desktop? my documents?
or can i change the default location for these files?
i'm running creo parametric 3.0 with windchill 11
You can put the TXT file anywhere you want, for example c:\temp\, as long as you provide the full filename (with extension) to the TXT when you are using the "Read File" option.
Hello,
Is it possible to give an Excel file as input file to Pro/Program?
If so please explain how?
Not directly as far as I know.
We have written a small VBA macro in Excel which writes a TXT file to a certain (fixed) location. In Creo, we have created a mapkey which uses that (fixed) location when reading parameters from that input file.