Hi,
I have a problem with my macro. The command of projection in 3D doesn't work. My view stay in XZ plane.
robapp.Window.Activate
Set mavueRobot = robapp.Project.ViewMngr.CreateView(1)
mavueRobot.Projection = I_VP_3DXYZ
mavueRobot.Visible = True
mavueRobot.Redraw (True)
I want also make a capture of my model with diagram of results. Have you an example of code for it ?
I would like to get for final result the exemple in attachment.
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
Hi I would like to make a zoom of my picture because I can't anything on my screen capture. I wrote this command but it's not good written. Would you mind correct it ?
mavueRobot.GetZoom(2, 2, 2, 2) = 1
I would like make a zoom of 150%.
It is not that easy because zoom depends on real coordinates and viewport size \ aspect ratio.
Small 2d example below. Left top corner is important and vieport aspect ratio
3d example (left top corner is related to left top corner on ZX plain view) ; additionally you should define rotation point and rotation angle
Hi it did'nt work.
I send you a video which show what I want to do ?
Would you mind send me the command of VBA to write in the macro for it ?
Try this - change zoomfactor:
Set RobApp = New RobotApplication
Dim viewRobot As IRobotView3
Set viewRobot = RobApp.Project.ViewMngr.GetView(1)
viewRobot.Redraw (True)
viewRobot.Projection = I_VP_XY
viewRobot.ParamsFeMap.CurrentResult = I_VFMRT_DETAILED_MOMENT_XY
RobApp.Project.ViewMngr.Refresh
Dim l As Double, t As Double, b As Double, r As Double
l = 0
t = 0
b = 0
r = 0
viewRobot.GetZoom l, t, r, b
Dim CenterX As Double
Dim CenterY As Double
Dim VX As Double
Dim VY As Double
CenterX = (l + r) / 2
CenterY = (t + b) / 2
Dim zoomfacfor As Double
zoomfactor = 2
VX = Abs(l - CenterX) / zoomfactor
VY = Abs(t - CenterY) / zoomfactor
viewRobot.SetZoom CenterX + VX, CenterY + VY, CenterX - VX, CenterY - VY
RobApp.Project.ViewMngr.Refresh
It doesn't change anything in the view. Have a look to the video.
mateaus wrote:
It doesn't change anything in the view. Have a look to the video.
viewRobot.SetZoom CenterX + VX, CenterY + VY, CenterX - VX, CenterY - VY
viewRobot.Redraw(True) ' <- I have not used this command, take a look in my code or use ...Redraw(0)
RobApp.Project.ViewMngr.Refresh
http://forums.autodesk.com/t5/Autodesk-Robot-Structural/Zoom-All-via-API/td-p/3221266 ->
.Redraw(1) ~ ZoomAll
I don't understand what does mean left, top, right and bottom for the command getzoom ?
Take a look at my screen shots in message 23 in this thread
I would like to modify the layout. I prefer without the object manager and with the rules.
Can you give me the command ? I think it's with IRobotLayoutId and IRobotViewMngr.
Ruler :
mavueRobot.ParamsDisplay.Set I_VDA_OTHER_RULER, True
robapp.Project.ViewMngr.Refresh
Object Inspector - not possible to open \ close it by API
Ok I would like to activate also with VBA :
Can you give me the VBA command ?
mavueRobot.ParamsDisplay.Set I_VDA_ADVANCED_OFFSETS, True
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SHAPE, True
mavueRobot.ParamsDisplay.Set I_VDA_FE_PANEL_THICKNESSES, True
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_COLORS, True
robapp.Project.ViewMngr.Refresh
I would like to give the name to a screen capture wich is the name of the load :
Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = robapp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)
ScPar.Name = ???
I think it's something with get and from text ?
For example "3 : Equipements"
I have got a problem with the display. The symbol of loads doesn't appear.
The refresh is not done. Have you got an idea ?
mavueRobot.ParamsDisplay.Set I_VDA_ADVANCED_OFFSETS, False 'afficher exentrements mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SHAPE, False 'afficher croquis barres mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SYMBOLS, True 'afficher symboles barres mavueRobot.ParamsDisplay.Set I_VDA_FE_PANEL_THICKNESSES, False 'afficher epaisseur panneaux mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_COLORS, False 'afficher profilés en couleur mavueRobot.ParamsDisplay.Set I_VDA_FE_FE_INTERIOR, False 'interieur element finis mavueRobot.ParamsDisplay.Set I_VDA_FE_CLADDING_INTERIOR, False 'interieur bardages mavueRobot.ParamsDisplay.Set I_VDA_FE_PANEL_INTERIOR, False 'interieur panneaux mavueRobot.ParamsDisplay.Set I_VDA_FE_FINITE_ELEMENTS, False 'afficher elements finis mavueRobot.ParamsDisplay.Set I_VDA_LOADS_VALUES, True 'valeurs charges mavueRobot.ParamsDisplay.Set I_VDA_LOADS_SYMBOLS_UNIFORM_SIZE, True ' mavueRobot.ParamsDisplay.Set 68, True 'symbole charges ponctuelles mavueRobot.ParamsDisplay.Set 69, True 'symbole charges lineaires mavueRobot.ParamsDisplay.Set 70, True 'symbole charges surfaciques For i = 1 To 3 mavueRobot.Selection.Get(I_OT_CASE).FromText (i) ' selecting case mavueRobot.Redraw (0) robapp.Project.ViewMngr.Refresh ecran_capture = "charges" & i Call screen_capture Next i
I have got model from you once. There are no loads in case 1 and 3 so there is nothing to be displayed
Case 2 works fine.
.....
mavueRobot.Visible = True
'mavueRobot.Redraw (True)
mavueRobot.ParamsDisplay.Set I_VDA_OTHER_RULER, False
mavueRobot.ParamsDisplay.Set I_VDA_ADVANCED_OFFSETS, False 'afficher exentrements
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SHAPE, False 'afficher croquis barres
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_SYMBOLS, True 'afficher symboles barres
mavueRobot.ParamsDisplay.Set I_VDA_FE_PANEL_THICKNESSES, False 'afficher epaisseur panneaux
mavueRobot.ParamsDisplay.Set I_VDA_SECTIONS_COLORS, False 'afficher profilés en couleur
mavueRobot.ParamsDisplay.Set I_VDA_FE_FE_INTERIOR, False 'interieur element finis
mavueRobot.ParamsDisplay.Set I_VDA_FE_CLADDING_INTERIOR, False 'interieur bardages
mavueRobot.ParamsDisplay.Set I_VDA_FE_PANEL_INTERIOR, False 'interieur panneaux
mavueRobot.ParamsDisplay.Set I_VDA_FE_FINITE_ELEMENTS, False 'afficher elements finis
mavueRobot.ParamsDisplay.Set I_VDA_LOADS_VALUES, True 'valeurs charges
mavueRobot.ParamsDisplay.Set I_VDA_LOADS_SYMBOLS_UNIFORM_SIZE, True '
mavueRobot.ParamsDisplay.Set I_VDA_LOADS_SYMBOLS_CONCENTRATED, True
mavueRobot.ParamsDisplay.Set I_VDA_LOADS_SYMBOLS_LINEAR, True
mavueRobot.ParamsDisplay.Set I_VDA_LOADS_SYMBOLS_PLANAR, True
RobApp.Project.ViewMngr.Refresh
' making screen capture
Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = RobApp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)
For i = 1 To 3
mavueRobot.Selection.Get(I_OT_CASE).FromText (i) ' selecting case
mavueRobot.Redraw (0)
RobApp.Project.ViewMngr.Refresh
ScPar.Name = "My screen capture" + Str(i)
ScPar.UpdateType = I_SCUT_UPDATED_UPON_PRINTING
mavueRobot.MakeScreenCapture ScPar
Next i
Can't find what you're looking for? Ask the community or share your knowledge.