Message 1 of 16
Get specific nodes and case data in table for printoutcomposition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
We @stefanyC6JZ7 and i are currently working on a VBA script that generates images and screencaptures from tables to use in our reports. Thanks to these topics: topic_1 , topic_2 We already solved quite a few things.
But now we want a table, with a specific case and nodes displayed.
these are the nodes (in case 15) i want to display:
But now we get the full table see image
This is our VBA code we have
' --------------------------------------------------------------
'
' Generation of the parametrized Silo.
'
Public RobApp As RobotApplication
Private Sub CommandButton1_Click()
'***Run Robot application
If RobApp Is Nothing Then
Set RobApp = CreateObject("Robot.Application")
End If
RobApp.Visible = True
RobApp.Interactive = 1
RobApp.UserControl = True
'***Create an empty Shell project if it has not been created yet
If Not RobApp.Project.IsActive Or RobApp.Project.Type <> I_PT_SHELL Then
RobApp.Project.New I_PT_SHELL
End If
'Sub kernel()
'initialisation des valeurs
Call init_value
'permet de regénérer la vue
Call CreeVueRM
'sauvegarde le projet
'robapp.Project.SaveAs newfilepath
'robapp.Project.Close
End Sub
Public Sub CreeVueRM()
' définition d'une vue
RobApp.Interactive = True
RobApp.Visible = True
RobApp.Window.Activate
'------------------
Dim mavueRobot As IRobotView3 ' this is important to set IRobotView3 if you want to make screen capture of this view
Set mavueRobot = RobApp.Project.ViewMngr.GetView(1) ' it seems CreateView makes this strange affect, use Get view instead
Dim SimpleCaseSel As IRobotSelection 'Select Simple cases
Dim ManualCombSel As IRobotSelection 'Select Combination cases
'-----------------------------
mavueRobot.Selection.Get(I_OT_CASE).FromText ("1") ' selecting case for results display
mavueRobot.Redraw (True)
'mavueRobot.Projection = I_VP_3DXYZ
mavueRobot.Projection = I_VP_XZ_3D
mavueRobot.Visible = True
mavueRobot.Redraw (True)
RobApp.Project.ViewMngr.Refresh
'--------------------------------------------
'---------------------CREATE TABLE
mavueRobot.Selection.Get(I_OT_CASE).FromText ("15") ' selecting case for results display SLS
RobApp.Project.ViewMngr.Refresh
Dim Rtable As RobotTable
Dim TScPar As RobotTableScreenCaptureParams
Set TScPar = RobApp.CmpntFactory.Create(I_CT_TABLE_SCREEN_CAPTURE_PARAMS)
TScPar.Name = "Disp_15" 'Screenshot Name
'mavueRobot.Selection.Get(I_OT_CASE).FromText ("15") ' selecting case for results display SLS
'mavueRobot.Selection.Get(I_OT_BAR).FromText ("5")
'mavueRobot.Selection.Get(I_OT_NODE).FromText ("801 to 829") ' selecting case for results display SLS
mavueRobot.Redraw (True)
mavueRobot.Visible = True
mavueRobot.Redraw (True)
RobApp.Project.ViewMngr.Refresh
'TScPar.UpdateType = I_SCUT_CURRENT_VIEW
'TScPar.Resolution = I_VSCR_4096
'-----------------
mavueRobot.ParamsDisplay.Set I_VDA_STRUCTURE_SUPPORT_SYMBOLS, False 'shows the supports
mavueRobot.ParamsDisplay.Set I_VDA_STRUCTURE_NODE_NUMBERS, False 'shows the node numbers
mavueRobot.ParamsDiagram.Set I_VDRT_NTM_MY, False
mavueRobot.ParamsDiagram.Set I_VDRT_NTM_FX, False
mavueRobot.ParamsDiagram.Set I_VDRT_NTM_FZ, False
Set Rtable = RobApp.Project.ViewMngr.CreateTable(I_TT_NODE_DISPLACEMENTS, I_TDT_DISPLACEMENTS)
'Rtable.Select(IRobotSelectionType.I_ST_CASE, "1")
''mavueRobot.Selection.Get().FromText ("15")
'Dim ScPar As RobotViewScreenCaptureParams
'Set ScPar = RobApp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)
'Set Rtable = RobApp.Project.ViewMngr.CreateTable(I_TT_BARS, I_TDT_BAR) ' You can also GetTable
'Rtable.AddColumn 1 - modify tables if you want by adding or removing columns
'mavueRobot.Visible = True
'mavueRobot.Redraw (True)
'RobApp.Project.ViewMngr.Refresh
Rtable.MakeScreenCapture TScPar
RobApp.Project.PrintEngine.SaveReportToOrganizer
End Sub
At line 120 we did try to select the case but it won't, Does anyone have a solution for this?
From my experience i know that @Rafal.Gaweda is quite familiair with this?
Many thanks in advance.