Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) Get Nodes by Coordinates

2 REPLIES 2
Reply
Message 1 of 3
a54249
407 Views, 2 Replies

(API) Get Nodes by Coordinates

Hi,

 

Is it possible to directly select nodes with the geometry filters shown in the image attached via API? At the moment I'm selecting all the nodes and filtering them in the code but unfortunately when the model has too many nodes it becomes extremely slow.  

a54249_0-1679575780630.png

 

Thanks

 

2 REPLIES 2
Message 2 of 3

hi @a54249 

you can select from nodes of panels and filter by coordinates on this more restricted list.

 

After that, yes, it is possible to do it by API.

 

 

Sub SelectNodesByCoordinatesRanges()
  Dim RobApp As RobotApplication
  Set RobApp = New RobotApplication
  
  Dim NodCol As IRobotCollection, NodSel As RobotSelection
  With RobApp.Project.Structure
    Set NodCol = .Nodes.GetAll
    Set NodSel = .Selections.Get(I_OT_NODE)
  End With
  
  Xmin = Cells(1, 1).Value2: Xmax = Cells(1, 2).Value2
  Ymin = Cells(2, 1).Value2: Ymax = Cells(2, 2).Value2
  Zmin = Cells(3, 1).Value2: Zmax = Cells(3, 2).Value2
  
  For i = 1 To NodCol.Count
    With NodCol.Get(i)
      X = .X: Y = .Y: Z = .Z
      If X > Xmin And X < Xmax Then
        If Y > Ymin And Y < Ymax Then
          If Z > Zmin And Z < Zmax Then
            Txt = Txt & " " & .Number
          End If
        End If
      End If
    End With
  Next
  NodSel.FromText Txt
  Set RobApp = Nothing
End Sub

 

 

Best Regards

 

Message 3 of 3

Upgrade to add nodes of selected objects only in the desired range

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report