Table of Contents

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

faces IEnumerable<Face>

Fields

centerOntoObjects

public HashSet<object> centerOntoObjects

Field Value

HashSet<object>

centerPosition

public object centerPosition

Field Value

object

facesToBeCentered

public HashSet<Face> facesToBeCentered

Field Value

HashSet<Face>

shell

public Shell shell

Field Value

Shell

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

facesToBeCentered IEnumerable<Face>
centerPosition object
centerOntoObjects IEnumerable<object>
ratio double

Returns

GeoVector

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()