Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(API) Command VBA Projection Capture of a view

145 REPLIES 145
SOLVED
Reply
Message 1 of 146
mateaus
8182 Views, 145 Replies

(API) Command VBA Projection Capture of a view

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.

145 REPLIES 145
Message 101 of 146
Rafal.Gaweda
in reply to: mateaus

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
Message 102 of 146
mateaus
in reply to: Rafal.Gaweda

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
Message 103 of 146
Rafal.Gaweda
in reply to: mateaus

 

Maybe it's my computer ?

 

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

 



Rafal Gaweda
Message 104 of 146
mateaus
in reply to: Rafal.Gaweda

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.

Message 105 of 146
mateaus
in reply to: mateaus

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

Message 106 of 146
GGrayAtkins
in reply to: Rafal.Gaweda

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

Message 107 of 146
Rafal.Gaweda
in reply to: GGrayAtkins

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 146
GGrayAtkins
in reply to: Rafal.Gaweda

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

 

Thanks.

Message 109 of 146
Rafal.Gaweda
in reply to: GGrayAtkins

RobotWindow.IsActive ?
v.Title ?
view numbers
I do not see more options.


Rafal Gaweda
Message 110 of 146
GGrayAtkins
in reply to: Rafal.Gaweda

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.

Message 111 of 146
Rafal.Gaweda
in reply to: GGrayAtkins

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
Message 112 of 146
Rafal.Gaweda
in reply to: Rafal.Gaweda

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
Message 113 of 146
GGrayAtkins
in reply to: GGrayAtkins

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

Message 114 of 146
GGrayAtkins
in reply to: GGrayAtkins

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

Message 115 of 146
Rafal.Gaweda
in reply to: GGrayAtkins

Not possible = not implemented in API



Rafal Gaweda
Message 116 of 146
GGrayAtkins
in reply to: Rafal.Gaweda

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

Message 117 of 146
Rafal.Gaweda
in reply to: GGrayAtkins
Message 118 of 146
GGrayAtkins
in reply to: Rafal.Gaweda

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.

Message 119 of 146
Rafal.Gaweda
in reply to: GGrayAtkins

?????????

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


Rafal Gaweda
Message 120 of 146
GGrayAtkins
in reply to: Rafal.Gaweda

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.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report