Re: Export Selected Only DWG Export

General discussion related to SketchUp Pro and Make

Re: Export Selected Only DWG Export

Postby lightbody » Thu Oct 03, 2019 7:56 am

Hi all,

This must have been answered somewhere but I've been kind of searching for years as to whether this is possible...Anyone seen a plug in?

Thanks!

- Rich
0

lightbody 
 

Re: Export Selected Only DWG Export

Postby TIG » Fri Oct 04, 2019 7:06 pm

Select what you want to export from your model.
Invert the selection [there are plugins for this] - or use this snippet in the Ruby Console + <enter>.
Code: Select all
m=Sketchup.active_model
m.start_operation('DWG_ss', true)
 ss = m.selection
 es = m.active_entities
 es.erase_entities(es.to_a - ss.to_a)
 m.definitions.purge_unused
 m.layers.purge_unused
 m.materials.purge_unused
m.commit_operation

Immediately after that run the File > Export > DWG operation [with whatever Options you desire].
Then use the Edit > Undo menu item to step backwards to the point before you erased things.
The exported DWG will be OK, and the model should be back to where you started...
The DWG should not have unused things like blocks, layers etc...
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to SketchUp Pro & Make Discussions

Who is online

Users browsing this forum: No registered users and 8 guests

Visit our sponsors: