]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
0022739: [CEA 812] Create source plug-in to display a GEOM object via CORBA
authorvsr <vsr@opencascade.com>
Fri, 6 Feb 2015 14:11:26 +0000 (17:11 +0300)
committervsr <vsr@opencascade.com>
Fri, 6 Feb 2015 14:14:03 +0000 (17:14 +0300)
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

index ba5433e7b32c4598df033f962ed3bf952a5052ee..cb0e8af74740d9e1b0b3ef69960b5e274643fa87 100644 (file)
@@ -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
-
-    
-