How to rename original part name during conversion?

I’m using Hoops exchange to convert SolidWorks file to glb file and I need to rename the original part name with a new one. How can I achieve this during the conversion?

Thank you!

Hi @khaled!

If you simply need the converted .glb file to have a new name, you can set this with the A3DExport class as discussed here: 5. File-to-File Translation — HOOPS Exchange 2023 Documentation

You can also try this functionality using the ImportExport sample code included in the Exchange package (Sample Code — HOOPS Exchange 2023 Documentation)

If you need to actually change the name of the original Solidworks input file, you can do this outside of the HOOPS Exchange SDK by using the std::filesystem library and the rename or copy functions. However, I’d advise against renaming the source file outside of the source context because it can result in broken assemblies (renaming the source file can break the link between assemblies and parts).

Let me know if this helps or if I’ve misunderstood your question.



@khaled do you mean the filename? Or are you referring to the name attached to a node inside the model? Exchange has APIs to allow you to modify names on nodes in a model. However, you’d have to test to see what names are preserved in the GLB file when exported.