How to output selection the name selection with mechanical script?

Feng Zhu
Member Posts: 7
**
in Structures
As the figs shown, I want to output the name selection result data, but the mechanical scripting doesn't record the hangdling operation. Can you give me a hand?
Tagged:
0
Comments
-
Try this out.
NamedSelNames = ['face','face2'] NSs = [ExtAPI.DataModel.GetObjectsByName(NamedSelName)[0] for Name in NamedSelNames] AS = Model.Analyses[0].AnalysisSettings AS.OutputSelection=OutputSelection.NamedSelection AS.NamedSelection=NSs
1 -
Hi, Mike
Thanks for your help.I made some minor changes, it's OK now.
NamedSelNames = ['face','face2']
NSs_nested = [ExtAPI.DataModel.GetObjectsByName(Name) for Name in NamedSelNames]
NSs = [item for sublist in NSs_nested for item in sublist]
AS = Model.Analyses[0].AnalysisSettings
AS.OutputSelection=OutputSelection.NamedSelection
AS.NamedSelection=NSs1