Skip to main content
1-Visitor
April 15, 2016
Question

Extracting Dimension from Creo model

  • April 15, 2016
  • 10 replies
  • 8845 views

Hi all,

     I need to get the list of dimension used in the Creo model with reference to specific surface. For example, I have hole feature and i need to get all the dimension with reference to the hole.

Kindly suggest me

10 replies

1-Visitor
May 24, 2016

Hi Man.

I have the same problem, and want to find a easy to extract dimension from model.

Have got the the solutions? could you share it to me if you got it?

Thank you very much!

Regards.

Roger.

1-Visitor
May 24, 2016

Hi You can use

ProSelectionModelitemGet

ProDimensionValueGet.

1-Visitor
May 25, 2016

Hi brother,

Thank you so much! Is this function based on toolkit? Can we use it based on vb api? Can you give me a example?

Thanks a lot~

Regards,

Roger.

1-Visitor
May 25, 2016

Hi Roger:

Both functions are based on toolkit. I am not sure about VB. Try this code:

ProError err;

double value = 0.0;

ProSelection *sel;

ProDimension dim;

err = ProSelectionModelitemGet (sel[0], &dim);

err = ProDimensionValueGet (dim, &value);

Try this. I think this should do. Let me know how this goes

Regards

Prem

14-Alexandrite
May 25, 2016

For Toolkit you can use ProSolidDimensionVisit to get the dimension from the entire model or ProFeatureDimensionVisit to get the dimension of a specific feature.

For VB API you can try IpfcModelItemOwner.ListItems() or IpfcFeature.ListSubItems(). Check the "Getting ModelItem Objects" section on the user guide.

Those two methods will give you a list of dimension objects(model items). From here you can use the IpfcBaseParameter and IpfcBaseDimension methods to get the informations you need.

The <Creo Load point>\vbapi\vbapi_examples\pfcRelationsExamples.vb file has an example of getting dimension list by using IpfcFeature.ListSubItems()

1-Visitor
May 26, 2016

Thanks both Gabriel and Prem,

I will try to test it, thanks a lot!

Regards

Roger.


1-Visitor
May 29, 2016

Hello,

Let understand background....API's provided in toolkit or vb are to get the dimensions of the feature created.You can not get dimension on fly w.r.t to one modelitem to other item. But where as in drawing it is very much possible if you can get valid objects to create drawing dimensions in a view.In model you can measure distance between two objects as it has creo features....similary explore API are support on this.

1-Visitor
May 10, 2017

Hi Guys,

I want count the current opened drawing attributes list count using VB.net. I have experience in vb.net/api, little bit experience in creo api.

Drawing Attributes:

1. Dimension

2. Note

3. Geom tol

4. 2D datum/axis

5. 2D sketched entity

6. Reference dim

7. Surface finish

8. 2D symbol

The above list count to be taken using vb.net. I have analyzed  vbug.pdf and i didn't' get clear idea. I opened the drawing file.

Now i want to go further process.

Can anyone help me.

Thnks

Balaji somasundaram

16-Pearl
July 7, 2017

Follow the below steps:

  1. Connect the Base Session
  2. Get the Current Model as IpfcModel
  3. Cast the IpfcModel as IpfcDrawing
  4. Cast the IpfcDrawing as IpfcModel2d
  5. List out the IpfcModels from IpfcModel2d
  6. Use Every IpfcModel2d as IpfcModelItemOwner
  7. List out the IpfcModelItems
  • Use the IpfcModelType → Here what you need (Dimension, Note, Symbol, etc)
  • Note - you can use Leader Attachment Type

Count the items with your VB Code

1-Visitor
July 7, 2017

Hi,

 

I hope the below code will help you up.

 

Dim model As IpfcModel
Dim solid As IpfcSolid
Dim holes As IpfcFeatures
Dim hole As IpfcFeature
Dim dimensions As IpfcModelItems
Dim dimension As IpfcDimension


model = session.CurrentModel
Solid = CType(model, IpfcSolid)

holes = solid.ListFeaturesByType(True, EpfcFeatureType.EpfcFEATTYPE_HOLE)      " This will give you the whole list of holes present in your model"

For i = 0 To holes.Count -1

hole = holes.Item(i)     "Now it will go through each holes. If you want to check any perticular hole. You can do that by using the Feat-Id of the hole"

dimensions = hole.ListSubItems(EpfcModelItemType.EpfcITEM_DIMENSION)

For j= o to dimensions.Count -1

dimension = dimensions.Item(j)

Next
Next