Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
π« Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
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

Advertisement