Skip to main content
7-Bedrock
December 14, 2022
Question

API to get dimensions from stp file AP242

  • December 14, 2022
  • 1 reply
  • 2228 views

Hello Support team

I have created dimensions in creo for a prt and successfully exported step files using AP242 protocol and I able to see dimension both in creo file and step file (refer dimensions.jpg)

I want to read dimension from creo and stp file and below is the logic and apis used to get dimensions from creo

I have used "ProSolidDimensionVisit" API to get the dimensions .
This API give callback to 'test_DimVisitAction' callback function whenever any dimension is found in the model.

test_DimVisitAction - A self written callback function,
whenever we get a dimension this callback function gets called. API's used inside this functions are
ProAnnotationIsShown
ProDimensionSymbolGet
ProDimensionValueGet
ProDimensionTypeGet

Note:


Could you please let me know does the API 'ProSolidDimensionVisit' gives the dimension for step file If not
If not then could please let me know which API I should use to get dimension for both Creo and Step files.

1 reply

15-Moonstone
December 15, 2022

I think there is no API for step models. Step is ISO standard textual format.

What you can do is to export AP242 with annotations and create som step parser and pair step annotation with specified dimension in creo model.

But I do not know what would you pair annotation based on. You will have to learn how is step structured. 

psarode7-BedrockAuthor
7-Bedrock
December 27, 2022

Okay seems like their's no option ti do this without having develop our own parser. 

Thanks @sjuraj