
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to modify/edit/update/change few dimensions in certain features and certain sketches of a part.
I can retrieve the name and value of the dimension of the features using the following code
oFeatureDim.Parameter.ModelValue is a Readonly property . How to change ModelValue?
Sub QueryAndShowFeatureDimensions()
Try
Dim oDoc As Document
oDoc = InventorApplication.ActiveDocument
' Get the component definition. This owns the part specific info for the part.
Dim partDef As PartComponentDefinition
partDef = oDoc.ComponentDefinition
Dim partSketches As PlanarSketches
partSketches = partDef.Sketches
'For Each partFeature In oDoc.
' Set a reference to the selected feature.
Dim oFeature As PartFeature
Dim oFeatures As PartFeatures
oFeatures = partDef.Features
Dim oFeatureDim As FeatureDimension
Dim i As Long
Dim j As Long
i = 0
j = 0
' Iterate over all dimensions of the feature.
MessageBox.Show("Number of features in part is >" + oFeatures.Count.ToString + "<")
For Each oFeature In oFeatures
j = j + 1
i = 0
For Each oFeatureDim In oFeature.FeatureDimensions
i = i + 1
MessageBox.Show(" Feature " + CStr(j) + ". Dimension " + CStr(i) + ". Name >" + oFeatureDim.Parameter.Name + "< . Model Value >" + CStr(oFeatureDim.Parameter.ModelValue) + "<")
Next
' Show all the feature dimensions
oFeature.FeatureDimensions.Show()
Next
Catch ex As Exception
MessageBox.Show(ex.Message)
MessageBox.Show(ex.StackTrace)
End Try
End Sub
Solved! Go to Solution.