07-23-2018
01:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-23-2018
01:31 PM
Has anyone discovered a method to show all feature dimensions for multiple features? Ideally it would behave similar to the snippet shown below. Currently have my code making the dimensions from sketches available, but unfortunately there are times when the necessary dimension are associated only with the 3D feature.
foreach (PartFeature feature in partdocument.ComponentDefinition.Features)
{
feature.FeatureDimensions.Show();
}
Solved! Go to Solution.
07-25-2018
05:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
07-25-2018
05:40 AM
Well, if you do this manually, you first need to create a selection, and then activate the command to show the dimensions, if you just loop through the feature, only the last looped shows dimensions.
Sub ShowDimensions()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
Set oCompDef = oDoc.ComponentDefinition
Dim oSelectSet As SelectSet
Dim oFeature As PartFeature
For Each oFeature In oCompDef.Features
Call oDoc.SelectSet.Select(oFeature)
Next oFeature
Dim oControlDef As ControlDefinition
Set oControlDef = ThisApplication.CommandManager.ControlDefinitions.Item("PartShowDimensionsCtxCmd")
oControlDef.Execute
End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
please feel free to "kudos"