Importing collada .DAE with multiple geometries (objects)

Hi,
I have an OK workflow at the moment for importing various CAD models into Sketchup, generally it is:

  1. CAD > STL conversion
  2. STL import to Blender
  3. Split components in blender by loose parts
  4. Run various decimation ops, scale it up by 100 or 1000 so detail isn’t lost on import (most of the things I work with are mm size)
  5. Export objects to separate collada files
  6. Use TIG’s Sketchup addon Import all from folder

The process for 3 - 6 is described on my github repo, which includes a script to export separate objects to separate files.

What I have been playing around with is a method to export to a single Collada file, then import that single file into Sketchup.

This might be a dumb idea, but the reason I want to get there is to export a Blender selection (which may contain hundreds of components) to one file, then another selection to another file, import them separately to Sketchup so each file is less than about 100MB. Yes I’m aware I could do it by saving them as separate blend files etc.

Anyway, I have mashed together a proof of concept, which merges DAE objects into one file, but this doesn’t import into Sketchup as separate objects (it imports to Blender OK). My question is, why? Have I got the Collada file format wrong, or is this a quirk of Sketchup’s importer?

Original primitives, screenshots, merged file etc. are all on the github site.

[edit] I have found a solution
https://asmaloney.com/2011/11/code/collada-files-and-sketchup-component-hierarchies/
I will report back…

[edit 2] With thanks to Andy Maloney from 10 years ago, this is working!

I have put the updated .dae example on github if anyone wants to mess with it, now to see if I can figure out python xml to make the DAE single file export a bit more streamlined…

Thanks in advance for any guidance and help. Cheers, Johnny