Model.hm_plotmarker_bycollection#
- Model.hm_plotmarker_bycollection(collection, dataname='', inputmarker='', color=1, location='centroid', display=0, precision=6)#
Creates a graphical marker.
- Parameters:
collection (Collection) – The collection to create markers for. Valid collection types are nodes, elements, points, lines, surfaces, and solids.
dataname (hwString) – The data name or attribute to create markers for. If not specified,
inputmarkermust be used.inputmarker (hwString) – Currently not supported.
color (int) – The color of the marker (default is 1).
location (hwString) – The location to place the marker. Valid for
entityof type element and line only. Valid values are centroid (default) or node index (e.g., node1, node2, etc.).display (int) –
The display label details.
0 - value (default)
1 - data name : value
2 - entity_type : entity_id : data name : value
precision (int) – The precision of double values coming from data names. Valid only if
datanameis specified. Valid values are 0-6 (default is 6). Trailing zeros are always removed (e.g. 529.70900 becomes 529.709).
Example#
Create a marker using the “id” data name for elements 1-100#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, range(1, 101)) model.hm_plotmarker_bycollection(collection=elems, dataname="id")
Create a marker using the “id” data name for elements 1-100 using color 20 and the node3 location#import hm import hm.entities as ent model = hm.Model() elems = hm.Collection(model, ent.Element, range(1, 101)) model.hm_plotmarker_bycollection( collection=elems, dataname="id", color=20, location="node3" )