Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

full screen shot

Status
Not open for further replies.

lapek

Aerospace
Aug 26, 2013
37
MX
hi everyone

I have an issue with a macro

I have this macro that takes screen shoots, but it takes big areas that I don't need,

here is a picture of what im doing,

you will see a square, well what I need to know if its possible to take the screen shot but only the part not all the areas,

thank you for your help
 
Replies continue below

Recommended for you

hi ferdo, thank you so much for your answer here is a segment of the code I am using,

Dim ObjViewer3D As Viewer3D
Set ObjViewer3D = CATIA.ActiveWindow.ActiveViewer
Dim objCamera3D As Camera3D
Set objCamera3D = CATIA.ActiveDocument.Cameras.Item(1)

CATIA.ActiveDocument.Selection.Clear
CATIA.ActiveDocument.Selection.Add (MySurface(o))
'Ubicacion del guardado de la imagen
Dim fileloc As String
fileloc = "C:\Users\Lab3\Desktop\Fotos\"
Dim exten As String
exten = ".jpg"
Dim strName As String
strName = fileloc & CStr(o) & exten

Dim objSpecWindow As SpecsAndGeomWindow
Set objSpecWindow = CATIA.ActiveWindow
objSpecWindow.Layout = catWindowGeomOnly
CATIA.StartCommand ("Compass")

'Toma la Fotografia
ObjViewer3D.FullScreen = True
ObjViewer3D.Viewpoint3D = objCamera3D.Viewpoint3D
ObjViewer3D.CaptureToFile 5, strName

ObjViewer3D.FullScreen = False
objSpecWindow.Layout = catWindowSpecsAndGeom
CATIA.StartCommand ("Compass")
ObjViewer3D.Viewpoint3D = objCamera3D.Viewpoint3D

and yes, I am only using a catpart loaded,

if you can help me with the commands I need to use for the reframe on or the zoom in, I really appreciate it,

thank you for your help
 
Old code quickly modified....

Code:
Language="VBSCRIPT"
Sub CATMain()

''''''''''''''iso view (if you want)
   Dim ActDoc As Document
    Set ActDoc = CATIA.ActiveDocument
    
    Dim camIsoView As Camera3D
    Set camIsoView = ActDoc.Cameras.Item("* iso")
    
    Dim objIsoViewPoint As Viewpoint3D
    Set objIsoViewPoint = camIsoView.Viewpoint3D
        
    ' set desired  viewpoint for active viewer
    Dim ActWin As Window
    Set ActWin = CATIA.ActiveWindow
    
    Dim ActViewer As Viewer3D
    Set ActViewer = ActWin.ActiveViewer
    
    ActViewer.Viewpoint3D = objIsoViewPoint
     
''''''''''''''''''select MainBody 
Dim selection1 As Selection
Set selection1 = ActDoc.Selection

selection1.Search "Name=PartBody*,all"  ''''or choose other method to select MainBody 

   CATIA.StartCommand "Reframe On"  

''''''''''''''''''''''hide spec tree and compass
Dim specsAndGeomWindow1 As Window
Set specsAndGeomWindow1 = CATIA.ActiveWindow

Dim viewer3D1 As Viewer
Set viewer3D1 = specsAndGeomWindow1.ActiveViewer

viewer3D1.Reframe 

    Dim MyWindow1 As SpecsAndGeomWindow
    Dim MyViewer1 As Viewer3D

    Set MyWindow1 = CATIA.ActiveWindow
   MyWindow1.Layout = catWindowGeomOnly
   
Dim MyWindow As Window
Dim MyViewer As Viewer

Set MyWindow = CATIA.ActiveWindow
Set MyViewer = MyWindow.ActiveViewer

   CATIA.StartCommand "Compass Of"   ''''''''''''hide compass

''''''''''''''your code here
CATIA.StartCommand "Compass On"   'back compass
MyWindow1.Layout = catWindowSpecsAndGeom   'back geometry and spec tree

End Sub

Regards
Fernando

 
thank you so much ferdo, it works perfectly

I tried that option, and also the zoom in, and the zoom in works fine, but the thing is that when I have a different part how can CATIA know how much to zoom in,

what I imagine is like create an area depending on a my model, refere that area to the command zoom area or something like that,

hope you can help me, thank you so much for all your time and help
 
thank you so much for all your help, ferdo

 
regarding the same issue, I was looking at the pictures that I was taking, and I saw a number,

and when I, etather zooming in or out, the number changes

so I was wondering if this number can me modify in a macro,

I don't know how it is called, so I was unable to find any information

here I left a picture pointing at the number I am talking about

hope you can help me, thank you
 
 http://files.engineering.com/getfile.aspx?folder=739f8f5f-3513-4a87-9381-d16eaa85eb7f&file=1.jpg
The number you are referring to is the Display current scale in parallel mode. This option is found under tools - options - General - Display - Visualization. With my limited knowledge of programming you can not do anything with it but ferdo is a rockstar and might have some insight.

Regards,
Derek


Win XP64
21SP6/22SP4, 3DVIA Composer 2013X, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
 
Hi,

Derek is right at first point not at second :) (still, I'm an amateur)

I don't know if this will help you, but you can give a try and let us know...on my computer I get a 2 near axis.

I'm also curios how your code will look at the end.

Code:
Sub CATMain()

Dim ActWin As INFITF.SpecsAndGeomWindow
Set ActWin = Catia.ActiveWindow
Dim v3d As INFITF.Viewer3d
Set v3d = ActWin.ActiveViewer
Dim specs As SpecsViewer
Set specs = ActWin.SpecsViewer
v3d.Viewpoint3D.Zoom = 0.0066*2
v3d.Update

End Sub



Regards
Fernando

 
wow you are awesome with this, it works perfectly, I just have to do some adjustment for parts,

because I have different sizes, and I need different zooming for each,

well thank you so much for all your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top