Skip to main content
24-Ruby III
December 12, 2012
Solved

Pro/PROGRAM - reading input values from file

  • December 12, 2012
  • 2 replies
  • 9942 views

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

Best answer by JodyPescod

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!

2 replies

17-Peridot
December 12, 2012

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

7-Bedrock
December 14, 2012

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!

24-Ruby III
December 16, 2012

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