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 all,
set a '1 2 3 '
set b ' 4 1 3 8 2'
i need to compare these two lists ...not on the basis of order of arrangement only difference
output i need is 4 8
i tried using using *markintersection its not working
Hi
*markintersection is used for hm entities only.
a proc like this
proc ::ldiff {list1 list2} {
set result {}
foreach item $list1 {if {[lsearch $list2 $item]==-1} {lappend result $item}}
set result
}
#now call
ldiff $b $a
hi tinh ,
ya this is working....in case if we have
set a '1 2 3'
set b '1 3 4'
out put
2 4
in this case we have to loop both the lists and append in a separate list . ryt?
just try it and show us your results
chào Tĩnh, mình mới học về hypermesh và đang muốn viết script cho hypermesh, bạn học về hypermesh à /emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
hi tinh,
in the code which u have written ,what does set result does.?(after the for loop)
it returns result.
i think it is not neccessary. because lappend will return it
could you remove it and try?
no no, it is needed. because sometimes lsearch not found item, it will return emptied string
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…