(API) Command VBA Projection Capture of a view

(API) Command VBA Projection Capture of a view

Anonymous
Not applicable
23,913 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)
23,914 Views
146 Replies
Replies (146)
Message 2 of 147

Artur.Kosakowski
Autodesk Support
Autodesk Support

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
0 Likes
Message 3 of 147

Anonymous
Not applicable

Ok but it's not working.

 

See my attachment

0 Likes
Message 4 of 147

Artur.Kosakowski
Autodesk Support
Autodesk Support

It seems like you missed the attachment.



Artur Kosakowski
0 Likes
Message 5 of 147

Anonymous
Not applicable

Attachments

0 Likes
Message 6 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

Take a look at attached movie



Rafal Gaweda
Message 7 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

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
0 Likes
Message 8 of 147

Anonymous
Not applicable

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

0 Likes
Message 9 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

@Anonymous wrote:

The excel file has been created 5 years ago, 


No, it was created 09.2001 🙂



Rafal Gaweda
0 Likes
Message 10 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

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 147

Anonymous
Not applicable

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 ?

0 Likes
Message 12 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

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 147

Anonymous
Not applicable

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

0 Likes
Message 14 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

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 147

Anonymous
Not applicable

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 ?

0 Likes
Message 16 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

This command is from ARSA 2012, ROS 12



Rafal Gaweda
0 Likes
Message 17 of 147

Anonymous
Not applicable

I have Autodesk Robot Structural Analysis Professional 2011.

 

Does it work with this software ?

0 Likes
Message 18 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support

You already know it does not.

It is implemented in ARSA 2012, Robot Object Modeler 12



Rafal Gaweda
0 Likes
Message 19 of 147

Anonymous
Not applicable

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

0 Likes
Message 20 of 147

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

it should be there:

 

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

 

 



Rafal Gaweda
0 Likes