How to get transform of sub-assembly and transform of components w.r.t. sub-assembly

Hi,

I'm playing around with outputting a Collada file from SolidWorks, based off the excellent macro someone wrote to export out .OBJ files. First I took that work and translated it into C#, then I optimised it a bit. For my next step I added out the ability to export out Collada files. I've managed to do this, with the probable exception of textures.

One nice thing about the Collada file is that you can build everything up into a tree of sub-assemblies, and you can use the transform from SolidWorks to move things around. Rather than calculating the points yourself, you can have whatever program you use calculate them for you. However, when I get the transforms, they only seem to output with respect to the root component. Instead I would like the transforms for each of the sub-assemblies and then the transforms of sub-components of these sub-assemblies to give the transforms with respect only to the sub-assembly they belong in. If I need to later on, I can work out the sub-component transform with a matrix multiplication.

Does anyone know an easy way to get these transforms? Looking through the API, all it says is that transforms are set with respect to the root component, and I can't see any way to get this information. The forum posts I've seen are concerned with going in the opposite direction, or what to do if you want to do a transformation with respect to the root component.

Thanks,

Daniel

SolidworksApi macros