示例#1
0
def getLoadCaseObject(loadCase):
    retval = obj.Object()
    id = str(loadCase.id)
    retval.setId(id)
    name = loadCase.name
    if (name == ''):
        name = loadCasePrefix + id
    retval.setNm(name)
    retval.setP0(oI.ObjectItem(name))  #Name
    retval.setP1(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  # Unique id
    tmp = oI.ObjectItem(str(getActionTypeCode(loadCase.actionType)))
    tmp.t = loadCase.actionType
    retval.setP2(tmp)  #??
    retval.setP3(oI.ObjectItem(loadCase.desc))  #Description
    gId = str(loadCase.loadGroupId)
    gName = lgc.loadGroupPrefix + gId
    tmp = oI.ObjectItem('', gId)
    tmp.n = gName
    retval.setP4(tmp)
    ltyp = loadCase.ltyp
    ltypName = getLoadTypeName(ltyp)
    tmp = oI.ObjectItem(str(ltyp))
    tmp.t = ltypName
    retval.setP5(tmp)  #??
    return retval
示例#2
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.nodeLoadCompId)
     retval.setId(loadCompId)
     name = nodeLoadPrefix + loadCompId
     retval.setNm(name)
     nodeId = str(self.nodeId)  # Node id
     retval.setP0(oI.ObjectItem(name))  #Name
     retval.setP1(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP2(self.getNodeReferenceItem())  #Reference to node.
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(self.getValueObjectItem())  #Value
     retval.setP6(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     return retval
示例#3
0
def getLoadGroupObject(loadGroup):
    retval = obj.Object()
    id = str(loadGroup.id)
    retval.setId(id)
    name = loadGroupPrefix + id
    retval.setNm(name)
    retval.setP0(oI.ObjectItem(name))  #Name
    tmp = None
    if (loadGroup.permanent):
        tmp = oI.ObjectItem('0')
        tmp.t = 'Permanent'
    else:
        tmp = oI.ObjectItem('1')
        tmp.t = 'Variable'
    retval.setP1(tmp)
    return retval
示例#4
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.elementLoadCompId)
     retval.setId(loadCompId)
     name = elementLoadPrefix + loadCompId
     retval.setNm(name)
     elementId = str(self.elementId)  # Load name.
     retval.setP0(self.getElementReferenceItem())  #Reference to element.
     retval.setP1(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP2(oI.ObjectItem(name))  #Name
     retval.setP3(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  #Unique id
     retval.setP4(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP5(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP6(self.getValueObjectItem())  #Value
     retval.setP7(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     retval.setP8(oI.ObjectItem('0', '', '', 'Length'))  #Location.
     return retval
示例#5
0
 def getObject(self):
     retval = obj.Object()
     loadCompId = str(self.surfacePressureFreeCompId)
     retval.setId(loadCompId)
     name = surfacePressureFreePrefix + loadCompId
     retval.setNm(name)
     retval.setP0(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP1(oI.ObjectItem(name))  #Name
     retval.setP2(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  #Unique id
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(
         self.getDistributionObjectItem())  #Distribution (uniform,...)
     retval.setP6(self.getValueObjectItem())  #Value
     retval.setP7(oI.ObjectItem('4', '', '', 'Z= 0'))  #Validity
     retval.setP8(oI.ObjectItem('0', '', '', 'Auto'))  #Select
     retval.setP9(self.getSystemItem())  #System 0 -> GCS, 1 -> LCS
     retval.setP10(oI.ObjectItem('0', '', '', 'Length'))  #Location.
     retval.setP11(self.getPolygonRows(self.polygon))  #Reference to node.
     return retval
示例#6
0
def getLoadCombObject(loadComb):
  retval= obj.Object()
  id= str(loadComb.id)
  retval.setId(id)
  name= loadComb.name
  if(name==''):
    name= loadCombPrefix+id
  retval.setNm(name)
  retval.setP0(oI.ObjectItem(name)) #Name
  retval.setP1(oI.ObjectItem('{'+str(uuid.uuid4())+'}')) # Unique id
  retval.setP2(oI.ObjectItem(loadComb.desc)) #Description
  ctyp= getLoadCombType(loadComb.typ)
  ctypName= getLoadCombTypeName(ctyp)
  tmp= oI.ObjectItem(str(ctyp))
  tmp.t= ctypName
  retval.setP3(tmp)
  retval.setP4(getDescompObject(loadComb.descomp))
  retval.setP5(oI.ObjectItem('0')) #Explode
  retval.setP6(oI.ObjectItem('-1')) #Phase
  retval.setP7(oI.ObjectItem('0')) #Master ID
  return retval
示例#7
0
 def getObject(self):
     '''Returns an XML object for the point force component.'''
     retval = obj.Object()  #SCIA XML basic object.
     loadCompId = str(self.pointForceFreeCompId)
     retval.setId(loadCompId)
     name = pointForceFreePrefix + loadCompId
     retval.setNm(name)
     retval.setP0(self.getLoadCaseReferenceItem())  #Reference to load case.
     retval.setP1(oI.ObjectItem(name))  #Name
     retval.setP2(oI.ObjectItem('{' + str(uuid.uuid4()) + '}'))  # Unique id
     retval.setP3(self.getDirectionObjectItem())  #Direction X, Y or Z
     retval.setP4(oI.ObjectItem('0', '', '', 'Force'))  #Type 0 -> Force.
     retval.setP5(oI.ObjectItem('4', '', '', 'Z= 0'))  #Validity
     retval.setP6(oI.ObjectItem('0', '', '', 'Auto'))  #Select
     retval.setP7(self.getValueObjectItem())  #Value
     retval.setP8(oI.ObjectItem(str(self.x)))  #X (position)
     retval.setP9(oI.ObjectItem(str(self.y)))  #Y (position)
     retval.setP10(oI.ObjectItem(str(self.z)))  #Z (position)
     retval.setP11(oI.ObjectItem(str(self.x)))  #ux (position?)
     retval.setP12(oI.ObjectItem(str(self.y)))  #uy (position?)
     retval.setP13(oI.ObjectItem(str(self.z)))  #uz (position?)
     retval.setP14(
         self.getSystemItem())  #System 0 -> GCS, 1 -> LCS, 2 -> Load LCS
     return retval