Hi,
I would like to do a macro like that but with bars. I'll select some bars in the model and the macro will add the points of selected bar to a listbox. but i'm can't do this. My code is:
Public Sub Pontos_Barras()
Set RobApp = New RobotApplication
Dim Bar As IRobotBar
Dim Sec As RobotBarSection
Dim sectData As IRobotBarSectionData
' With ListBox1
' .Clear
' End With
'#################################################
Dim BarSel As RobotSelection
Set BarSel = RobApp.Project.Structure.Selections.Get(I_OT_BAR)
Dim NodeSel As RobotSelection
Set NodeSel = RobApp.Project.Structure.Selections.Create(I_OT_NODE)
Dim Barras As RobotObjObjectCollection
Set Barras = RobApp.Project.Structure.Objects.GetMany(BarSel)
Dim ListaBarras As String
ListaBarras = ""
Dim Barra As RobotObjObject
Dim PontosBarras As String
PontosBarras = ""
Cells(18, 1) = Barras.Count
Set Barra = Barras.Get(2)
PontosBarras = Barra.Nodes
NodeSel.FromText Barra.Nodes
Cells(19, 1) = NodeSel.Count
' For idx = 1 To Barras.Count
' Set Barra = Barras.Get(idx)
' PontosBarras = Barra.Nodes
' NodeSel.FromText PontosBarras
' Cells(19, 1) = NodeSel.Count
' With ListBox1
' .AddItem "Z= " & PontosBarras & " m"
' End With
' Next idx
Set BarSel = Nothing
Set Obj = Nothing
RobApp.Interactive = True
Set RobApp = Nothing
End Sub
Could you Help me?!