CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] How to duplicate a layout? (https://www.cfd-online.com/Forums/paraview/175235-how-duplicate-layout.html)

lourencosm July 26, 2016 11:08

How to duplicate a layout?
 
Does anyone knows how to duplicate a layout?
Either with python or gui?

Thank you,
Lourenšo

MrChips August 1, 2016 11:03

Maybe you're talking about render view? Where you can split the layout and show your model twice?

Below the layout tab all the way to the right, you should see an icon that looks like a split box. When you however over it should say split horizontal. This allows you to have two windows within the layout that will show your model twice.

Also, if you go View and Toggle Borders, you can hide the line between them so that pictures and animations look better.

lourencosm August 1, 2016 11:07

Thank you.
I am not looking for a split.
I want to clone a certain layout to get two equal layouts but with different names . And then, be able to make some small changes without having to configure all the properties again.

TobM November 30, 2016 09:42

Quote:

I want to clone a certain layout to get two equal layouts but with different names . And then, be able to make some small changes without having to configure all the properties again.
I am interested in that, too.
Have you had any idea how to do that?

lourencosm November 30, 2016 09:50

The last time I checked it I got the idea that it is not about layout duplication but maybe regarding each render view.
I'm still searching.

Cheers,
Lourenco

Flowkersma November 30, 2016 15:49

Hi,

You can use "save state" to save the current view and filters. Then when you use "load state" you can change to another input file while keeping all the other options same.

Best, Mikko

TobM December 1, 2016 02:08

Thank you for your reply.
I know and use that a lot, but when you just want to create a layout that is slightly different of a layout you already have a simple duplication would be better. You can save and load a state many times, but then you have the same data loaded more than once.

TobM December 6, 2016 05:59

Here a script that duplicates a layout as far as there is only one view in it.
It is working for me, you might want to set different properties.

Code:

rv1=GetActiveView()
ALL=GetSources()

dispProps=list()

for i in range(len(ALL.keys())):
    dispProps.append(GetDisplayProperties(ALL.values()[i]))
   

viewLayout1 = GetLayout()
#viewLayout1.SplitHorizontal(0, 0.5)

viewLayout2 = CreateLayout()

rv2=CreateView('RenderView')

SetActiveView(rv2)

propNameList=['Visibility', 'Color', 'LookupTable', 'DiffuseColor', 'Scale', 'Representation', 'Texture', 'Opacity','Origin','Position','ScaleFactor']   

for j in range(len(ALL.keys())):
   
    SetDisplayProperties(ALL.values()[j],ColorArrayName=dispProps[j].ColorArrayName[1])
    for name in propNameList:
        try:
            eval('SetDisplayProperties(ALL.values()[j], ' + name + ' =dispProps[j].' + name + ')')
        except:
            pass
       
 

ResetCamera()


ykanani November 19, 2019 13:36

Quote:

Originally Posted by TobM (Post 628474)
Here a script that duplicates a layout as far as there is only one view in it.
It is working for me, you might want to set different properties.

Code:

rv1=GetActiveView()
ALL=GetSources()

dispProps=list()

for i in range(len(ALL.keys())):
    dispProps.append(GetDisplayProperties(ALL.values()[i]))
   

viewLayout1 = GetLayout()
#viewLayout1.SplitHorizontal(0, 0.5)

viewLayout2 = CreateLayout()

rv2=CreateView('RenderView')

SetActiveView(rv2)

propNameList=['Visibility', 'Color', 'LookupTable', 'DiffuseColor', 'Scale', 'Representation', 'Texture', 'Opacity','Origin','Position','ScaleFactor']   

for j in range(len(ALL.keys())):
   
    SetDisplayProperties(ALL.values()[j],ColorArrayName=dispProps[j].ColorArrayName[1])
    for name in propNameList:
        try:
            eval('SetDisplayProperties(ALL.values()[j], ' + name + ' =dispProps[j].' + name + ')')
        except:
            pass
       
 

ResetCamera()


Nice! Worked well.


All times are GMT -4. The time now is 12:26.