[Plugin] export_selection.rb
-
export_selection.rb
Usage:
export_selection(type)
Exports everything in the selection, the argument 'type' sets the file type...
Faces with unselected Edges take those Edges with them...
e.g.export_selection('obj')
-
Thanks for this wonderful plugin............
-
Hi - can anyone help me understand how to use this tool? I really need to be able to export an skp selection to dwg.
Thanks. -
As the download page says [with a little expansion]...
Usage: export_selection(type)
Exports everything in the selection, the argument 'type' sets the file type...
Faces with unselected Edges take those Edges with them...You select what you want to export, then type in the Ruby Console:
export_selection(type)
or
export_selection type
[either will work]
Wheretype
is the 'file-extension-type' for the exported file,
e.g.'obj'
The 'type' must be inside '' or "" - e.g. 'obj', 'dae' etc...
It will then export the current selection asmodelfolder+"/"+modeltitle+"_Part_."+type
.
The type of file-extension you give sets which exporter will be used.
If an exported file-type can have 'Options' it will use the last used Options set for that file-type; so preset those beforehand - e.g. 'units'='meters', 'triangulation'='yes' etc. -
Hi,
is it possible, that your tool does not work on layers consisting only of lines (no faces)?
By the way, thanks a lot for your work! -
It depends what you are exporting.
It uses the current 3d exporter's Options.
Set those from each 3d exporter's dialog.
You must of course have these Edges selected [or at least their faces as they rely on their edges]...
BUT if some element like Edges are set NOT to be included in the exported geometry, then they are not included... -
Thank's,
think I'll concentrate on these exportation options.fjs
-
Hi,
I did it and it works just fine! Thank you very much!
As I understand it, your tool sends the whole geometry with some layers off!?
I exported my selections to ... 'dwg' and the result was still 74 MB (original file ~ 81 MB). Is there a way to just send the actual selection, without having to delete all the rest (over and over again)? -
Hi TIG,
I've tried the plugin but wasn't able to export to DXF neither DAE.
Do I need to have SU Pro to be able to export something with this plugin ?And just another question...
Let's say I have N groups (or components) in my active selection.
Will the plugin export N files (of the type specified) ?
If not, do you know a plugin that could export all groups or components in a selection as separate DXF files ? The name of each DXF being the name of the group or component that it contains.Anyway thanks for making plugins.
And I'm gonna try this one again (last try did generate a bug splat).Cheers.
-
Some formats - like DXF - are limited to Pro users only...
Look at your File > Export > Filetypes options...The common format 'Collada / DAE' should export OK...
Report back...
-
"Some formats - like DXF - are limited to Pro users only..."
Sounds fair.
"The common format 'Collada / DAE' should export OK..."
Yes i was able to export with 'dae' type.
But it created a file with the 'skp' extension.Thanks for your fast answer.
Regarding the second question, do you know any way I could export all my groups/components in separate files ?
I was thinking at trying "component2layer.rb" + "export_by_layer.rb" but ATM I don't see how to use the 1st one. Waiting for an answer from its author.Thanks again TIG.
Edited :
Using "component2layer.rb" + "export_by_layer.rb" works fine.
But as I don't own a SU Pro licence, I can only export to DAE...
But for those who would like to export each component as a separate file, this is a workaround. -
Did you give your export target a .dae filename - otherwise it'll probably make a .skp ???
-
Hi TIG,
I'm not sure I understand well.
Should the command be something like "export_selection ('dae') output.dae" ?
Because this doesn't work.I'm typing "export_selection ('dae')" but the file it produces is a SKP (2014).
So even renaming it with a DAE extension afterward won't work.One other remark :
everything except the selection is deleted. And the original SKP file seems to be saved that way.
So without working on a copy of the original SKP file, all that was outside of the selection is definitely lost. Hopefully I tested it on a test file and not on a file with important work in it.Tested on SU Make 2015.
Cheers.
-
If you look at the date of the original post this script is 8 years old !
It is rather 'clunky' !!However, I just tried it in v2017 and it works for me - exporting the selection as expected...
The command is
export_selection('dae')
to save the selection as a DAE file, using the last used DAE-export options...
If you put "" around the command etc it'll behave oddly.It does temporarily delete unselected entities, so they are not included in the new file.
But that deletion is undone after the export.
So in your case for some reason it's failing before it completes !There are several other newer exporters available in the PluginStore...
Of course if you use the SketchUp native exporter you can now set its options to include only the selection set anyway - making this old tool somewhat redundant.
-
TIG,
I didn't realized it was such an old plugin.
So sorry if I revived this old post.I typed the command exactly like you did but as you said it probably fails before it completes.
So I think it's important to tell people not to try it on an important scene that cost days of work at first.Anyway it's finally your export_by_layer plugin (probably another old one) that I'm more interested in, because it can export in separate files in just one go. And as far as I know the other export plugins don't have the option to export groups or components in separated files without exporting them one by one.
I have a scene with 330 components that must become 330 DXFs.
And I won't click on each of them, launch an exporter, give each file a name, etc. It would take me a all day!
So I will keep on using export_by_layer (sorry to post that here but I'm not going to revive the other thread too...) until I find another way to perform this task.
If it doesn't work as expected with SU2015, I will use it on an old SU2008 version.Thanks for your efforts, patience and explanations TIG.
All the best.
Advertisement