change entity type of mark in tcl like in gui
Hi,
in the Hypermesh GUI, it is a very useful feature that when I select several items of one entity type (i.e. several parts) I can click the downwards arrow on the selection bar and change the entity type (i.e. to solids). Then, the selection changes to all solids that are part of the parts I selected previously. Is there a command in tcl I can use to cause the same behavior for marks in tcl?
I.e. if I want extract from
*createmark modules 1 $myPartID
all solids contained within this mark 1 (resp. the part with id $myPartID) without having to navigate from parts to components to solids step by step?
Thanks!
Find more posts tagged with
Hi Michael,
thanks for your response. I tried it *createmark solids 1 "by module id" 1000 and it works fine. However, now I want to get from PartAssemblies to Components and this does not work. I tried the following:
set assyIDs [list 1006 1010 1044]
eval *createmark comps 1 "by module id" $assyIDs
The comps mark then contains the components with ids 1006 1010 1044, not the components contained within PartAssemblies 1006 1010 1044. Any ideas how to solve this?
Best Regards,
Isabella
Hello @IsabellaR,
one of my colleague share this peice of code with me:
proc GetCompsByPartAssembly {partAssemblyId} {
set compIdList ""
foreach partId [hm_me_childrenget $partAssemblyId] {
ββββββ #if {[hm_getvalue parts id=$partId dataname=structural_type]!="Part"} {continue};# not needed
ββββββββββββset compIdList [concat $compIdList [hm_me_entitiesget $partId comps]]
ββββββ}
ββββββreturn $compIdList
}
Can you please test it?
Regards,
Michael
Hello @IsabellaR,
one of my colleague share this peice of code with me:
proc GetCompsByPartAssembly {partAssemblyId} {
set compIdList ""
foreach partId [hm_me_childrenget $partAssemblyId] {
ββββββ #if {[hm_getvalue parts id=$partId dataname=structural_type]!="Part"} {continue};# not needed
ββββββββββββset compIdList [concat $compIdList [hm_me_entitiesget $partId comps]]
ββββββ}
ββββββreturn $compIdList
}
Can you please test it?
Regards,
Michael
Hello,
there are couple of methods you can use for such steps.
For the case you mentionned above, you don't need the mark of module, you just needto create the mark of solids:
*createmark solids 1 by "module" Part3
Please note that when you deal with modules (Parts and PartAssdemblies), the unique ID is generally is the recommended identifier
In some other cases (eg, from node getting elements), commands such as *findmark may help
Best Regards,
Michael