A step.Object is one STEP data instance, while a step.Design is the collection of all instances in a file.
An EXPRESS schema describes the type of instances, which can be an ENTITY with attributes, or an AGGREGATE such as a list, set, or bag. An ENTITY instance has a file identifier (#123) while AGGREGATEs have no identifier because they only appear as values of attributes.
STEP instances often describe low-level atomic values, like a direction vector, or a property name, which are then combined in well-defined patterns to describe higher-level concepts like a workpiece, part feature, or machining workplan. The patterns are described in the "Application Reference Model (ARM)" section of the STEP standard.
The STEP Python interface recognizes these patterns when reading data and associates the graph of objects surrounding a root STEP instance as ARM attributes that are accessed exactly like the basic EXPRESS attributes. This greatly simplifies understanding and operations on STEP data sets.
An STEP file example is shown below. Each of the instances #50 to
#62 below is a
step.Object with attribute values shown in
parenthesis. Instance #50 is the root of the higher
ARM concept, so it will also have a through spindle coolant attribute
with a value of 'through spindle coolant off', built from instances
#51-#54, and similarly for chip removal and coolant.
/************************************************ * Application object: MILLING_MACHINE_FUNCTIONS (#50) * THROUGH_SPINDLE_COOLANT: #50, #51, #52, #53, #54: [through spindle coolant off] * CHIP_REMOVAL: #50, #55, #56, #57, #58: [chip removal off] * COOLANT: #50, #59, #60, #61, #62: [coolant on] */ #50=MACHINING_FUNCTIONS('','milling',' ',' '); #51=ACTION_PROPERTY('through spindle coolant','',#50); #52=ACTION_PROPERTY_REPRESENTATION('','',#51,#53); #53=REPRESENTATION('',(#54),#31); #54=DESCRIPTIVE_REPRESENTATION_ITEM('constant','through spindle coolant off'); #55=ACTION_PROPERTY('chip removal','',#50); #56=ACTION_PROPERTY_REPRESENTATION('','',#55,#57); #57=REPRESENTATION('',(#58),#31); #58=DESCRIPTIVE_REPRESENTATION_ITEM('constant','chip removal off'); #59=ACTION_PROPERTY('coolant','',#50); #60=ACTION_PROPERTY_REPRESENTATION('','',#59,#61); #61=REPRESENTATION('',(#62),#31); #62=DESCRIPTIVE_REPRESENTATION_ITEM('constant','coolant on');
def aim(self) -> AimView:
The aim() function returns an AIM view of the object, if
Object type will respond to all AIM properties
as well as the ARM properties, so this function is only useful if you
are looking to list the AIM properties without any ARM ones.
def arm(self) -> ArmObject:
The arm() function returns an ARM view of the object, if
Object type will respond to all ARM properties
as well as the AIM properties, so this function is only useful if you
are looking to list the ARM properties without any AIM ones.
This is also useful to test whether the object is the root of an ARM concept, although arm_type() can also be used for this.
def design(self) -> Design:
The design() function returns the Design that owns the object. Every EXPRESS-defined object is owned by a design, which holds the contents of a STEP file.
@overload def entity_id(self) -> int: ... @overload def entity_id(self, id: int) -> None:
The entity_id() function gets the ID number (#123) for an object that has been read in from a STEP file. These identifiers are only available for ENTITY instances. The function returns zero for aggregates, selects, and entities that have been created but not yet saved.
The second form can be used to set the value if the identifier, although by default, entities are renumbered when written back out to disk.
Given the following fragment of a STEP Part 21 file:
#57=DATE_AND_TIME(#58,#59); #58=CALENDAR_DATE(1993,17,7); #59=LOCAL_TIME(13,47,28.0,#29);
The entity_id() function would return 57 if called on the first instance, 58 if called on the second, and so on.