Reading text file in python script

Reading text file in python script

hyrro_velasquez
Advocate Advocate
485 Views
2 Replies
Message 1 of 3

Reading text file in python script

hyrro_velasquez
Advocate
Advocate

Hi Ma'am/Sir,

 

Good day,

 

I'm trying to read a string value inside a text file using open() and read() function in my python script, but unfortunately when I'm testing my script using "testacpscript" I'm having the "Geometry can not generate with the given parameter" error, I'm assuming that the open() and read() function does not work on custom python script, but when I try the functions and read a text file on python IDLE, it runs and I can get the value from the text file. I really wonder why. 

 

sample code:

 

structs = open('structureSize.txt','r')

print(structs.read())

 

this code runs in python shell, but when used on custom python script for plant 3D error occurs.

 

hope anyone can give me some information, thank you.

0 Likes
486 Views
2 Replies
Replies (2)
Message 2 of 3

rajendra.prajapat
Advisor
Advisor

@hyrro_velasquez if it is giving error then it is not possible to add plant 3D python script.

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).
0 Likes
Message 3 of 3

h_eger
Mentor
Mentor

this function is not supported by Python scripting for Plant 3D.

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes