A *post is a mechanism you can use to build the entities required
for a realization.
Using a *post limits the connector creation process to just the
elements in the configuration file. The *post allows full
flexibility for building unique and custom realizations.Figure 1. Figure 2.
Classic: TCL
# making the extraction easier to read
set dep 0
set ind 1
# for each layer get information...
set num_weld_info [ hm_ce_getnumoffeprojinfo ];
set i 0
while {$i < $num_weld_info} {
# get the connector id
set ceID [ hm_getprojceid $i ];
# Add the connector found elements from the projection
foreach projSide [list dep ind] {
# Get the Projection
set currProj [hm_ce_getfeprojtrip $i [subst $$projSide]]
# Save the relevant info
lappend SurfaceElements($ceID) [list $projSide [lindex $currProj 1]]
}
incr i
}
API Simplification: TCL
# Get the list of connectors to work with
set connectorList [hm_getmark connectors 1]
foreach ceID $connectorList {
# Find out the Projection Information
set links_projection_elem [hm_getvalue connectors id=$ceID dataname=realization_links_projection_elem]
set top_layer [hm_getvalue connectors id=$ceID dataname=realization_top_layer]
foreach layer $top_layer {
lappend SurfaceElements($ceID) [lindex $links_projection_elem $layer]
}
set bottom_layer [hm_getvalue connectors id=$ceID dataname=realization_bottom_layer]
foreach layer $bottom_layer {
lappend SurfaceElements($ceID) [lindex $links_projection_elem $layer]
}
}
API Simplification: Python
# Set the global Model
import hm
import hw
import hm.entities as ent
model = hm.Model()
# Get the list of connectors to work with
ids_str = globals().get ("connector_ids")
connectorList = [eval(x) for x in ids_str]
#map the realization for each connector
for ceID in connectorList:
# Get the Object from the ID
ce = ent.Connector(model,ceID)
# Find out the Projection Information
links_projection_elem = ce.realization_links_projection_elem
top_layer = ce.realization_top_layer
bottom_layer = ce.realization_bottom_layer
SurfaceElemnts = []
for layer in top_layer:
SurfaceElemnts.insert(layer,links_projection_elem)
for layer in bottom_layer:
SurfaceElemnts.insert(layer,links_projection_elem)