The Siemens Community Catalyst program was co-created with our community to acknowledge technology leaders who consistently contribute to the Siemens Community. Nominations are accepted on a rolling basis.
Hi,
Is there a way to select components in the order the user selects ?? I checked for *createlistpanel but it isn't applicable for components, and hm_getmark always gives a result of a list which is ascending order only.
Why do you need that?
A workaround is : select elem list, and then retrieve component list that store them.
Directly, I think we can hook a callback with event graphic_selection_changes
Actually for this code I really want it as a component selection rather than element. That way the user knows the entire range of selection he/she is making. Like as much as possible I want to avoid the element selection as it would be not as appealing to the user.
And I'm sorry, I don't know much about graphic selection changes, haven't explored those options.
please Try this:
variable list1
proc framework args \ { *createmarkpanel comps 1 'Please select the components '; hm_framework registerproc getorderedcomps graphics_selection_changed;
*clearmark comps 1;
}
proc getorderedcomps args \ { variable list1; lappend list1 [noIntersect;]; }
proc noIntersect args \ {
variable list1; foreach item [hm_getmark comps 1] \ { if {$item in $list1} \ { continue; } else {set comp $item}; } return $comp }
framework puts $list1
If user deselect a comp you need to lremove item from list1
BG913
Even if deselect component this will take care of it.. Thanks To @tinh for suggestion...
Please try this updated one:
proc framework args \ { *createmarkpanel comps 1 ' '; hm_framework registerproc getorderedcomps graphics_selection_changed;
proc getorderedcomps args \ { variable list1; set value [noIntersect] if {$value != ''} \ { lappend list1 $value ; } }
variable list1; set marklist [hm_getmark comps 1]; foreach item $marklist \ { if {$item in $list1} \ { continue; } else {set comp $item}; } if {[info exist comp]} \ { return $comp } else \ { foreach item $list1 \ { if {$item in $marklist} \ { continue; } else \ { set list1 [lremove $list1 $item] } } } }
Join us for a community conversation on how High-Performance Computing (HPC) and Simcenter PSIM work together to meet the increasing demands of modern power electronics simulation. During this one-hour technical session, you'll discover how leveraging HPC can speed up simulations, improve scalability, and empower engineers…
Join us for a community conversation on accelerating your motor simulation workflow with Simcenter Simlab. In this beginner-friendly session, we'll introduce the platform's automated model-building capabilities and show how easy it is to set up your first electric motor analysis. You'll see the basic steps of geometry…
Join us for a Community Conversation where we'll discuss practical approaches to analyzing complex electromagnetic models using hybrid solver techniques. This session will provide a general overview of how different computational methods can be combined within a single simulation to address models containing varied…