Class ParametricsCenterAction
- Namespace
- CADability.Actions
- Assembly
- CADability.dll
Interactive parametric modification of a solid: a set of faces of a shell (e.g. a hole or a boss) is moved so that it is centered between other faces, edges or vertices of the shell which the user picks; a ratio other than 0.5 places it at that fraction of the distance. Optionally a named ParametricCenterProperty is added to the shell so that the relation is kept when other parametrics are applied. Created with the faces to center and started from the context menu of the selected faces ("MenuId.Center"); when finished, the solid is replaced in the model by the modified one. Its id is "Constr.Parametrics.Center".
public class ParametricsCenterAction : ConstructAction, ICommandHandler, IPropertyEntry
- Inheritance
-
ParametricsCenterAction
- Implements
- Inherited Members
Constructors
ParametricsCenterAction(IEnumerable<Face>)
public ParametricsCenterAction(IEnumerable<Face> faces)
Parameters
facesIEnumerable<Face>
Fields
centerOntoObjects
public HashSet<object> centerOntoObjects
Field Value
centerPosition
public object centerPosition
Field Value
facesToBeCentered
public HashSet<Face> facesToBeCentered
Field Value
shell
public Shell shell
Field Value
Methods
GetID()
Must be implemented by derived class. Returns an identification string. All CADability actions return the unique strings like "Draw.Line.TwoPoints" or "Zoom"
public override string GetID()
Returns
- string
the identification of the action
GetTranslationForCentering(IEnumerable<Face>, object, IEnumerable<object>, double)
public static GeoVector GetTranslationForCentering(IEnumerable<Face> facesToBeCentered, object centerPosition, IEnumerable<object> centerOntoObjects, double ratio)
Parameters
facesToBeCenteredIEnumerable<Face>centerPositionobjectcenterOntoObjectsIEnumerable<object>ratiodouble
Returns
OnDone()
Called, when the ConstructAction is done, i.e. all non-optional inputs have been fixed. The default implementation adds the active object (if it exists and HasValidData() returns true) to the active model and removes this action. Override this method if you need a different behaviour.
public override void OnDone()
OnSetAction()
Implements OnSetAction(). If you override this method don't forget to call the base implementation.
public override void OnSetAction()