How to fix solid faces
Posted: Fri Jul 16, 2021 5:12 pm
Dear STKO team,
I am trying to impose fixities on faces of a solid. Can you help to correct the bold green part of the script below? Let say that I am interested in fixing the face 3 of the solid 2.
con = MpcCondition()
con.id = doc.conditions.getlastkey(0)+1
FIX_Vector.append(con.id)
con.name = 'Vincolo'
meta = doc.metaDataCondition('Constraints.sp.fix')
xobj = MpcXObject.createInstanceOf(meta)
xobj.getAttribute('Dimension').string = '3D'
xobj.getAttribute('ModelType').string = 'U (Displacement)'
xobj.getAttribute('2D').boolean = False
xobj.getAttribute('3D').boolean = True
xobj.getAttribute('U (Displacement)').boolean = True
xobj.getAttribute('U-P (Displacement+Pressure)').boolean = False
xobj.getAttribute('U-R (Displacement+Rotation)').boolean = False
xobj.getAttribute('Ux').boolean = True
xobj.getAttribute('Uy').boolean = True
xobj.getAttribute('Uz').boolean = True
con.XObject = xobj
# create the condition assignment
sset = MpcConditionIndexedSubSet()
sset.faces.append(0)
con.assignTo(so1, sset)
# add condition to document
doc.addCondition(con)
con.commitXObjectChanges()
Thank you in advance for your help.
Best wishes,
Raffaele
I am trying to impose fixities on faces of a solid. Can you help to correct the bold green part of the script below? Let say that I am interested in fixing the face 3 of the solid 2.
con = MpcCondition()
con.id = doc.conditions.getlastkey(0)+1
FIX_Vector.append(con.id)
con.name = 'Vincolo'
meta = doc.metaDataCondition('Constraints.sp.fix')
xobj = MpcXObject.createInstanceOf(meta)
xobj.getAttribute('Dimension').string = '3D'
xobj.getAttribute('ModelType').string = 'U (Displacement)'
xobj.getAttribute('2D').boolean = False
xobj.getAttribute('3D').boolean = True
xobj.getAttribute('U (Displacement)').boolean = True
xobj.getAttribute('U-P (Displacement+Pressure)').boolean = False
xobj.getAttribute('U-R (Displacement+Rotation)').boolean = False
xobj.getAttribute('Ux').boolean = True
xobj.getAttribute('Uy').boolean = True
xobj.getAttribute('Uz').boolean = True
con.XObject = xobj
# create the condition assignment
sset = MpcConditionIndexedSubSet()
sset.faces.append(0)
con.assignTo(so1, sset)
# add condition to document
doc.addCondition(con)
con.commitXObjectChanges()
Thank you in advance for your help.
Best wishes,
Raffaele