cancel
Showing results for 
Search instead for 
Did you mean: 

readFile problem with Plant Simulation 13.1

Legend
Legend

Hello everyone,

 

I'm having trouble using the method readFile to import an .obj-file to a TableFile. The imported table looks corrupted like it has imported encrypted data. If I use the ribbon button Import, it works as it should.

 

See the simple attached model which exports an obj-file with the command writeObjectFile and then imports it again using readFile. Also try importing the created obj-file with Import to see the difference.

9 REPLIES

Re: readFile problem with Plant Simulation 13.1

Phenom
Phenom
the counterpart of writeObjectFile is readObjectFileAs --> see help
The obj-files you can only import into the class library (as classes).

I guess you need to write your Data with <table>.writeFile --> see help, than you can read them with readFile

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net


Re: readFile problem with Plant Simulation 13.1

Legend
Legend

As I've understood it in the help files, writeFile only saves data in a .txt format no matter the ending of the file. You can open it and view the contents of these files with notepad. This also means that using writeFile to save, and readFile to load, the format of the table isn't preserved.

 

I want to save the table as an object file in order to also save the formatting. This works when changing to object file while pressing the Export button and importing with the Import button.

 

In the help files, readFile is explained to be used to import text files, but the examples shows it being used on a .obj file as well.

Re: readFile problem with Plant Simulation 13.1

Siemens Phenom Siemens Phenom
Siemens Phenom
Hello verbalins,
readFile can indeed read files written with writeFile as well as with writeObjectFile. We will improve the documentation here.
Regards,

Ralf

Re: readFile problem with Plant Simulation 13.1

Legend
Legend

Thank you Ralf!

 

Any help with the issue of importing object files of tables using readFile? It doesn't seem to work for me in the same way that using the Import button on the ribbon bar does.

Re: readFile problem with Plant Simulation 13.1

Siemens Phenom Siemens Phenom
Siemens Phenom
That's strange. writeObjectFile followed by readFile should do exactly the same as the ribbon commands export object and then Import.
Regards,

Ralf

Re: readFile problem with Plant Simulation 13.1

Legend
Legend
Yes, and I'm quite sure that's how it worked before 13.1. Did something change there?

Re: readFile problem with Plant Simulation 13.1

Legend
Legend

I also want to add that when using writeXMLFile, the contents of the ColumnIndex isn't saved. For the RowIndex it properly saves Cell data as sub-elements, but the ColumnIndex is always an empty element.

Re: readFile problem with Plant Simulation 13.1

Siemens Phenom Siemens Phenom
Siemens Phenom
You're right, it doesn't work in 13.1. We will fix this in the next maintenance pack.
Regards,

Ralf

Re: readFile problem with Plant Simulation 13.1

Legend
Legend
Thank you Ralf, looking forwards to it!