TAGGED: act, mechanical
-
-
October 2, 2023 at 2:54 pmAnezka.MichalkovaSubscriber
I am trying to create an ACT which defines load. The user would choose geometry with scoping. The ACT would then make named selection from the chosen geometry (which would be face or multiple faces for example). Then using worksheet, other named selection would be created, selecting all elements which belong to the first name selection. The element named selection would be then used for applying the load with APDL commands (sfe). I have this code
scoping = load.Properties ["Geometry"].ValueselectedIds = scoping.IdsExtAPI.SelectionManager.ClearSelection()mySel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)mySel.Ids = selectedIdsarea = ExtAPI.DataModel.Project.Model.AddNamedSelection()area.Location = mySelarea.Name = "load_area"elements = ExtAPI.DataModel.Project.Model.AddNamedSelection()
elements.Name = "elements"elements.ScopingMethod = GeometryDefineByType.Worksheetcriteria = elements.GenerationCriteria# First rowcriteria.Add(None)criterion_1 = criteria[0]criterion_1.EntityType = SelectionType.GeoFacecriterion_1.Criterion = SelectionCriterionType.NamedSelectioncriterion_1.Operator = SelectionOperatorType.Equalcriterion_1.Value = area# Second rowcriteria.Add(None)criterion_2 = criteria[1]criterion_2.Action = SelectionActionType.Convertcriterion_2.EntityType = SelectionType.MeshElementelements.Generate()
when I run this code in Mechanical, it works just fine but when the code is run inside the ACT, it does not work. It creates the first named selection but then there is an error (ValueError: This property is parameterized and is read-only.) at the lineelements.ScopingMethod = GeometryDefineByType.WorksheetWhat is the problem and how can I resolve it?
The same problem was happening also when I tried to create nodal named selection like this:area = ExtAPI.DataModel.Project.Model.AddNamedSelection()area.Location = mySelarea.Name = "load_area"area.CreateNodalNamedSelection()
Again, was working fine in Mechanical scripting, does not work when run in ACT. -
October 3, 2023 at 8:17 ammjmiddleAnsys Employee
If the ACT object is run as part of the solution being generated, such as a load object under the analysis branch, then the Outline object structure is fixed. It is not allowed to change it at that stage because as the APDL input file is written (generally in the order of Outline objects seen from top-to-bottom) certain Outline objects depend on others such as loads/supports written in certain coordinate systems defined higher. Changing some Outline objects at solution time could invalidate other Outline objects.
With control=”scoping” in the XML, why not just have the user selection a named selection instead of geometry selection? Vertex, edge, face selections create nodal components in APDL while body and element selections cause element components in APDL. So instead of converting to an element named selection, you could enforce body/element selections when “geometry” type is selected for control=”scoping”:
Or document your extension that the user needs to select named selection from the dropdown and select a body or element named selection.
Or use control=”select” to make a manual dropdown and populate the list with only those named selections for which your code has checked are body or element named selections.
Or instead of a "load" use an "object" as a load:
-
October 9, 2023 at 8:45 amAnezka.MichalkovaSubscriber
-
October 11, 2023 at 6:01 ammjmiddleAnsys Employee
I think this is discussed in the Introductory ACT Training in Mechanical course in the Ansys Learning Hub (ALH):
https://www.ansys.com/services/ansys-learning-hub
You should also fnd some usages of it in the ACT Templates:
https://catalog.ansys.com/Developers.cshtml
Also see the "Extension Examples" on that page that are discussed in the ACT Developer's Guide:
https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v232/en/act_dev/act_dev_exampleExtensions.html
You could probably find it in ACT extensions in the Ansys Store also. Any that are free and contain the source code are good instructionals.
-
- The topic ‘Create Mesh Element Named Selection in ACT’ is closed to new replies.
- How to apply Compression-only Support?
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Image to file in Mechanical is bugged and does not show text
- Element has excessive thickness change, distortion, is turning inside out
-
1762
-
635
-
599
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.