0

Abaqus FEM software, which uses Python, creates its own variable/list types, for example:

a = mdb.models['Model-1'].rootAssembly.instances['Instance-1'].faces
print a
type(a)

['Face object', 'Face object', 'Face object', ...]

type 'FaceArray'

print a[0]:
type(a[0])

({'featureName': 'Name-1', 'index': 6, 'instanceName': 'Name-1', 'isReferenceRep': False, 'pointOn': ((0.0, 0.733333, -0.133333),)})

type 'Face'

When I now initialize x=[] and add a 'Face object' with x.append(a[2]), it results in

[mdb.models['Model-1'].rootAssembly.instances['Instance-1'].faces[2]]

instead of

['Face object']

How can I create a new variable of the same format as a?

user56574
  • 9
  • 5

1 Answers1

0

u have to create face array not simple array, then add into your face array Face objects

x = FaceArray()
János Farkas
  • 453
  • 5
  • 14
  • Unfortunately, this doesn't work and returns: > NameError: name 'FaceArray' is not defined – user56574 Apr 04 '16 at 20:10
  • http://ivt-abaqusdoc.ivt.ntnu.no:2080/v6.14/books/ker/default.htm?startat=pt01ch07pyo05.html getByBoundingBox function returns face array, that means it contains the constructor of face array – János Farkas Apr 05 '16 at 07:44
  • Thanks for your help. What does that mean to me exactly? Like how can I make use of the fact, that getByBoundingBox contains the constructor information in this case? – user56574 Apr 06 '16 at 15:04
  • somewhere in function getByBoundingBox calls the method which creates facearray (because the return variable type is facearray), your only task is to find it, and from that point u can create your own facearray (personally i never used abaqus, but it contains surely .py files) – János Farkas Apr 06 '16 at 19:13
  • A couple of functions return a facearray, but that does not help a lot. The constructor is seemlingly not available. – Dimali May 29 '17 at 13:12