cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting Dimension from Creo model

Re: Extracting Dimension from Creo model

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