Hey,
after I spend the day of unsuccessful tries I hope some here does have an idea.
For a mod-project I need a script which exports all selected objects of a scene to a txt.file (with name, pos, rotation)
Each object has it's own line and the file looks like this:
[Tower, x, y, z, rotation]
[Tower, x y, z, rotation]
[Gate, x, y, z, rotation]
etc
This part works, the problem is the next task.
At the end of the file I need new entries, where I have to list in which lines of the txt. file the object appears, like:
[Tower, Line 0, Line 1, Line x],
[Gate, Line 2],
My current approach is to save the names of the objects into an array and loop through the file, looking for the names and then printing the line.
- name_array = #()
- for o in selection do
- (
- prop_name = o.name
- appendifunique name_array prop_name
- )
-
- --open File again to read it
- in_file = openFile out_name mode:"r+"
- for i in name_array do
- (
- ?????
- )
-
- close in_file
I have looked at the filestream reference of the help file, but I don't have the feeling that the commands do what I'm looking for

Replies
Example of output: