usnistgov / STP2X3D

Translator from STEP format to X3D format
Other
74 stars 25 forks source link

Model Metadata in X3d #13

Open merco opened 10 months ago

merco commented 10 months ago

It would be possibile to have metadata (GENERAL_PROPERTY) in X3D?

Could STP2X3D generate a separate file output with these information ?

immagine

here the file http://davidemercanti.altervista.org/sources/1M001934.stp

soonjokwon commented 10 months ago

It might be possible to get those information from the STEP file. For now, we do not have plans to officially include the function to export a separate file for those information. Please refer to the source codes related to STEP file import which will give you a hint how to get those information. I'll be happy to answer your follow-up questions.

merco commented 10 months ago

Thank you. I've built source code with VS2019.
However, it is not clear to me which OCC object to use to read the GENERAL_PROPERTY associated with a component. Can you help me with some example links?

soonjokwon commented 10 months ago

Consider using "StepBasic_GeneralProperty". See "STEP_Data.cpp" for traversing STEP instances.

Here's an example of getting id, name, and description of an instance of a general property.

include

... ... Handle(StepBasic_GeneralProperty) gp = Handle(StepBasic_GeneralProperty)::DownCast(entity); string id = gp->Id()->ToCString(); string name = gp->Name()->ToCString(); string desc = gp->Description()->ToCString();

merco commented 10 months ago

Thank you. Ok I can get the names traversing entities... but It is not clear to me how to recover the value of the property and know which instance it is connected to