sky_world
Mechanical
- May 15, 2020
- 1
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
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