Select specific node by API

Select specific node by API

Anonymous
Not applicable
1,186 Views
4 Replies
Message 1 of 5

Select specific node by API

Anonymous
Not applicable

Hi everyone,

 

In a simple structure I need select a node by API, in order to get the efforts and checking the connection.

This node is the number 57 which is the joint for 14 and 15 beams.

psanchez_0-1602138261760.png

The other nodes are force nodes.

I have a label for code parameters of the beams, and in addition all of the beams in the frame are grouped in a Superbar.

I understand the labels helps to find the bars, but i dont know how get only this specific node for the connection between two bars.

 

Thanks in advance.

 

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
1,187 Views
4 Replies
Replies (4)
Message 2 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

I am not sure if I understood Your task.

My understanding is that this is start or end node of these bars. If not, You have to use Bar.Elements...



Rafal Gaweda
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi @Rafal.Gaweda ,

 

Thanks for your comments.

Yes, this node is the joint between end node of left bar and the start node of right bar.

 

Thanks a lot.

0 Likes
Message 4 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous 

 

?????

Is 57 node phisical start \ end node of these bars?

If yes - use start \ end node

If no - use Bar.Elements...

Something like that

RobotNodeServer RNS = robApp.Project.Structure.Nodes;

for (int k = 1; k <= Bar.Elements.Count; k++)
{
	Int32 CalcStartNode = Bar.Elements.Get(k).StartNode;
	Int32 CalcEndNode = Bar.Elements.Get(k).EndNode;

	RobotNode SN = (RobotNode)RNS.Get(CalcStartNode);
        RobotNode EN = (RobotNode)RNS.Get(CalcEndNode);
.....

}

 

If something different - post Your example model, it will be easier to check what is Your point.

 



Rafal Gaweda
0 Likes
Message 5 of 5

Anonymous
Not applicable

Hi @Rafal.Gaweda ,

 

Finally with your feedback I did it.

it's easier than it seemed, the wanted nodes only have two consecutive bars connected, so with "GetConnectedBars(bar.EndNode)" the issue is resolved:

 

Dim RType As RobotSelection
Set RType = RobApp.Project.Structure.Selections.CreateByLabel(I_OT_BAR, I_LT_MEMBER_TYPE, "MyBar")
Dim AllBars As RobotBarCollection
Set AllBars = RobApp.Project.Structure.Bars.GetMany(RType)
Dim bar As RobotBar
Dim barrTubes As RobotNumbersArray
Dim found As Boolean

For i = 1 To AllBars.Count
  Set bar = AllBars.Get(i)
  Set barrTubes = RobApp.Project.Structure.Nodes.GetConnectedBars(bar.EndNode)
  If barrTubes.Count = 2 Then
  found = True 'FOUND!!!!
'  'save the bars with this node
End If
Next i

 

Thanks for your time!

0 Likes