If a set spans more than one part instance, the members vertices, edges, faces, cells, elements, or nodes return a sequence of all the queried vertices/edges/faces/celss/elements/nodes respectively for each part instance contained in the set. For example:
assembly=mdb.models['Transmission'].rootAssembly clutchElements=assembly.instances['Clutch'].elements clutchSet=clutchElements[16:18]+clutchElements[78:80] housingElements=assembly.instances['Housing'].elements housingSet=housingElements[45:48] transmissionSet=assembly.Set(name='TransmissionSet', \ elements=(clutchSet, housingSet)) len(transmissionSet.elements)=7 transmissionSet.elements[0]=mdb.models['Transmission'].rootAssembly.instances['Clutch-1'].elements[16] transmissionSet.elements[6]=mdb.models['Transmission'].rootAssembly.instances['housing-1'].elements[47]
import part mdb.models[name].parts[name].allInternalSets[name] mdb.models[name].parts[name].allSets[name] mdb.models[name].parts[name].sets[name] import assembly mdb.models[name].rootAssembly.allinstances.sets[name] mdb.models[name].rootAssembly.allInternalSets[name] mdb.models[name].rootAssembly.allSets[name] mdb.models[name].rootAssembly.instances[name].sets[name] mdb.models[name].rootAssembly.modelInstances[i].sets[name] mdb.models[name].rootAssembly.sets[name]
This method creates a set from a sequence of objects in a model database.
mdb.models[name].parts[name].Set
mdb.models[name].rootAssembly.Set
Required argument
A String specifying the repository key.
Optional arguments
At least one sequence argument must be provided—elements, nodes, vertices, edges, faces, cells, or referencePoints. The arguments xVertices, xEdges, and xFaces are used to exclude lower-dimension entities and to provide finer control on the content of the set. For example, the following statement defines a region enclosing a square face but without two of its edges:
set = mdb.models['Model-1'].rootAssembly.Set(name='mySet', \ faces=f[3:4], \ xEdges=e[1:3])
A sequence of MeshNode objects. The default value is None.
A sequence of MeshElement objects. The default value is None.
A Region object specifying other objects to be included in the set. The default value is None.
A sequence of Vertex objects. The default value is None.
A sequence of Edge objects. The default value is None.
A sequence of Face objects. The default value is None.
A sequence of Cell objects. The default value is None.
A sequence of Vertex objects that excludes specific vertices from the set. The default value is None.
A sequence of Edge objects that excludes specific edges from the set. The default value is None.
A sequence of Face objects that excludes specific faces from the set. The default value is None.
A sequence of ReferencePoint objects. The default value is an empty sequence.
A tuple of tuples specifying a skin name and the sequence of faces associated with this skin. Valid only for geometric regions on 3D and 2D parts.
A tuple of tuples specifying a skin name and the sequence of edges associated with this skin. Valid only for geometric regions on Axisymmetric parts.
A tuple of tuples specifying a stringer name and the sequence of edges associated with this stringer. Valid only for geometric regions on 3D and 2D parts.
Return value
A Set object.
Exceptions
InvalidNameError.
This method copies a set from an existing set.
mdb.models[name].parts[name].Set
mdb.models[name].rootAssembly.Set
Required arguments
A String specifying the name of the set.
A Set object to be copied.
Optional arguments
Return value
A Set object.
Exceptions
InvalidNameError.
This method creates a set by performing a boolean operation on two or more input sets.
mdb.models[name].parts[name].SetByBoolean
mdb.models[name].rootAssembly.SetByBoolean
Required arguments
A String specifying the repository key.
A sequence of Set objects.
Optional argument
A SymbolicConstant specifying the boolean operation to perform. Possible values are UNION, INTERSECTION, and DIFFERENCE. The default value is UNION. Note that if DIFFERENCE is specified, the order of the given input sets is important; All sets specified after the first one are subtracted from the first one.
Return value
A Set object.
Exceptions
InvalidNameError.
This method creates a set containing faces of the part marked with a specified color attribute. Third-party applications can assign color attributes to faces, and the color attribute can be imported into Abaqus from an ACIS file. You can use this method to create sets only on parts; however, you can access the sets from instances of the parts in the assembly.
mdb.models[name].parts[name].SetFromColor
Required arguments
A String specifying the repository key.
A sequence of three Ints specifying the RGB color. Values can range from 0 to 255. The first integer is for red, the second for green, and the third for blue. For example, a face colored in yellow is identified by:
color=(255,255,0)
Optional arguments
Return value
A Set object.
Exceptions
InvalidNameError.
This method creates a set from a sequence of element labels in a model database.
mdb.models[name].parts[name].SetFromElementLabels
mdb.models[name].rootAssembly.SetFromElementLabels
Required arguments
A String specifying the repository key.
A sequence of element labels. An element label is a sequence of Int element identifiers. For example, for a part:
elementLabels=(2,3,5,7)For an assembly:elementLabels=(('Instance-1', (2,3,5,7)), ('Instance-2', (1,2,3)))
Optional arguments
Return value
A Set object.
Exceptions
InvalidNameError.
This method creates a set from a sequence of node labels in a model database.
mdb.models[name].parts[name].SetFromNodeLabels
mdb.models[name].rootAssembly.SetFromNodeLabels
Required arguments
A String specifying the repository key.
A sequence of node labels. A node label is a sequence of Int node identifiers. For example, for a part:
nodeLabels=(2,3,5,7)For an assembly:nodeLabels=(('Instance-1', (2,3,5,7)), ('Instance-2', (1,2,3)))
Optional arguments
Return value
A Set object.
Exceptions
InvalidNameError.
This method creates sets based on mapping sets from element centroid locations in an Odb.
mdb.models[name].parts[name].MapSetsFromOdb
Required arguments
A String specifying the path to the ODB containing the source sets.
A list of names of sets on the ODB to map.
Optional arguments
A list of names of sets to construct or use corresponding to the ODB sets.
An enum to specify OVERWRITE, APPEND, INTERSECT, or REMOVE. The default is OVERWRITE.
Return value
A Set object or a tuple of Set objects.
Exceptions
The Set object has the following members:
A MeshElementArray object.
A MeshNodeArray object.
A VertexArray object.
An EdgeArray object.
A FaceArray object.
A CellArray object.
A ReferencePointArray object.