]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/Tools/MacMesh/MacMesh/MacObject.py
Salome HOME
Copyright update 2021
[modules/smesh.git] / src / Tools / MacMesh / MacMesh / MacObject.py
index f2665083dca65df9ee917f8a8450ec95562b7388..451bfe80baf400b11ad2b34b260c595d36f8188f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2016  EDF R&D
+# Copyright (C) 2014-2021  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
@@ -69,7 +69,7 @@ class MacObject:
         self.MeshGroups = []
         self.CheckInterfaces()
         if 'auto' in MeshParameters : self.AutoParam()
-        if not(self.MeshPar[0]<0): self.Generate()
+        if isinstance(self.MeshPar[0], list) or not(self.MeshPar[0]<0): self.Generate()
         else :
             Config.ListObj.append(self)
             print("Aborting object creation\n ")
@@ -185,6 +185,8 @@ class MacObject:
         self.DirectionalMeshParams =  MeshPar
         self.MeshPar[0] = GenFunctions.CompatibilityTest(self)
 
+        if isinstance( self.MeshPar[0], list ):
+            return # OK
         if self.MeshPar[0] < 0 :
             Alarms.Message(4)
             if self.MeshPar[0] == -1 : print(("Problem encountered with object(s) no. "+str(ObjectsInvolved)))
@@ -209,7 +211,7 @@ class MacObject:
         """
         PtCoor = self.PtCoor
         PtCoor.append(self.PtCoor[0])
-        if type(Direction) is str :
+        if isinstance(Direction, str) :
             Dir = { 'South'  : lambda : 0,
                     'North'  : lambda : 1,
                     'West'   : lambda : 2,
@@ -226,7 +228,7 @@ class MacObject:
         The interest in using this method is for non-orthogonal objects where the sides can be
         deviated from the orthogonal basis vectors
         """
-        if type(Direction) is str :
+        if isinstance(Direction, str) :
             Dir = { 'South'  : lambda : 0,
                     'North'  : lambda : 1,
                     'West'   : lambda : 2,
@@ -241,9 +243,9 @@ class MacObject:
         import GenFunctions, Config
 
         from salome.geom import geomBuilder
-        geompy = geomBuilder.New( Config.theStudy )
+        geompy = geomBuilder.New()
 
-        if type(Criterion) is str :
+        if isinstance(Criterion, str) :
             Crit = {'South'  : lambda : 0,
                     'North'  : lambda : 1,
                     'West'   : lambda : 2,