Showing results for 
Search instead for 
Do you mean 
Reply

Finding FE Nodes based on Points!

Hi everybody!

 

I have a script that creates groups and and FE nodes to the created groups based on tags I have give in the property menu. The two subfunctions look like this:

 

    Function CycleGeomObjsNCreateGroups(ByVal workCaePart As CAE.CaePart, ByVal RESULTGROUP As String, ByVal logFile As StreamWriter) As CAE.CaeGroup

        Dim caeGroup As CAE.CaeGroup = Nothing
        Dim objTag As Tag
        Dim NULLTAG As Tag = NXOpen.Tag.Null
        theUFSession.Obj.CycleObjsInPart(workCaePart.Tag, NXOpen.UF.UFConstants.UF_caegeom_type, objTag)

            Do While objTag <> NULLTAG
                Dim nxObj As NXObject = NXOpen.Utilities.NXObjectManager.Get(objTag)
                Dim objType As Integer = 0
                Dim objSubType As Integer = 0
                theUFSession.Obj.AskTypeAndSubtype(objTag, objType, objSubType)
                If nxObj.Name = RESULTGROUP Then
                    CaeGroup = CreateCaeGroups(workCaePart, nxObj, objTag, nxObj.Name, logFile)
                End If
                theUFSession.Obj.CycleObjsInPart(workCaePart.Tag, NXOpen.UF.UFConstants.UF_caegeom_type, objTag)
            Loop
                logFile.WriteLine(vbNewLine & "New CAE groups created successfully" & vbNewLine)
				logFile.flush
                GroupAddFeEntities(workCaePart, logFile)
        Return caeGroup
    End Function

 

I use this to create groups based on a given tag. Later I add all the FE entities.

 

    Sub GroupAddFeEntities(ByVal workCaePart As CAE.CaePart, ByVal logFile As StreamWriter)
        logFile.WriteLine("Adding related FE-Entities to new CAE groups...")

            For Each caeGroup As CAE.CaeGroup In workCaePart.CaeGroups.ToArray
                Dim relatedFeEntities As New ArrayList
                For Each groupEntity As TaggedObject In caeGroup.GetEntities
                    If TypeOf groupEntity Is CAE.CAEEdge Then
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedNodeMethod(CType(groupEntity, CAE.CAEEdge)).GetNodes)
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedElemMethod(CType(groupEntity, CAE.CAEEdge)).GetElements)
                    ElseIf TypeOf groupEntity Is CAE.CAEFace Then
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedNodeMethod(CType(groupEntity, CAE.CAEFace)).GetNodes)
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedElemMethod(CType(groupEntity, CAE.CAEFace)).GetElements)
                    ElseIf TypeOf groupEntity Is CAE.CAEBody Then
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedNodeMethod(CType(groupEntity, CAE.CAEBody)).GetNodes)
                        relatedFeEntities.AddRange(workCaePart.SmartSelectionMgr.CreateRelatedElemMethod(CType(groupEntity, CAE.CAEBody)).GetElements)
                    End If
                Next groupEntity
                caeGroup.AddEntities(relatedFeEntities.ToArray(GetType(TaggedObject)))
            Next caeGroup
    End Sub	

 

 

Now! When I use RBE elements to build a "spyder" I would also like to get the masternode, e.g. based on a tag I have given to a point. Is there any way to do this?!

 

Thank you!