Hello Dimitrii,
Sorry for my incomplete question. What I actually want to extract is the AXIS2_PLACEMENT_3D entity from STEP file.
Also, after exporting the same file from my opencascade based application, the names of AXIS2_PLACEMENT_3D are lost, is there any way to prevent this?
Best Regards,
Prajwal.
You can get all entities from the STEP file by iterate a model.
Handle(StepData_StepModel) aReadModel = Handle(StepData_StepModel)::DownCast(myReader.WS()->Model());
Standard_Integer i = 1;
for (; i <= aReadModel->NbEntities(); i++)
{
const Handle(Standard_Transient)& anEnt = aReadModel->Value(i);
if (!anEnt->IsKind(STANDARD_TYPE(StepGeom_Axis2Placement3d))
{
continue;
}
// do something
// You can get shared or sharing graph and iterate on it
// You can get all entity's field by class field.
}
Additionally, after export from XBF to STEP model you can iterate on model and change some links and data. And after that, to make write operation to the file.
For more information, please describe your use case.
Thank you so much for the code sample. This is really helpful.
I am able to get the placement axis data by extending above code. Now what I want to do is keep only the required StepGeom_Axis2Placement3d and delete others. For eg. keep axes with names 'PSYS' and delete others. Also can you please share how I can export STEP with these required entities only.
Mon, 11/07/2022 - 20:14
Hello,
Can you provide an example of data?
Best regards, Dmitrii.
Tue, 11/08/2022 - 07:45
Hello Dimitrii,
Sorry for my incomplete question. What I actually want to extract is the AXIS2_PLACEMENT_3D entity from STEP file.
Also, after exporting the same file from my opencascade based application, the names of AXIS2_PLACEMENT_3D are lost, is there any way to prevent this?
Best Regards,
Prajwal.
Tue, 11/08/2022 - 13:03
Hello,
You can get all entities from the STEP file by iterate a model.
Additionally, after export from XBF to STEP model you can iterate on model and change some links and data. And after that, to make write operation to the file.
For more information, please describe your use case.
Best regards, Dmitrii.
Wed, 11/09/2022 - 09:46
Hello Dmitrii,
Thank you so much for the code sample. This is really helpful.
I am able to get the placement axis data by extending above code. Now what I want to do is keep only the required StepGeom_Axis2Placement3d and delete others. For eg. keep axes with names 'PSYS' and delete others. Also can you please share how I can export STEP with these required entities only.
Best Regards,
Prajwal.