From 9293f5a3cf39a97010f7fc672d7f0a378584f0ae Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 6 Feb 2015 17:11:26 +0300 Subject: [PATCH] 0022739: [CEA 812] Create source plug-in to display a GEOM object via CORBA 0022740: [CEA 1250] Create source plug-in to display a SMESH object via CORBA Additional fix to work properly with study opened from HDF file --- src/Macro/ShowSalomeObject.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Macro/ShowSalomeObject.py b/src/Macro/ShowSalomeObject.py index ba5433e7..cb0e8af7 100644 --- a/src/Macro/ShowSalomeObject.py +++ b/src/Macro/ShowSalomeObject.py @@ -39,13 +39,13 @@ from pvsimple import * 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() @@ -62,10 +62,10 @@ for entry in selection: 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() @@ -81,6 +81,3 @@ for entry in selection: # not mesh object pass pass - - - -- 2.39.2