FEM: utils, rename typeOfObj to type_of_obj
This commit is contained in:
committed by
Yorik van Havre
parent
d40b23a142
commit
e06a541fec
@@ -75,16 +75,9 @@ def getSingleMember(analysis, t):
|
||||
return objs[0] if objs else None
|
||||
|
||||
|
||||
def typeOfObj(obj):
|
||||
'''returns objects TypeId (C++ objects) or Proxy.Type (Python objects)'''
|
||||
if hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type"):
|
||||
return obj.Proxy.Type
|
||||
return obj.TypeId
|
||||
|
||||
|
||||
def isOfTypeNew(obj, ty):
|
||||
'''returns if an object is of a given TypeId (C++ objects) or Proxy.Type (Python objects)'''
|
||||
if typeOfObj(obj) == ty:
|
||||
if type_of_obj(obj) == ty:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -103,6 +96,13 @@ def isDerivedFrom(obj, t):
|
||||
return obj.isDerivedFrom(t)
|
||||
|
||||
|
||||
def type_of_obj(obj):
|
||||
'''returns objects TypeId (C++ objects) or Proxy.Type (Python objects)'''
|
||||
if hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type"):
|
||||
return obj.Proxy.Type
|
||||
return obj.TypeId
|
||||
|
||||
|
||||
def getBoundBoxOfAllDocumentShapes(doc):
|
||||
overalboundbox = None
|
||||
for o in doc.Objects:
|
||||
|
||||
Reference in New Issue
Block a user