CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] How to duplicate a layout?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By TobM
  • 1 Post By lukasf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2016, 11:08
Default How to duplicate a layout?
  #1
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 40
Rep Power: 11
lourencosm is on a distinguished road
Does anyone knows how to duplicate a layout?
Either with python or gui?

Thank you,
Lourenço
lourencosm is offline   Reply With Quote

Old   August 1, 2016, 11:03
Default
  #2
New Member
 
Clayton
Join Date: Jul 2016
Posts: 2
Rep Power: 0
MrChips is on a distinguished road
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.
MrChips is offline   Reply With Quote

Old   August 1, 2016, 11:07
Default
  #3
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 40
Rep Power: 11
lourencosm is on a distinguished road
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.
lourencosm is offline   Reply With Quote

Old   November 30, 2016, 09:42
Default
  #4
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
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?
TobM is offline   Reply With Quote

Old   November 30, 2016, 09:50
Default
  #5
Member
 
Lourenço SM
Join Date: Jul 2014
Location: Lisboa, Portugal
Posts: 40
Rep Power: 11
lourencosm is on a distinguished road
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
lourencosm is offline   Reply With Quote

Old   November 30, 2016, 15:49
Default
  #6
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
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
Flowkersma is offline   Reply With Quote

Old   December 1, 2016, 02:08
Default
  #7
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
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 is offline   Reply With Quote

Old   December 6, 2016, 05:59
Default
  #8
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
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()
lourencosm and ykanani like this.
TobM is offline   Reply With Quote

Old   November 19, 2019, 13:36
Default
  #9
Member
 
Yousef
Join Date: Feb 2015
Posts: 40
Rep Power: 11
ykanani is on a distinguished road
Quote:
Originally Posted by TobM View Post
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.
ykanani is offline   Reply With Quote

Old   August 20, 2021, 09:17
Default
  #10
Senior Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 10
usv001 is on a distinguished road
If anyone is still interested, this worked for me:
  1. Split the view (either horizontally or vertically) that you wish to clone.
  2. Select 'Render View'
  3. Right-click inside the newly created render view and select 'Link Camera...'
  4. Select the original view that you like to clone.

The new view will duplicate the original.
usv001 is offline   Reply With Quote

Old   September 8, 2023, 02:00
Default Python script: RenderViewCloning.py
  #11
Senior Member
 
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 7
lukasf is on a distinguished road
There is a discussing regarding the duplication / cloning of a renderview:

https://discourse.paraview.org/t/fea...erview/2370/12

You can download the python script here:

https://gist.github.com/baloe/a6ccd1...94566f50e26d45

How does it work?

After downloading the script you start the python shell in paraview and run the script "RenderViewCloning" in which several functions are defined:
Code:
def clone_to_new_layout():
    ''' Create a new layout and clone the current renderView into it.
    This only works properly if the current layout holds nothing but one 
    renderView.
    '''

def clone_properties( renderView1, renderView2 ):
    '''Configure everything in renderView2 like it is in renderView1. 
    '''

def split_down():
    ''' Split the current renderView vertically by inserting a new 
    renderView at the bottom. Display properties of objects in the pipeline, 
    camera settings, etc. are cloned to the new renderView.
    '''
To use the function "clone_to_new_layout" write clone_to_new_layout() into the python shell.

if you want to use "clone_properties" write

Code:
#select your renderview1
RV1=GetRenderView()
#secelt your renderver2
RV2=GetRenderView()
#Configure everything in renderView2 like it is in renderView1
clone_properties( RV1, RV2 )
lourencosm likes this.
lukasf is offline   Reply With Quote

Reply

Tags
layout, paraview, python


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error, while reopening my techplot layout file farhan4596 Tecplot 3 May 23, 2023 05:46
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 09:42
Problem in3D model processing mebinitap OpenFOAM 2 December 12, 2014 04:40
apt-get update Duplicate lists of OpenFOAM Xulia OpenFOAM Installation 2 June 20, 2013 10:13


All times are GMT -4. The time now is 18:37.