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

Pro/PROGRAM - reading input values from file

SOLVED
Highlighted
Emerald III

Pro/PROGRAM - reading input values from file

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


Martin Hanák
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Pro/PROGRAM - reading input values from 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!

5 REPLIES 5

Re: Pro/PROGRAM - reading input values from file

Would it help to output a few files and see how they are formatted? Maybe a point file and a relations file?

Re: Pro/PROGRAM - reading input values from 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!

Re: Pro/PROGRAM - reading input values from file

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


Martin Hanák

Re: Pro/PROGRAM - reading input values from file

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

Re: Pro/PROGRAM - reading input values from file

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.