ScriptSpot

Forum topic · Scripts Wanted

Export group's name to excel (xlsm) or notepad .txt or .doc etc

By Gabriel Corazza · 2014-08-10

Description

I am needing to export only the group name without exporting the names of objects, only the group name on a list to send the client to separate the furniture, lighting etc.
Is it possible?

Comments (6)

barigazy · 2014-08-12

I don't know abouth that limitation because never before print that count. Probabli is some memory problem. This works (1 million lines *.txt file)

fn printAllGroups txtFile =
(
array = for i in 1 to 1e6 collect i as string ; gc light:on
(dotnetclass "System.IO.File").WriteAllLines txtFile array
)
printAllGroups @"c:\temp\numbers.txt"

.

miauu · 2014-08-12

I have to find the script and the exact problem with writealllines.

.

miauu · 2014-08-11

Branko, for some reason(unknown to me) WriteAllLines have one dissadvantage - it can't print more than 80 000 lines. I think that was the correct number, or it is close to the correct.

In the past I created a script that prints about 300 000 lines in a single file. Then I discover that WriteAllLines can't help in such a situation.

barigazy · 2014-08-10

BTW you can choose any file extension (.doc, .txt, xlsm)

;)

barigazy · 2014-08-10

Try this fn. Also change filename path

fn printAllGroups txtFile =
(
helper = for node in helpers where isGroupHead node collect node.name
if helper.count == 0 then messageBox "No Groups in the scene!" title:"INFO" beep:off else
(
(dotnetclass "System.IO.File").WriteAllLines txtFile helper ; free helper
)
)
printAllGroups @"c:\temp\SceneGroups.txt"

OMG

Gabriel Corazza · 2014-08-10

It's Perfect! That was very fast. I'm impressed.
Thank you very much. I can make a donation in return?