Invoking the "control" of properties from scripting.

Is it possible to invoke the "control" callbacks for properties?

For example, instead of getting the current geometry selection and setting the axis on a Rotational Acceleration object, it would be useful to be able to invoke the control for that property.

For example, we are currently doing this:

  1. # It is assumed the user has an edge selected.
  2. axis_location_selection = ExtAPI.SelectionManager.CreateSelectionInfo(Ansys.ACT.Interfaces.Common.SelectionTypeEnum.GeometryEntities)
  3. axis_location_selection.Ids = ExtAPI.SelectionManager.CurrentSelection.Ids
  4. vec = Ansys.Mechanical.Selection.SelectionHelper.CreateVector3D(axis_location_selection, False)
  5. centroid = tuple(axis_location_selection.Entities[0].Centroid)
  6. point = Ansys.Mechanical.Graphics.Point(centroid, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"))
  7. axis_location_vector = Ansys.Mechanical.Math.BoundVector(point,vec)
  8. rotational_acceleration_obj.Axis = axis_location_vector

The downside to this, is you can't specify the direction of the axis. And would either have to change the axis manually, which defeats the point of scripting, or invert the magnitude, a workaround which only applies to this example.

It would be nice if there was some way to invoke the control GUI that appears when clicking on the property. It shows the expected direction and the toggle button.

Something like:

  1. rotaional_acceleratoin_obj.Axis.RunControl()

or perhaps:

  1. rotaional_acceleratoin_obj.Properties[17].RunControl()

Does a solution like this exist?

It is my understanding that this control code is ran in the ACT side by specifying the callback/class with the "control" XML attribute. (The Axis utilizes the GeometryObj class, correct?) But I do not see anyway to invoke this through the Mechanical scripting APIs.

Welcome!

It looks like you're new here. Sign in or register to get started.