Let’s Start Programming! Forums CATIA Macro Programming view and window; height and width

This topic contains 4 replies, has 2 voices, and was last updated by  Cornel 3 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1121

    Cornel
    Participant

    I have two situations: view and window.
    The code work with the window height and width.
    But for the viewer … code not working with the viewer height and width.
    I want to keep fixed values: myViewer3D.Height = “500” / myViewer3D.Width = “500”
    how can I do this?!
    Why can not I attach a picture on the forum with size 13.2 KB ?! Link Attachments does not work ?!

    Sub CATMain_for_Viewer3D()
    Dim myViewer3D As Viewer3D
    Set myViewer3D = CATIA.ActiveWindow.ActiveViewer
    Dim H, W As String
    H = myViewer3D.Height
    W = myViewer3D.Width
    myViewer3D.Height = “500”
    myViewer3D.Width = “500”
    Dim objViewer3D As Viewer3D
    Set objViewer3D = CATIA.ActiveWindow.ActiveViewer
    objViewer3D.CaptureToFile catCaptureFormatJPEG, “C:\Users\Cornel Florea\Desktop\myPicture.jpg”
    End Sub

    Sub CATMain_for_Window()
    Dim Window As Window
    Set Window = CATIA.ActiveWindow
    H = Window.Height
    W = Window.Width
    Window.Height = “500”
    Window.Width = “500”
    Dim objViewer3D As Viewer3D
    Set objViewer3D = CATIA.ActiveWindow.ActiveViewer
    objViewer3D.CaptureToFile catCaptureFormatJPEG, “C:\Users\Cornel Florea\Desktop\myPicture.jpg”
    End Sub

    #1168

    Cornel
    Participant

    I do this example to work. The height and width can not use viewer.

    Sub CATMain_for_Viewer3D()
    Dim myViewer3D As Viewer3D
    Set myViewer3D = CATIA.ActiveWindow.ActiveViewer
    Dim H, W As String
    H = myViewer3D.Height
    W = myViewer3D.Width
    myViewer3D.Height = “500”
    myViewer3D.Width = “500”
    Dim objViewer3D As Viewer3D
    Set objViewer3D = CATIA.ActiveWindow.ActiveViewer
    objViewer3D.CaptureToFile catCaptureFormatJPEG, “C:\Users\Cornel Florea\Desktop\myPicture.jpg”
    End Sub

    #1184

    Emmett Ross
    Keymaster

    Let me look into the picture size issue.

    #1187

    Emmett Ross
    Keymaster

    OK, you should be able to upload pictures up to 5000kb in size now!

    #1191

    Cornel
    Participant

    Upload image test. I congratulate you for your effort is appreciated, with sympathy.

    Attachments:
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘CATIA Macro Programming’ is closed to new topics and replies.