Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACT Console - Create Named Selection, Mechanical (Criterion: Body Name containing specific string) 1

Status
Not open for further replies.

smhrjn

Civil/Environmental
Mar 1, 2010
3
Dear All,

could anyone suggest me, how to create Named Selection in Ansys Mechanical using ACT Console. Named Selection should use worksheet (Entity Type: Body, Criterion: Name, Operator: Contains, Value: 'String).
It would speed up NS generation, as I import geometry from Spaceclaim named accordingly.

Thanking you,
Sarat
 
Replies continue below

Recommended for you

Python:
model = ExtAPI.DataModel.Project.Model
analysis = model.Analyses[0]
solution = analysis.Solution
workingdir = analysis.WorkingDir 

named = model.AddNamedSelection()
named.Name = "Named Selection"
named.Location = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.WorksheetSpecific)
worksheet = named.Location
worksheet.AddRow()
worksheet.SetEntityType(0,NamedSelectionWorksheetEntityType.Body)
worksheet.SetCriterion(0,NamedSelectionWorksheetCriterion.Name)
worksheet.SetOperator(0,NamedSelectionWorksheetOperator.Contains)
worksheet.SetStringValue(0, "String")

Maybe this will get you started. The criterion line does not work yet and I don't know why. It accepts other criteria. This link
might also be useful.

 
Thank you L_K for your reply.

main Problem I had was exactly NamedSelectionWorksheetCriterion.Name. I could not find anything on Internet or any official documentation.
 
Thank you very much L_K. It works great.

I don't have access to customer portal currently but "NameProperty" was enough to solve my problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor