Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

how to define line body using API

Status
Not open for further replies.

sky_world

Mechanical
May 15, 2020
1
0
0
BE
Hello,
I want to create a nameselection with API, but I was not successful to do it. the scripts are shown below:

Model = ExtAPI.DataModel.Project.Model
boltSel=Model.AddNamedSelection()
boltSel.Name="ns_boltFace"
boltSel.Location=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.WorksheetSpecific)
worksheet = boltSel.Location
worksheet.AddRow()
worksheet.SetEntityType(0,NamedSelectionWorksheetEntityType.Body)
worksheet.SetCriterion(0,NamedSelectionWorksheetCriterion.Type)
worksheet.SetOperator(0,NamedSelectionWorksheetOperator.Equal)
[highlight #CC0000]worksheet.SetValue(0,lines[0])[/highlight]
worksheet.Generate()

the last second sentence which I indicated in red has some problem. but I don't know how to define a line body in my script, do you have any ideal to help me?

Thanks,
sky_world
 
Status
Not open for further replies.
Back
Top