hi @LionelDallenne
Public ViewMngr As IRobotViewMngr
Sub Show_SectionsColor_LoadsCase10_on_ActiveView()
Dim Robapp As IRobotApplication: Set Robapp = New RobotApplication
If Robapp.Visible <> -1 Then ' Open Robot and a project
Set Robapp = Nothing: Exit Sub
End If
Set ViewMngr = Robapp.Project.ViewMngr
Dim ActiveView As RobotView: Set ActiveView = ViewMngr.GetView(ActiveViewNumber)
'Possible to Limit/Add display attributes in the list below
DisplayAttributes = Array(I_VDA_LOADS_VALUES, I_VDA_LOADS_SYMBOLS_CONCENTRATED, I_VDA_LOADS_SYMBOLS_LINEAR, _
I_VDA_SECTIONS_COLORS, I_VDA_SECTIONS_SHAPE)
Dim ParamsDisplay As RobotViewDisplayParams: Set ParamsDisplay = ActiveView.ParamsDisplay
For Each attr In DisplayAttributes: ParamsDisplay.Set attr, True: Next
ActiveView.Selection.Get(IRobotObjectType.I_OT_CASE).FromText "10"
Set Robapp = Nothing
End Sub
Function ActiveViewNumber()
For i = 1 To ViewMngr.ViewCount
If ViewMngr.GetView(i).Window.IsActive <> 0 Then
ActiveViewNumber = i: Exit Function
End If
Next i
ActiveViewNumber = 1
End Function
Best regards
Stéphane Kapetanovic
Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
