Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1def main():
2 import paraview.simple as para
3 version_major = para.servermanager.vtkSMProxyManager.GetVersionMajor()
4 source = para.GetActiveSource()
5 renderView1 = para.GetRenderView()
6 atoms = para.Glyph(
7 Input=source,
8 GlyphType='Sphere',
9 Scalars='radii',
10 ScaleMode='scalar',
11 )
12 para.RenameSource('Atoms', atoms)
13 atomsDisplay = para.Show(atoms, renderView1)
14 if version_major <= 4:
15 atoms.SetScaleFactor = 0.8
16 atomicnumbers_PVLookupTable = para.GetLookupTableForArray(
17 'atomic numbers', 1)
18 atomsDisplay.ColorArrayName = ('POINT_DATA', 'atomic numbers')
19 atomsDisplay.LookupTable = atomicnumbers_PVLookupTable
20 else:
21 atoms.ScaleFactor = 0.8
22 para.ColorBy(atomsDisplay, 'atomic numbers')
23 atomsDisplay.SetScalarBarVisibility(renderView1, True)
24 para.Render()
27if __name__ == '__main__':
28 main()