โ ๏ธ Important | Please update Libfredo to v15.1a for bugfixes associated to SketchUp 2025 and below
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