Analysis, Design, and Load Properties are all assigned to an entity in the same way. This can be done with the following steps:
-
Reference the entity that you intend to modify.
project.Zonesreturns an iterable object containing the Zones in the selected Project. References to Zones and Joints can also be similarly obtained from the Structures or Sets that they belong to. -
Reference the Property that you intend to assign.
For example,
application.AnalysisPropertiesreturns an iterable object containing the Analysis Properties in the current Database. -
Call
AssignProperty()on the entity, passing the Property that you intend to assign.
Note
This Script is compatible with the Script Runner and uses the Python API Wrapper.
import hyperx as hx
def Run(db_):
db = hx.Application(db_)
project = db.ActiveProject
# Grab the zone which should have this analysis property
zoneId = 3
zone = project.Zones.Get(zoneId)
# Grab the analysis property to assign to the zone
analysisProperty = db.AnalysisProperties.Get("My Example Analysis Property")
# Assign the property to the zone
assignmentStatus = zone.AssignProperty(analysisProperty)
if assignmentStatus == hx.PropertyAssignmentStatus.Success:
print(f"Analysis property {analysisProperty.Name} successfully assigned
to zone {zone.Id}!")