Krischu
Civil/Environmental
- Mar 8, 2015
- 6
I'm trying to write a script that applies a load to a surface to a couple of instances.
This is the script:
The problem is to me that I don't know how to access the axis of the specific part.
In the Model it looks like
[pre]Models(1)
- Model-1
- Parts(1)
- mybolt
- Features(4)
+ Solid extrude-1
- Datum plane-1
- Partition cell-1
- myaxis[/pre]
At the moment datum[2] seems to be an arbitrary point in the surface. What I wish is to access the item 'myaxis'
How can I achieve this?
Thanks in advance for helping.
This is the script:
Python:
from abaqus import *
from abaqusConstants import *
import displayGroupMdbToolset as dgm
import part
import material
import assembly
from abaqus import getInput
def apply_force(my,mn):
i=1
a = mdb.models[mn].rootAssembly
inst = a.instances
for key in inst.keys():
if(key.startswith(myname)):
print key
region = a.instances[key].surfaces['mysurf']
#leaf = dgm.LeafFromInstance(a.instances[key]) # leaf noch unbenutzt
datumAxis= mdb.models[mn].rootAssembly.instances[key].[COLOR=#EF2929][b]datums[2][/b][/color]
mdb.models[mn].BoltLoad(name='BL-'+str(i), createStepName='PRE',region=region, magnitude=kraft, boltMethod=APPLY_FORCE,datumAxis=datumAxis)
i=i+1
viewportName = session.currentViewportName
mn = session.sessionState[viewportName]['modelName']
myname = getInput('Namen eingeben:')
kraft = float(getInput('Vorspannkraft:'))
apply_force(myname,mn)
The problem is to me that I don't know how to access the axis of the specific part.
In the Model it looks like
[pre]Models(1)
- Model-1
- Parts(1)
- mybolt
- Features(4)
+ Solid extrude-1
- Datum plane-1
- Partition cell-1
- myaxis[/pre]
At the moment datum[2] seems to be an arbitrary point in the surface. What I wish is to access the item 'myaxis'
How can I achieve this?
Thanks in advance for helping.