Component name
-
I would like to patch this plugin to export the currently selected component as a DXF file with the same name as the selected component. The plugin currently exports the DXF file using the model name. If more then one component is selected, the first component name is OK. Can anyone show me how to add that into the following:
def dxf_export_mesh_file model = Sketchup.active_model model_filename = File.basename(model.path) if( model_filename == "" ) model_filename = "model" end ss = model.selection . . #exported file name out_name = UI.savepanel( file_type+" file location", "." , "#{File.basename(model.path).split(".")[0]}." +file_type ) $mesh_file = File.new( out_name , "w" ) model_name = model_filename.split(".")[0] dxf_header(dxf_option,model_name) . .Thanks
-
### untested path = File.dirname(model.path)+"\\" out_name = model.title + ".dxf" ### as default ss.each{|e| if e.class == Sketchup;;ComponentInstance out_name = e.definition.name + ".dxf" break ### exits after it finds one end#if } out_path = path + out_name ### etc ### model.export(out_path,false)... ??? -
Thanks, I will see if I can make the plugin work

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement