×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

full screen shot

full screen shot

full screen shot

(OP)
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

RE: full screen shot

(OP)
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

RE: full screen shot

Old code quickly modified....

CODE --> CATScript

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

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: full screen shot

(OP)
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

RE: full screen shot

(OP)
thank you so much for all your help, ferdo

RE: full screen shot

(OP)
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

RE: full screen shot

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

RE: full screen shot

Hi,

Derek is right at first point not at second smile (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 --> CATScript

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

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: full screen shot

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources