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

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

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"

barigazy

miauu's picture

.

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

miauu's picture

.

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's picture

...

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

;)

barigazy

barigazy's picture

...

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"

barigazy

Gabriel Corazza's picture

OMG

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.