[Plugin] export_selection.rb

[Plugin] export_selection.rb

Postby TIG » Fri Sep 11, 2009 2:27 pm

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')

export_selection.rb
0
Last edited by TIG on Mon Oct 08, 2012 12:43 pm, edited 2 times in total.
Reason: Just cleaning up and organizing the Plugin forum.
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin]export_selection.rb

Postby aboagdoed » Sun Sep 13, 2009 3:42 pm

Thanks for this wonderful plugin............ :thumb:
0

aboagdoed 
 

Re: [Plugin] export_selection.rb

Postby mwinkelstein » Tue Apr 26, 2011 12:08 am

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.
0

mwinkelstein 
 

Re: [Plugin] export_selection.rb

Postby TIG » Tue Apr 26, 2011 8:56 am

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]
Where type 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 as modelfolder+"/"+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.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] export_selection.rb

Postby fjsgruppe » Tue Jun 11, 2013 3:39 pm

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!
0

fjsgruppe 
 

Re: [Plugin] export_selection.rb

Postby TIG » Tue Jun 11, 2013 4:29 pm

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... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] export_selection.rb

Postby fjsgruppe » Tue Jun 11, 2013 9:09 pm

Thank's,
think I'll concentrate on these exportation options.

fjs
0

fjsgruppe 
 

Re: [Plugin] export_selection.rb

Postby fjsgruppe » Tue Jun 18, 2013 5:13 pm

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)?
0

fjsgruppe 
 

Re: [Plugin] export_selection.rb

Postby anar » Mon Jul 31, 2017 5:15 pm

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.
0

anar 
 

Re: [Plugin] export_selection.rb

Postby TIG » Mon Jul 31, 2017 5:55 pm

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...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] export_selection.rb

Postby anar » Mon Jul 31, 2017 6:12 pm

"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.
0

anar 
 

Re: [Plugin] export_selection.rb

Postby TIG » Mon Jul 31, 2017 7:58 pm

Did you give your export target a .dae filename - otherwise it'll probably make a .skp ???
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] export_selection.rb

Postby anar » Tue Aug 01, 2017 7:16 am

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.
0

anar 
 

Re: [Plugin] export_selection.rb

Postby TIG » Tue Aug 01, 2017 1:03 pm

@anar

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.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] export_selection.rb

Postby anar » Wed Aug 02, 2017 7:27 am

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.
0

anar 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: coconm and 11 guests

Visit our sponsors: