Community
Hi,
Is it possible to select all bars longer than 1,5m?
I saw examples to select by section using "CreateByLabel(I_OT_BAR, but there isn't I_LT_BAR_LENGTH,>1.5)"
I would be grateful for any hint.
Solved! Go to Solution.
Solved by Stephane.kapetanovic. Go to Solution.
hi @kambed91
Sub SelectAllBarsWithLengthGreaterThan()
L = 1.5
Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
With RobApp
If Not (.Visible = -1 And .Project.IsActive = -1) Then
MsgBox "Open Robot and open a model", vbCritical, "Robot Error"
Set RobApp = Nothing: Exit Sub
End If
Dim BarCol As RobotBarCollection, BarSel As RobotSelection
With .Project.Structure
Set BarCol = .Bars.GetAll
Set BarSel = .Selections.Get(I_OT_BAR)
End With
End With
For i = 1 To BarCol.Count
With BarCol.Get(i)
If .Length > L Then Txt = Txt & " " & .Number
End With
Next i
BarSel.FromText Txt
Set RobApp = Nothing
End Sub
Best Regards
Can't find what you're looking for? Ask the community or share your knowledge.