Export Entity Attributes to DAE file

Is there a way to export Face attributes to dae file?

The COLLADA has an element tag “extra” for this purpose. But I don’t see a way to create it from exporting dae from Sketchup.

I have looked at this post but doesn’t seem to have a solution for it:

But attaching an attribute dictionary named “extra” or “dae” to a SketchUp face within a group, fails to export to the DAE file as any attribute.

I also found “author_attribution” boolean option on the Ruby api. What is this for?

Currently, the export of attribute libraries to IFC, for instance, doesn’t work either.
You should have to make your own exporter.

Thanks for the answer.

Is there a way to export entity id or persistent_id. Or somehow associate the exported triangles to the entities in the model?

What are you trying to do? Why do you need attribute data exported into COLLADA?

I think @jbacus asks the key question. Do you have a destination for the .dae that is able to read that attribute data and do something with it? Lacking that, it would be pointless to export it from SketchUp. And having such, changes to the exporter would have to be targeted to that particular usage, which might be completely ad-hoc to your particular case. If ad-hoc, you will almost surely have to write (or hire someone to write) an exporter just for you.

as it’s xlm format you can modify it after export using a ruby script that read/write the additional information…

an example dae with the required outcome would be needed as a starting point…

john

I have added a custom attribute to some skp faces that marks them as window(or light source) with a unique id(which is the persistent_id in this case).

An external application imports the dae file and needs to have the knowledge that which triangles are windows and what id.

What does that external application look for in the dae file? That is, what XML element(s) and with what values? An exporter would have to target exactly those elements (unless, of course, the external app can be reworked to look for whatever the SketchUp exporter wrote).

Additionally, what advantage do you have in using COLLADA (with BIM like attributes) over a BIM format like IFC?

No advantage other than the importer was available in the project and I didn’t have to write one.

But I guess I need to export it in other formats like IFC?

well collada format actually has specified an element named “extra” for exactly the purpose of writing meta-data but skp doesn’t support it.

Does that mean that the external app already knows what to look for in “extra” or will be rewritten to do so? There’s a difference between having a slot where you can put something arbitrary and having a consumer that knows how to interpret what you put there.

Yes the external app knows what to look for in the “extra” tag.
well the external program can be modified to read the extra tag and interpret it in the way that is required.

What is the app into which you will import your (improved) COLLADA?

it is my own(the company actually) project. a raytracing renderer

In this case, wouldn’t it be enough to edit the material properties?

could you elaborate it a bit more. Do you mean to set a specific material for a set of faces?
That kind of works.

Yes, you can assign a material to a face, then when you export to Collada that material will be preserved. You can choose how you want to interpret material properties in your rendering application. This Help Center article might help with the basics.