...
Code Block | ||
---|---|---|
| ||
# Point load
set root [customlib::GetBaseRoot]
customlib::WriteString ""
customlib::WriteString "%"
customlib::WriteString "% Point loads"
customlib::WriteString "%"
customlib::WriteString "pointload = \["
set displacement_fix_nodes [$root selectNodes "*/condition\[@n='PuntualLoads'\]/group"]
foreach node $displacement_fix_nodes {
set group [$node @n]
set val_x [get_domnode_attribute [$node selectNodes "./value\[@n='x-force'\]"] v]
set val_y [get_domnode_attribute [$node selectNodes "./value\[@n='y-force'\]"] v]
set fix_x [expr $val_x == 0.0 ? "false" : "true"]
set fix_y [expr $val_y == 0.0 ? "false" : "true"]
set nodes [GiD_EntitiesGroups get $group nodes]
set num_nodes [objarray length $nodes]
for {set i 0} {$i < $num_nodes} {incr i} {
set node_id [objarray get $nodes $i]
if {$i < [expr $num_nodes -1] } {set end ";"} {set end ""}
if {$fix_x eq "true" && $fix_y eq "true"} {set end ";" }
if {$fix_x eq "true"} { customlib::WriteString "$node_id , 1 , $val_x $end" }
if {$i < [expr $num_nodes -1] } {set end ";"} {set end ""}
if {$fix_y eq "true"} { customlib::WriteString "$node_id , 2 , $val_y $end" }
}
}
customlib::WriteString "\] ; " |
...