(API) Command VBA Projection Capture of a view

(API) Command VBA Projection Capture of a view

Anonymous
Not applicable
24,129 Views
146 Replies
Message 1 of 147

(API) Command VBA Projection Capture of a view

Anonymous
Not applicable

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.

0 Likes
Accepted solutions (1)
24,130 Views
146 Replies
Replies (146)
Message 101 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Try this with rtd file and if it works fine please send me whole macro + str file

 

Sub robot_donnees()

' ouverture de robot, la session s'appellera robapp
Set Robapp = New RobotApplication

' ce sera une structure de type panneaux
Robapp.Project.New (I_PT_SHELL)
    


Robapp.Project.Open "c:\RG\Fichier structure.rtd"


Robapp.Project.CalcEngine.Calculate ' calculate model


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)


'Vue mise a jour
mavueRobot.Projection = I_VP_3DXYZ
mavueRobot.Redraw (True)
mavueRobot.ParamsDisplay.SymbolSize = 2 'marche uniquement avec ROBOT 2012
Robapp.Project.ViewMngr.Refresh

Robapp.Project.SaveToFormat I_PSF_RTD, "c:\RG\Fichier structure_1.rtd"

MsgBox "QUITTER APPLICATION ROBOT"

Robapp.Quit I_QO_DISCARD_CHANGES  ' Quitter sans sauvegarde


End Sub

 

 



Rafal Gaweda
0 Likes
Message 102 of 147

Anonymous
Not applicable

It's not really a solution to remove line of command in the macro because this macro was working before.

 

Since I have done an update of RSA 2012 it's not working  the command is not working anymore.

 

Maybe it's my computer ?

 

Robapp.Quit I_QO_DISCARD_CHANGES
0 Likes
Message 103 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
 

Maybe it's my computer ?

 

Maybe. That's why I asked for complete macoro \ xls file together with str file.

 



Rafal Gaweda
0 Likes
Message 104 of 147

Anonymous
Not applicable
Sub quit_robot()

Robapp.Quit I_QO_DISCARD_CHANGES  ' Quitter sans sauvegarde

End Sub

 I have made a simple macro which was working before and you don't need the xls file.

0 Likes
Message 105 of 147

Anonymous
Not applicable

Ok I have reinstalled robot without any sp and it works.

0 Likes
Message 106 of 147

Anonymous
Not applicable

Hi Rafal,

 

I'm using the macro above to extract results maps for a loadcombination envelope. Please can you show me how to edit the macro to allow the specification of either top or bottom envelope maps which you would normally select in the box shown in the attached pdf? i.e. most +ve and most -ve results shown as separate maps.

 

Thanks in advance,

 

George Gray

0 Likes
Message 107 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
Dim v As RobotView
Set v = RobApp.Project.ViewMngr.GetView(1)
v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MAX

'for bottom envelope
'v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MIN

v.Redraw 1


Rafal Gaweda
Message 108 of 147

Anonymous
Not applicable

Thanks, much appreciated. Additionally, can you tell me how to specify the active view in Robot rather than a numbered veiw?

 

Thanks.

0 Likes
Message 109 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
RobotWindow.IsActive ?
v.Title ?
view numbers
I do not see more options.


Rafal Gaweda
Message 110 of 147

Anonymous
Not applicable

Thanks, think I'll stick with a user specified view number in that case. Hopefully this should be the final question, I have a situation where the view scale is being refreshed and altered when using:

 

RView.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MAX
RobApp.Project.ViewMngr.Refresh
RView.Redraw View

 

Where "View" is representing the viewport number in Robot.

 

It looks like Redraw is influencing the zoom of my viewport. Do you know of a way to switch maps and envelopes, then refresh the viewport to show the new map and envelope whilst leaving the zoom unaffected?

 

Thanks in advance.

0 Likes
Message 111 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
Dim v As RobotView
Set v = RobApp.Project.ViewMngr.GetView(1)

Dim l As Double, t As Double, b As Double, r As Double
l = 0
t = 0
b = 0
r = 0

v.GetZoom l, t, r, b v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MAX 'for bottom envelope 'v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MIN v.Redraw 1 v.SetZoom l, t, r, b RobApp.Project.ViewMngr.Refresh


Rafal Gaweda
0 Likes
Message 112 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

or

 

Dim v As RobotView
Set v = RobApp.Project.ViewMngr.GetView(1)
v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MAX
'for bottom envelope 'v.SetVisibilityStatus I_VVST_ENVELOPES, I_VVSV_ENVELOPES_MIN
RobApp.Project.ViewMngr.Refresh


Rafal Gaweda
0 Likes
Message 113 of 147

Anonymous
Not applicable

Rafal,

 

Another interesting point. Can you explain where the attached results map options can be found - Complex - Tensile Reinforcement (N>0) and Complex - Compressive Reinforcement? It looks like they are missing from the list of items under .currentresult. Also looks like they're missing in the Robot 2014 API guide.

 

Thanks in advance,

 

George

0 Likes
Message 114 of 147

Anonymous
Not applicable

Rafal,

 

Another interesting point. Can you explain where the attached results map options can be found - Complex - Tensile Reinforcement (N>0) and Complex - Compressive Reinforcement? It looks like they are missing from the list of items under .currentresult. Also looks like they're missing in the Robot 2014 API guide.

 

Thanks in advance,

 

George

0 Likes
Message 115 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Not possible = not implemented in API



Rafal Gaweda
0 Likes
Message 116 of 147

Anonymous
Not applicable

Oh dear... Wish I'd known that yesterday! Thanks for your response. Is this available in Robot 2015? (I'm currently using 2014). If not, can it be made available in the future?

 

Regards,

 

George

0 Likes
Message 117 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
Message 118 of 147

Anonymous
Not applicable

Hi Rafal,

 

Request added, thanks for your help. Can you show me how to return the zoom properties of a particular viewport in VBA? I wish to assign them to a variable to be edited in vba and then returned to Robot using .SetZoom.

 

Set RobotMapView = RobApp.Project.ViewMngr.GetView(1)

With RobotMapView

.GetZoom

End With

 

Thanks in advance,

 

George.

0 Likes
Message 119 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
?????????

Everything in post 111, I hope.
If not explain.


Rafal Gaweda
0 Likes
Message 120 of 147

Anonymous
Not applicable

Thanks for your previous response.

 

Is there a way to access the results map scale normalize button using API? I have a problem when capturing sets of maps consecutively using the screen capture macro from earlier in this post (I've added a loop to run through a series of maps) where the scale often fails to update resulting in white/blank patches on the maps. This seems to be fixed by refreshing/normalizing the map scale but I need a way to do this from API as the macro runs. I've attached an example of the problem.

 

Any ideas on how to address this?

 

Thanks.

 

 

0 Likes