I am trying to retreive a set of nodes from a connection region using the API method GetEntities.
I have been able to retreive a set of elements and surfaces, but it seems when I use FT_NODE as an entity type the Sortset returned does not appear to contain anything. Using the .next() method returns 0, but when I use FT_ELEM .next() returns a valid integer.
Is FT_NODE a valid specifier?
Sub Main Dim App As femap.model Set App = feFemap() Dim Conn As femap.Connection Set Conn = App.feConnection Dim ConnectorSet As femap.Set Set ConnectorSet=App.feSet() Dim Reg As femap.ConnectionRegion Set Reg = App.feConnectionRegion Dim n As femap.Node Set n = App.feNode Dim NodeSet1 As femap.Set Set NodeSet1 = App.feSet() Dim s As femap.SortSet Set s = App.feSort Dim ConnectionID As Long Dim NodeID As Long ' Get connectors rc = ConnectorSet.Select(FT_CONNECTION,True,"Select connections") ConnectionID =ConnectorSet.First() rc = Conn.Get(ConnectionID) Reg.Get(Conn.vcontact(0)) Set s = Reg.GetEntities( FT_NODE, True ) ' Load node ID from sortset While s.Next() <> FE_FAIL rc =NodeSet1.Add( s.nInt1 ) Wend End Sub
Solved! Go to Solution.
Your code work if you create connection regions defined by nodes. In this case doesn't work when you change FT_NODE to FT_SURFACE in code.