(API) Command VBA Projection Capture of a view

(API) Command VBA Projection Capture of a view

Anonymous
適用対象外
24,595件の閲覧回数
146件の返信
メッセージ1/147

(API) Command VBA Projection Capture of a view

Anonymous
適用対象外

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 件のいいね
解決済み
24,596件の閲覧回数
146件の返信
返信 (146)
メッセージ2/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 件のいいね
メッセージ3/147

Anonymous
適用対象外

Ok but it's not working.

 

See my attachment

0 件のいいね
メッセージ4/147

Artur.Kosakowski
Autodesk Support
Autodesk Support

It seems like you missed the attachment.



Artur Kosakowski
0 件のいいね
メッセージ5/147

Anonymous
適用対象外

Attachments

0 件のいいね
メッセージ6/147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

Take a look at attached movie



Rafal Gaweda
メッセージ7/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 件のいいね
メッセージ8/147

Anonymous
適用対象外

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

0 件のいいね
メッセージ9/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 件のいいね
メッセージ10/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
メッセージ11/147

Anonymous
適用対象外

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 件のいいね
メッセージ12/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
メッセージ13/147

Anonymous
適用対象外

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

0 件のいいね
メッセージ14/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
メッセージ15/147

Anonymous
適用対象外

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 件のいいね
メッセージ16/147

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi

 

This command is from ARSA 2012, ROS 12



Rafal Gaweda
0 件のいいね
メッセージ17/147

Anonymous
適用対象外

I have Autodesk Robot Structural Analysis Professional 2011.

 

Does it work with this software ?

0 件のいいね
メッセージ18/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 件のいいね
メッセージ19/147

Anonymous
適用対象外

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

0 件のいいね
メッセージ20/147

Rafal.Gaweda
Autodesk Support
Autodesk Support
解決済み

it should be there:

 

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

 

 



Rafal Gaweda
0 件のいいね