This addon allows you to export all objects in a Blender file to separate Collada DAE files.
The code is not mine, so I have left the original author - Patrick Jezek - attributed, the guts are based on the Batch Export template from Blender. All I have done is trimmed down a much more capable addon to only do bulk DAE export, and then update it to work for Blender 2.8x.
Sketchup is awesome, importing from CAD to Sketchup can be a pain.
STL files are the most commonly exported file type from parametric CAD (e.g. SolidWorks), unfortunately Sketchup's STL importer is flaky for complex models, so an intermediate step of converting STL to Collada (DAE) is necessary if you want to avoid buying a plugin.
STL files also are normally exported as a single object from CAD programs, so they need to be split by geometry, then saved to separate collada files.
I am aware of two free options for doing this:
- Split by geometry easily (right click on mesh layer at top right, split in connected components), this spits out all the components to separate layers.
- Unfortunately there isn't a method to bulk export all objects after splitting, though someone may have a plugin, or written something for Meshlab Server
- Select the object (click), go into Edit mode (Tab), then press P, then select "By Loose Parts". Go back to object mode (Tab).
- Bulk export all components with this addon
Batch import of the Collada files is then done via TIG's Sketchup addon Import all from folder
Though blender doesn't seem to be able to export separated geometry to a single file, the Collada format can accept it, and Sketchup can import it provided it is all in the same scene.
Method likely will be:
- Export each object to temp collada file
- Extract text between geometry tags
- Extract text between node tags
- Insert into a merged file
As a proof of concept I mashed together a powershell script to extract geometry & node information from each Collada file in a folder and put them into a single collada xml. You can see the inputs and outputs (test file with some primitives), screenshot below.
Note, that the PS script isn't quite right yet - I manually edited it based on the guidance here It now imports to Sketchup fine (thanks Andy Maloney!) which still does not recognise the names.
If you're new to Blender, download the .py addon file, then to install go to Edit, Preferences
Click install, then select the file. Click the checkbox to enable it.
The toolbar (UI) is hidden by default so click here to expand it
Collada exporter will show up down the bottom of the tool bars, save the blender file and select your export folder before clicking export.