NXOpen Find Feature in by Name
NXOpen Find Feature in by Name
(OP)
Dear Forum,
Is there an easy way to find a feature by name.
I found this in the solution center for finding a line:
Public Function getLineByFeatureName(ByVal theName As String) As Line
Dim aTag As Tag = Tag.Null
Do
theUFSession.Obj.CycleByNameAndType(workPart.Tag, theName,
UFConstants.UF_feature_type, False, aTag)
If aTag.Equals(Tag.Null) Then Exit Do
Dim lineFeature As Features.Feature =
CType(Utilities.NXObjectManager.Get(aTag), Features.Feature)
Return lineFeature.GetEntities()(0)
Loop While True
Return Nothing
End Function
Is there an easy way to find a feature by name.
I found this in the solution center for finding a line:
Public Function getLineByFeatureName(ByVal theName As String) As Line
Dim aTag As Tag = Tag.Null
Do
theUFSession.Obj.CycleByNameAndType(workPart.Tag, theName,
UFConstants.UF_feature_type, False, aTag)
If aTag.Equals(Tag.Null) Then Exit Do
Dim lineFeature As Features.Feature =
CType(Utilities.NXObjectManager.Get(aTag), Features.Feature)
Return lineFeature.GetEntities()(0)
Loop While True
Return Nothing
End Function





RE: NXOpen Find Feature in by Name
CODE
for each temp as features.feature in workpart.Features if temp.name = "magic value" then myFeature = temp exit for end if nextwww.nxjournaling.com