Model.hm_getdistance#
- Model.hm_getdistance(entityType, id1, id2, localCoordSystemId)#
Returns the distance between two nodes/points relative to a local coordinate system. This returns four values indicating the total distance and the three component values between the input nodes/points, relative to a local coordinate system. If the system is rectangular, the component values returned are x, y, and z. If the system is cylindrical, the component values returned are r, t, and z. If the system is spherical, the component values returned are r, t, and p
- Parameters:
entityType (EntityFullType) – The type of entity to query. Valid values are nodes and points.
id1 (unsigned int) – The ID of the first entity.
id2 (unsigned int) – The ID of the second entity.
localCoordSystemId (unsigned int) – The ID of the local coordinate system to use. If the value is specified as 0, the global coordinate system is used.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:distanceTotal (double)
distanceComponents (numpy.ndarray)
Example#
Get the distance between nodes with IDs 25 and 100 relative to spherical coordinate system with ID 3#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_getdistance(entityType=ent.Node, id1=25, id2=100, localCoordSystemId=3) print("distanceTotal", result.distanceTotal) print("distanceComponents", result.distanceComponents)