-# Copyright (C) 2014 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
###
# Macro to show SALOME object in ParaView viewer.
#
selection = session.getSelection()
for entry in selection:
- obj = salome.myStudy.FindObjectID(entry).GetObject()
+ sobj = salome.myStudy.FindObjectID(entry)
try:
import GEOM
- go = obj._narrow(GEOM.GEOM_Object)
+ from salome.geom import geomBuilder
+ geompy = geomBuilder.New(salome.myStudy)
+ go = sobj.GetObject()._narrow(GEOM.GEOM_Object)
if go:
- from salome.geom import geomBuilder
- geompy = geomBuilder.New(salome.myStudy)
tmpf = tempfile.NamedTemporaryFile(suffix='.vtk')
fname = tmpf.name
tmpf.close()
pass
try:
import SMESH
- mo = obj._narrow(SMESH.SMESH_Mesh)
+ from salome.smesh import smeshBuilder
+ mesh = smeshBuilder.New(salome.myStudy)
+ mo = sobj.GetObject()._narrow(SMESH.SMESH_Mesh)
if mo:
- from salome.smesh import smeshBuilder
- mesh = smeshBuilder.New(salome.myStudy)
tmpf = tempfile.NamedTemporaryFile(suffix='.med')
fname = tmpf.name
tmpf.close()
# not mesh object
pass
pass
-
-
-