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
8162 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 2 of 146
Artur.Kosakowski
in reply to: mateaus

Seems like one line is missing:

 

mavueRobot.Projection = I_VP_3DXYZ

robapp.Project.ViewMngr.Refresh

mavueRobot.Visible = True

 

If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.



Artur Kosakowski
Message 3 of 146
mateaus
in reply to: mateaus

Ok but it's not working.

 

See my attachment

Message 4 of 146
Artur.Kosakowski
in reply to: mateaus

It seems like you missed the attachment.



Artur Kosakowski
Message 5 of 146
mateaus
in reply to: Artur.Kosakowski

Attachments

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

Hi

 

Take a look at attached movie



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

Hi

 

It seems it is related to your computer graphics card (and maybe also 64 bit Robot). 

On one of our computers I have the same bahavior.Switching between views (several times), refreshing them manualy etc refreshes view on this viewport.



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

The excel file has been created 5 years ago, I don't think this is a problem related to 64 bit Robot.

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


@mateaus wrote:

The excel file has been created 5 years ago, 


No, it was created 09.2001 🙂



Rafal Gaweda
Message 10 of 146
Rafal.Gaweda
in reply to: Rafal.Gaweda

Update to "your" macro to set map display on view and to make screen capture

Read comments in code below

 

 

 

Public Sub CreeVueRM()
' définition d'une vue

robapp.Interactive = True
robapp.Visible = True
robapp.Window.Activate


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) ' it seems CreateView makes this strange affect, use GetView instead

mavueRobot.Selection.Get(I_OT_CASE).FromText ("3") ' selecting case for results display
mavueRobot.Redraw (True)

mavueRobot.Projection = I_VP_3DXYZ

' displaying map
mavueRobot.ParamsFeMap.CurrentResult = I_VFMRT_GLOBAL_DISPLACEMENT_Z

mavueRobot.Visible = True
mavueRobot.Redraw (True)

robapp.Project.ViewMngr.Refresh

' making screen capture
Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = robapp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)

ScPar.Name = "My screen capture"
ScPar.UpdateType = I_SCUT_UPDATED_UPON_PRINTING
mavueRobot.MakeScreenCapture ScPar

 

robapp.Project.PrintEngine.SaveReportToOrganizer


End Sub



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

Ok thanks a lot,

 

I would like lo have only the screen capture in a file like .jpeg.

 

In Robot, I can only make a world file and the picture is in a bad quality.

 

Can we save the capture in a better quality.

 

I would like to make a macro saving many capture in C:Autodesk.

 

Is it possible ?

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

yes it is possible :

 

 

 to create png screen capture with highest reolution

 

ScPar.UpdateType = I_SCUT_CURRENT_VIEW
ScPar.Resolution = I_VSCR_4096

 

then you have to export printout to word or save as rtf

 

or copy directly screen shot to clipboard

 

ScPar.UpdateType = I_SCUT_COPY_TO_CLIPBOARD
ScPar.Resolution = I_VSCR_4096

 

then paste clipboard contents in Word



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

Ok but I would like the macro export herself the printout in a folder like C:Autodesk/output.

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

Dim ScPar As RobotViewScreenCaptureParams
Set ScPar = robapp.CmpntFactory.Create(I_CT_VIEW_SCREEN_CAPTURE_PARAMS)

 

ScPar.Name = "My screen capture"
ScPar.UpdateType = I_SCUT_CURRENT_VIEW
ScPar.Resolution = I_VSCR_4096
mavueRobot.MakeScreenCapture ScPar

 

robapp.Project.PrintEngine.AddScToReport "My screen capture"

robapp.Project.PrintEngine.SaveReportToOrganizer

 

' saving printout \ report to file

robapp.Project.PrintEngine.SaveReportToFile "c:\Autodesk\output\rr.rtf", I_OFF_RTF_JPEG

 

'or directly opening printout in Word

robapp.Project.PrintEngine.ExternalPreviewReport EPF_MS_OFFICE

 



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

Ok thank you. There is just one command who don't work.

 

ScPar.Resolution = I_VSCR_4096

 

I didn't find it in the ROS manual V9.0.

 

Is there a mistake or is it no more available ?

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

Hi

 

This command is from ARSA 2012, ROS 12



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

I have Autodesk Robot Structural Analysis Professional 2011.

 

Does it work with this software ?

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

You already know it does not.

It is implemented in ARSA 2012, Robot Object Modeler 12



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

I only find the manual of ROS V9. Do you have the manual of ROS V11 ?

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

it should be there:

 

"C:\Program Files\Common Files\Autodesk Shared\Structural\Help\2011\robotom.pdf" 

 

 



Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report