Hi Brandeneurope,
yes i need further help.... i thought i couldt handle this by myselfe - but ..... (its to hard to understand)
the idea is: i have a tube which i changed which ilogic (diameter, radius, material ....)
sometimes i need the "LongPilot", which has also a diameter. If the Name of the LongPilot is "LongPilot:1" or "LongPilot:2" i can change the diameter with:
iFeature.ChangeRow("LongPilot:1", "16 mm")
or
iFeature.ChangeRow("LongPilot:1", "18 mm")
But sometimes the name is, for example like, "LongPilot:5" (delete and stored again) - so i can not identify the Name 😞
I used this code to place the LongPilot in:
Public Sub Main()
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument
Dim oPartDef As PartComponentDefinition
oPartDef = oPartDoc.ComponentDefinition
Dim oWorkPoint As WorkPoint
oWorkPoint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPointFilter, "Select a point to place iFeature")
' Get the selected face to use as input for the iFeature.
Dim oFacePlane As WorkPlane
oFacePlane = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter, "Select a Plane to place iFeature")
Dim oFeatures As PartFeatures
oFeatures = oPartDef.Features
' Create an iFeatureDefinition object.
Dim oiFeatureDef As iFeatureDefinition
oiFeatureDef = oFeatures.iFeatures.CreateiFeatureDefinition("V:\Inventor-2015\1-Inventor\Catalog\KKI\LongPilot.ide")
' Set the input.
Dim oInput As iFeatureInput
For Each oInput In oiFeatureDef.iFeatureInputs
Dim oParamInput As iFeatureParameterInput
Select Case oInput.Name
Case "Durchmesser"
Dim oTubeDia As iFeatureParameterInput
oTubeDia = oInput
oTubeDia.Expression = durchmesser
Case "Skizzierebene1"
Dim oPlaneInput As iFeatureSketchPlaneInput
oPlaneInput = oInput
oPlaneInput.PlaneInput = oFacePlane
Case "Referenzpunkt1"
Dim oRefPoint As iFeatureEntityInput
oRefPoint = oInput
oRefPoint.Entity = oWorkPoint
End Select
Next
' Create the iFeature.
Dim oiFeature As iFeature
oiFeature = oFeatures.iFeatures.Add(oiFeatureDef)
End Sub
Long Story short: If i changed the diameter from the tube all longpilots (max. 2) shouldt change also.... AND i need the amount of the Longpilots (you gave me the code above)
Hopefully you can give me support to handle the problem.... Thank you very much!
Regards
Martin