Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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
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.
Hi You can use
ProSelectionModelitemGet
ProDimensionValueGet.
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.
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
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()
Thanks both Gabriel and Prem,
I will try to test it, thanks a lot!
Regards
Roger.
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.
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
Follow the below steps:
Count the items with your VB Code
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