Hi @865966724 . How do you want to ensure consistency across 2 different components? Should it be through the assembly in which these two components reside? Is it necessary to make a connection between the parameters of 2 parts?
This is an example of code that measures the distance between the "XZ Plane" and all HoleFeatures, then picks the one closest to the plane and sets the diameter to 10mm (line 17):
Dim oInvApp As Inventor.Application = ThisApplication
Dim oMT As MeasureTools = oInvApp.MeasureTools
Dim oDoc As PartDocument = oInvApp.ActiveDocument
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oPlane As WorkPlane = oDef.WorkPlanes(2)
Dim oHoles As HoleFeatures = oDef.Features.HoleFeatures
If oHoles.Count = 0 Then Exit Sub
Dim dDistance, dMinDistance As Double
Dim iHole As Integer
For i As Integer = 1 To oHoles.Count
dDistance = oMT.GetMinimumDistance(oPlane, oHoles(i).HoleCenterPoints(1))
If dMinDistance = 0 Or dDistance < dMinDistance Then
dMinDistance = dDistance
iHole = i
End If
Next i
oHoles(iHole).HoleDiameter.Value = 1 'Diameter 10 mm
oDoc.Update()