Page Height and width setting

Vikas Kumar_22189
Vikas Kumar_22189 Altair Community Member
edited October 2020 in Community Q&A

Dear all,

 

Can we set heigh and width of a page or window in Hyperview ?

Is there any API available ?

 

<?xml version="1.0" encoding="UTF-8"?>Height_Width.thumb.PNG.9d287e5fd45cfcd1e5a3df480b1423ba.PNG

 

 

I am asking about ' h ' and ' w '.

@tinh 

 

Regards,

Vikas Kumar

 

Answers

  • tinh
    tinh Altair Community Member
    edited July 2018

    Hi,

    we will add paddings to its frame:

    proc p_SetGraphicArea {Width Height} {

      set gframe .mainFrame.center.f3.center_frm.graphicfrm

      set pinfo [pack info $gframe]

      set pmaster [dict get $pinfo -in]

      set pmasterH [winfo height $pmaster]

      set pmasterW [winfo width $pmaster]

      set padX [expr ($pmasterW-$Width)/2]

      set padY [expr ($pmasterH-$Height)/2]

      set padX [expr $padX<0?0:$padX]

      set padY [expr $padY<0?0:$padY]

      pack configure $gframe -padx $padX -pady $padY

    }

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited July 2018

    Thanks @tinh

     

    It's working fine.

    If we wants to go back to original size how it can be done ?

    Since while i am adding new page it is taking same size but i need again original size in new page.

     

    Regards,

    Vikas Kumar

     

     

     

  • tinh
    tinh Altair Community Member
    edited July 2018

    Hello Vikas

    below last line will return original size, so you can remember them and restore graphic size later

    proc p_SetGraphicArea {Width Height} {

      set gframe .mainFrame.center.f3.center_frm.graphicfrm

      set pinfo [pack info $gframe]

      set pmaster [dict get $pinfo -in]

      set pmasterH [winfo height $pmaster]

      set pmasterW [winfo width $pmaster]

      set padX [expr ($pmasterW-$Width)/2]

      set padY [expr ($pmasterH-$Height)/2]

      set padX [expr $padX<0?0:$padX]

      set padY [expr $padY<0?0:$padY]

      pack configure $gframe -padx $padX -pady $padY

      list $pmasterW $pmasterH

    }

     

    example:

    # change graphic size to (200,100)

    set OriginalSize [p_SetGraphicArea 200 100]

    # do something with graphic image...

    ...

    ...

     

    #change graphic size to original:

    eval p_SetGraphicArea $OriginalSize

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited July 2018

    @tinh

     

    Can we do the same or can we create multiple viewport in hypermesh.

    I know manually it is not possible.

    Is there any tcl/tk command is there which can create multiple window in hypermesh.

     

    Regards,

    Vikas Kumar

  • tinh
    tinh Altair Community Member
    edited July 2018

    If there is a such command, altair has already bring it to GUI

     

    I know there is a way, but it may not be same as hyperview

     

    My ideal is invoke a second hypermesh, show only its graphic window, and embed it in to a frame beside 1st hm graphic area. As they are different process, you cannot use model browser or panels of the 1st to manipulate the 2nd, that is not same as hyperview

    But if you just need to see 2 viewports, eg to make report, it is fine

     

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited August 2018
  • zeta1234
    zeta1234 Altair Community Member
    edited January 2019

    Hello all,

    @Vikas Kumar , I have got the same query as your, But i have to get some more info shown in the figure below. This information is required in capturing an animation (by area). @tinh you have already provided valuable information above but i cannot understand the procedure. There are keywords like .mainFrame, .center., etc. that i cant find in hyperview documentation. Maybe you can share me the link.<?xml version="1.0" encoding="UTF-8"?>Untitled.thumb.png.2b5fe97ef3a51a122d7de03b897721d9.png 

     

    Looking forward for solution :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> , Thanks all in advance

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited January 2019

    Hello all,

    @Vikas Kumar , I have got the same query as your, But i have to get some more info shown in the figure below. This information is required in capturing an animation (by area). @tinh you have already provided valuable information above but i cannot understand the procedure. There are keywords like .mainFrame, .center., etc. that i cant find in hyperview documentation. Maybe you can share me the link.<?xml version="1.0" encoding="UTF-8"?>Untitled.thumb.png.2b5fe97ef3a51a122d7de03b897721d9.png 

     

    Looking forward for solution :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> , Thanks all in advance

    Hi Zeta, 

     

    Give me some time i will provide you same info.

     

    Regards 

    Vikas

  • zeta1234
    zeta1234 Altair Community Member
    edited January 2019

    hi @Vikas Kumar , did you get any information regarding my query. Looking forward for your inputs.

     

    Have a nice Monday :)

     

    Thanks and Regards