How to get already created node or element set
Dear All,
I am using .dat and .op2 file for loading the model in hyperview.
In .dat file we already have created sets for some elements and nodes seperatly.
I want to take node id or element id from that sets. But, by using the label name of set.
I am using tcl/tk for that but not getting.
Please provide any script to find the same.
Best Regards,
Vikas Kumar
Answers
-
You can get the ID list with following example,
hwi OpenStack;
set t [::post::GetT];
hwi GetSessionHandle sess$t;
sess$t GetProjectHandle proj$t;
proj$t GetPageHandle page$t [proj$t GetActivePage];
page$t GetWindowHandle wind$t [page$t GetActiveWindow];
wind$t GetClientHandle clie$t;
clie$t GetModelHandle modl$t [clie$t GetActiveModel];
foreach sid [modl$t GetSelectionSetList 'Set'] {
modl$t GetSelectionSetHandle sels${t}_00${sid} $sid;
set name [sels${t}_00${sid} GetLabel];
set list [sels${t}_00${sid} GetList];
puts 'Name = $name , IDs = $list';
}
hwi CloseStack;Thanks,
Imoto0 -
Altair Forum User said:
You can get the ID list with following example,
hwi OpenStack;
set t [::post::GetT];
hwi GetSessionHandle sess$t;
sess$t GetProjectHandle proj$t;
proj$t GetPageHandle page$t [proj$t GetActivePage];
page$t GetWindowHandle wind$t [page$t GetActiveWindow];
wind$t GetClientHandle clie$t;
clie$t GetModelHandle modl$t [clie$t GetActiveModel];
foreach sid [modl$t GetSelectionSetList 'Set'] {
modl$t GetSelectionSetHandle sels${t}_00${sid} $sid;
set name [sels${t}_00${sid} GetLabel];
set list [sels${t}_00${sid} GetList];
puts 'Name = $name , IDs = $list';
}
hwi CloseStack;Thanks,
Imotothansk imoto
i was also using same methodology but, since while exporting model from HM we haven't tick Hypermesh Comments so tool was not recognizing by label as well as by ID.
We need to tick below mentioned checkbox while exporting model otherwise it won't recognize
Thanks @Imoto for your reply.
Best Regards,
Vikas Kumar
0 -
Altair Forum User said:
What happens if duplicate set ID is there.
eg.-
In this case I have used command
set listForAllSet [modl$t GetSelectionSetList]
This command giving all ID's
but for set id 1 it is always returning '0D Set' as label but i want next time it should return 'Front'
same is happening with id 3,4.
That's why i want to take element or node id from set by using set name not by using set id. Is it possible.
I know keeping same id is not good but i need to deal with this.
Best Regards,
Vikas Kumar
0 -
@Imoto Set 1,2,3,4 came along with op2 file so we don't have control over that.
0 -
Hi @Vikas Kumar
In my past posted example is specify the poolname, the poolname is available 'Set' or 'User_Set'.
Please try to get the set list using 2 poolnames.
modl$t GetSelectionSetList 'User_Set'; = automaticly created sets.
modl$t GetSelectionSetList 'Set'; = from solver deck.
Thanks,
Imoto
0 -
0
-
Hi @Vikas Kumar
Now I guess understood your point, it should be specify the poolname when get the Set handle.
Like this -> modl$t GetSelectionSetHandle sels${t}_00${sid} 'Set $sid';
--- Correct example ---
hwi OpenStack;
set t [::post::GetT];
hwi GetSessionHandle sess$t;
sess$t GetProjectHandle proj$t;
proj$t GetPageHandle page$t [proj$t GetActivePage];
page$t GetWindowHandle wind$t [page$t GetActiveWindow];
wind$t GetClientHandle clie$t;
clie$t GetModelHandle modl$t [clie$t GetActiveModel];
foreach sid [modl$t GetSelectionSetList 'Set'] {
modl$t GetSelectionSetHandle sels${t}_00${sid} 'Set $sid';
set name [sels${t}_00${sid} GetLabel];
set list [sels${t}_00${sid} GetList];
puts 'Name = $name , IDs = $list';
}
hwi CloseStack;
Thanks,
Imoto
0 -
0