Show / Hide Table of Contents

Class ConstructAction

Base class for construct actions.

Inheritance
System.Object
Action
ConstructAction
ConstrDefaults
ConstrHatchInside
ConstructAngleTwoPoints
ConstructDirectionOfCurve
ConstructDirectionOfSurface
ConstructDirectionTwoPoints
ConstructDistanceOfCurve
ConstructDistancePointCurve
ConstructDistanceTwoCurves
ConstructDistanceTwoPoints
ConstructIntersectPoint
ConstructMidPoint
ConstructObjectPoint
ConstructPlane
ConstructPlane2PointsDrawingPlane
ConstructPlaneOriginNormalPoint
ConstructPolarPoint
ConstructVectorPoint
CopyCircularObjects
CopyMatrixObjects
Measure
Implements
ICommandHandler
IPropertyEntry
Inherited Members
Action.MenuId
Action.IgnoreForSnap
Action.ViewType
Action.OnlyThisModel
Action.OnlyThisView
Action.IsActive
Action.CurrentMouseView
Action.GetID()
Action.UseFilter
Action.WorksOnLayoutView
Action.OnDisplayChanged(DisplayChangeArg)
Action.OnMouseEnter(EventArgs, IView)
Action.OnMouseHover(EventArgs, IView)
Action.OnMouseWheel(MouseEventArgs, IView)
Action.OnDelete()
Action.OnDelete(Object)
Action.AutoRepeated()
Action.Frame
Action.AutoCursor
Action.ChangeTabInControlCenter
Action.SetCursor(SnapPointFinder.DidSnapModes, IView)
Action.SetCursor(SnapPointFinder.DidSnapModes, String)
Action.WorldPoint(Point)
Action.WorldPoint(MouseEventArgs, IView)
Action.WorldPoint(GeoPoint2D)
Action.WorldLength(Double)
Action.WorldDirection(Angle)
Action.ActiveDrawingPlane
Action.CurveHitTest(ICurve, Point)
Action.GetObjectsUnderCursor(Point)
Action.RemoveThisAction()
Action.PreviousAction
Action.OnSelected(MenuWithHandler, Boolean)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CADability.Actions
Assembly: CADability.dll
Syntax
public abstract class ConstructAction : Action, ICommandHandler, IPropertyEntry

Constructors

| Improve this Doc View Source

ConstructAction()

Initializes some properties. Set the properties you need in your constructor.

Declaration
protected ConstructAction()

Fields

| Improve this Doc View Source

CurrentMousePoint

The current mouse position for this action

Declaration
public Point CurrentMousePoint
Field Value
Type Description
System.Drawing.Point
| Improve this Doc View Source

MultiSolution

The ConstructAction may have several solutions. If set to true, the PgUp/PgDown key will call OnDifferentSolution and the context menue will have appropriate entries.

Declaration
public bool MultiSolution
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

MultiSolutionCount

TheConstruction may have several solutions. If set to a value !=0 the ContextMenu will have that number of entries and OnSolution() will be called if the user selects one of these

Declaration
public int MultiSolutionCount
Field Value
Type Description
System.Int32
| Improve this Doc View Source

ShowAttributes

Display the attributes of the active object.

Declaration
public bool ShowAttributes
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

TitleId

The title id (resource id) for the title of the action in the control center

Declaration
public string TitleId
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

ActiveObject

Dieses Objekt wird über der Zeichnung dargestellt. Kann auch auf null gesetzt werden um kein Objekt (mehr) darzustallen. Mehrere Objekte können nur als Block dargestellt werden.

Declaration
public IGeoObject ActiveObject { get; set; }
Property Value
Type Description
IGeoObject
| Improve this Doc View Source

BasePoint

Sets the BasePoint. This point is needed for some snap modes like the orthogonal snap mode or snap to tangent point. As long as this point is not set, these snap modes don't work.

Declaration
public GeoPoint BasePoint { get; set; }
Property Value
Type Description
GeoPoint
| Improve this Doc View Source

CurrentInput

Declaration
protected object CurrentInput { get; }
Property Value
Type Description
System.Object
| Improve this Doc View Source

CurrentMousePosition

returns the last mouse position in model coordinates.

Declaration
public GeoPoint CurrentMousePosition { get; }
Property Value
Type Description
GeoPoint
| Improve this Doc View Source

DisassembleBlock

Declaration
public bool DisassembleBlock { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

FeedBack

Gets the container that handles feedback objects (see ActionFeedBack).

Declaration
public ActionFeedBack FeedBack { get; }
Property Value
Type Description
ActionFeedBack
| Improve this Doc View Source

IsBackgroundTaskActive

Declaration
protected bool IsBackgroundTaskActive { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

LastSnapMode

Returns the last snap mode, i.e. the reason why the snap took place. E.g. did snap to an endpoint or did snap to the surface of a face.

Declaration
public SnapPointFinder.DidSnapModes LastSnapMode { get; }
Property Value
Type Description
SnapPointFinder.DidSnapModes
| Improve this Doc View Source

LastSnapObject

Returns the GeoObject which was involved in the last snap operation. May be null;

Declaration
public IGeoObject LastSnapObject { get; }
Property Value
Type Description
IGeoObject
| Improve this Doc View Source

ShowActiveObject

Switches the display of the ActiveObject on and off.

Declaration
public bool ShowActiveObject { get; set; }
Property Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

AutoRepeat()

Detremins whether this action supports autorepeat. Autorepeat is enabled in the GlobalSettings.

Declaration
public override bool AutoRepeat()
Returns
Type Description
System.Boolean
Overrides
Action.AutoRepeat()
| Improve this Doc View Source

CancelBackgroundTask()

Declaration
protected void CancelBackgroundTask()
| Improve this Doc View Source

ClearBasePoint()

Clears the BasePoint.

Declaration
public void ClearBasePoint()
| Improve this Doc View Source

FindShape(GeoPoint, Plane)

Tries to find a CompoundShape that encloses the point p on the plane plane.

Declaration
public CompoundShape FindShape(GeoPoint p, Plane plane)
Parameters
Type Name Description
GeoPoint p

Point in the inside of the requested shape

Plane plane

Plane in which the search should happen

Returns
Type Description
CompoundShape

A shape or null

| Improve this Doc View Source

FindTangentialPoint(MouseEventArgs, IView, out GeoPoint)

Additional posibility for the derived action to specify a tangential point besides the tangential point from the base point

Declaration
protected virtual bool FindTangentialPoint(MouseEventArgs e, IView vw, out GeoPoint found)
Parameters
Type Name Description
MouseEventArgs e
IView vw
GeoPoint found
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Finish()

Explicitly finish this action. OnDone will be called.

Declaration
protected void Finish()
| Improve this Doc View Source

KeepAsLastStyle(IGeoObject)

Sets the Styleof the provided GeoObject go as the last style. If new objects are created with construct method and last style is used, this style will be used.

Declaration
protected virtual void KeepAsLastStyle(IGeoObject go)
Parameters
Type Name Description
IGeoObject go

Object to get the style from

| Improve this Doc View Source

MayFinish()

Declaration
protected virtual bool MayFinish()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OnActivate(Action, Boolean)

Implements OnActivate(Action, Boolean). If you override this method don't forget to call the base implementation.

Declaration
public override void OnActivate(Action OldActiveAction, bool SettingAction)
Parameters
Type Name Description
Action OldActiveAction
System.Boolean SettingAction
Overrides
Action.OnActivate(Action, Boolean)
| Improve this Doc View Source

OnCommand(String)

Handles a few context menu commands. Don't forget to call the base implementation if you override this method. See ICommandHandler.

Declaration
public override bool OnCommand(string MenuId)
Parameters
Type Name Description
System.String MenuId
Returns
Type Description
System.Boolean
Overrides
Action.OnCommand(String)
| Improve this Doc View Source

OnDifferentSolution(Boolean)

Will be called when MultiSolution is true and the user presses the PgUp/PgDown key or selects the appropriate entries of the context menu. Override this method to implement a multi-solution construction. Default implementation is empty.

Declaration
public virtual void OnDifferentSolution(bool next)
Parameters
Type Name Description
System.Boolean next

true: forward, false: backward

| Improve this Doc View Source

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) to the active model and removes this action. Override this method if you need a different behaviour.

Declaration
public virtual void OnDone()
| Improve this Doc View Source

OnEnter()

Overrides OnEnter()

Declaration
public override bool OnEnter()
Returns
Type Description
System.Boolean
Overrides
Action.OnEnter()
| Improve this Doc View Source

OnEnter(Object)

Overrides OnEnter(). Usually you don't override this method, but handle the appropriate events of the input objects.

Declaration
public override bool OnEnter(object sender)
Parameters
Type Name Description
System.Object sender
Returns
Type Description
System.Boolean
Overrides
Action.OnEnter(Object)
| Improve this Doc View Source

OnEscape()

Overrides OnEscape()

Declaration
public override bool OnEscape()
Returns
Type Description
System.Boolean
Overrides
Action.OnEscape()
| Improve this Doc View Source

OnEscape(Object)

Overrides OnEscape(). Usually you don't override this method, but handle the appropriate events of the input objects.

Declaration
public override bool OnEscape(object sender)
Parameters
Type Name Description
System.Object sender
Returns
Type Description
System.Boolean
Overrides
Action.OnEscape(Object)
| Improve this Doc View Source

OnInactivate(Action, Boolean)

Implements OnInactivate(Action, Boolean). If you override this method don't forget to call the bas implementation.

Declaration
public override void OnInactivate(Action NewActiveAction, bool RemovingAction)
Parameters
Type Name Description
Action NewActiveAction

Action.OnInactivate.NewActiveAction.OnInactivate.NewActiveAction

System.Boolean RemovingAction

Action.OnInactivate.RemovingAction.OnInactivate.RemovingAction

Overrides
Action.OnInactivate(Action, Boolean)
| Improve this Doc View Source

OnMouseDown(MouseEventArgs, IView)

Implements OnMouseDown(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.

Declaration
public override void OnMouseDown(MouseEventArgs e, IView vw)
Parameters
Type Name Description
MouseEventArgs e

Action.OnMouseDown.e.OnMouseDown.e

IView vw

Action.OnMouseDown.vw.OnMouseDown.vw

Overrides
Action.OnMouseDown(MouseEventArgs, IView)
| Improve this Doc View Source

OnMouseLeave(EventArgs, IView)

Overrides OnMouseLeave(EventArgs, IView). Usually you don't override this method, but handle the appropriate events of the input objects.

Declaration
public override void OnMouseLeave(EventArgs e, IView vw)
Parameters
Type Name Description
System.EventArgs e
IView vw
Overrides
Action.OnMouseLeave(EventArgs, IView)
| Improve this Doc View Source

OnMouseMove(MouseEventArgs, IView)

Implements OnMouseMove(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.

Declaration
public override void OnMouseMove(MouseEventArgs e, IView vw)
Parameters
Type Name Description
MouseEventArgs e

Action.OnMouseMove.e.OnMouseMove.e

IView vw

Action.OnMouseMove.vw.OnMouseMove.vw

Overrides
Action.OnMouseMove(MouseEventArgs, IView)
| Improve this Doc View Source

OnMouseUp(MouseEventArgs, IView)

Implements OnMouseUp(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.

Declaration
public override void OnMouseUp(MouseEventArgs e, IView vw)
Parameters
Type Name Description
MouseEventArgs e

Action.OnMouseUp.e.OnMouseUp.e

IView vw

Action.OnMouseUp.vw.OnMouseUp.vw

Overrides
Action.OnMouseUp(MouseEventArgs, IView)
| Improve this Doc View Source

OnRemoveAction()

Implements OnRemoveAction(). If you override this method don't forget to call the bas implementation.

Declaration
public override void OnRemoveAction()
Overrides
Action.OnRemoveAction()
| Improve this Doc View Source

OnSetAction()

Implements OnSetAction(). If you override this method don't forget to call the base implementation.

Declaration
public override void OnSetAction()
Overrides
Action.OnSetAction()
| Improve this Doc View Source

OnSolution(Int32)

Will be called when MultiSolution is true and the user presses the PgUp/PgDown key or selects the appropriate entries of the context menu. Override this method to implement a multi-solution construction. Default implementation is empty.

Declaration
public virtual void OnSolution(int solutionNumber)
Parameters
Type Name Description
System.Int32 solutionNumber

the 0-based number of solution

| Improve this Doc View Source

OnTab(Object)

The tab key was pressed: select the next input field, also accept optional fields

Declaration
public override bool OnTab(object sender)
Parameters
Type Name Description
System.Object sender
Returns
Type Description
System.Boolean
Overrides
Action.OnTab(Object)
| Improve this Doc View Source

OnUpdateCommand(String, CommandState)

Overrides OnUpdateCommand(String, CommandState)

Declaration
public override bool OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
Type Name Description
System.String MenuId
CommandState CommandState
Returns
Type Description
System.Boolean
Overrides
Action.OnUpdateCommand(String, CommandState)
| Improve this Doc View Source

OnViewsChanged()

Implements OnViewsChanged(). This implementation aborts the action.

Declaration
public override void OnViewsChanged()
Overrides
Action.OnViewsChanged()
| Improve this Doc View Source

SetFocus(Object, Boolean)

Sets the input focus to the given input object. The input object must be one of those given in the SetInput(Object[]) method.

Declaration
public void SetFocus(object InputObject, bool ActivateMouse)
Parameters
Type Name Description
System.Object InputObject

Input object which should become active

System.Boolean ActivateMouse

Mouse actions also apply to this input object

| Improve this Doc View Source

SetInput(Object[])

Call this method in an override to OnSetAction() to specify the input parameters of this action. Objects given as parameters may be any of ConstructAction.AngleInput, ConstructAction.LengthInput, ConstructAction.DoubleInput, ConstructAction.GeoPointInput, ConstructAction.GeoVectorInput, ConstructAction.BooleanInput, ConstructAction.MultiPointInput, ConstructAction.GeoObjectInput, ConstructAction.PlaneInput.

Declaration
public void SetInput(params object[] TheInput)
Parameters
Type Name Description
System.Object[] TheInput

Objects specifying the input parameters of this action

| Improve this Doc View Source

SnapPoint(MouseEventArgs, GeoPoint, IView, out SnapPointFinder.DidSnapModes)

Declaration
public virtual GeoPoint SnapPoint(MouseEventArgs e, GeoPoint basePoint, IView vw, out SnapPointFinder.DidSnapModes DidSnap)
Parameters
Type Name Description
MouseEventArgs e
GeoPoint basePoint
IView vw
SnapPointFinder.DidSnapModes DidSnap
Returns
Type Description
GeoPoint
| Improve this Doc View Source

SnapPoint(MouseEventArgs, IView, out SnapPointFinder.DidSnapModes)

Gets a point from the MouseEventArgs and the view. The point will be in the appropriate model and will be snapped according to the views snap setting.

Declaration
public virtual GeoPoint SnapPoint(MouseEventArgs e, IView vw, out SnapPointFinder.DidSnapModes DidSnap)
Parameters
Type Name Description
MouseEventArgs e

MouseEventArgs with the mouse position

IView vw

the view

SnapPointFinder.DidSnapModes DidSnap
Returns
Type Description
GeoPoint

point in model space

| Improve this Doc View Source

StartBackgroundTask(Delegate, Delegate, Object[])

Declaration
protected void StartBackgroundTask(Delegate MethodToInvoke, Delegate CallbackOnDone, params object[] invokeParameters)
Parameters
Type Name Description
System.Delegate MethodToInvoke
System.Delegate CallbackOnDone
System.Object[] invokeParameters
| Improve this Doc View Source

WaitForBackgroundTask()

Declaration
protected void WaitForBackgroundTask()

Events

| Improve this Doc View Source

ActionDoneEvent

Event that is fired when this action is done. If your class is derived from ConstructAction you better override OnDone().

Declaration
public event ConstructAction.ActionDoneDelegate ActionDoneEvent
Event Type
Type Description
ConstructAction.ActionDoneDelegate
| Improve this Doc View Source

StateChangedEvent

Declaration
public event PropertyEntryChangedStateDelegate StateChangedEvent
Event Type
Type Description
PropertyEntryChangedStateDelegate

Explicit Interface Implementations

| Improve this Doc View Source

IPropertyEntry.Added(IPropertyPage)

Declaration
void IPropertyEntry.Added(IPropertyPage pp)
Parameters
Type Name Description
IPropertyPage pp
| Improve this Doc View Source

IPropertyEntry.ButtonClicked(PropertyEntryButton)

Declaration
void IPropertyEntry.ButtonClicked(PropertyEntryButton button)
Parameters
Type Name Description
PropertyEntryButton button
| Improve this Doc View Source

IPropertyEntry.ContextMenu

Declaration
MenuWithHandler[] IPropertyEntry.ContextMenu { get; }
Returns
Type Description
MenuWithHandler[]
| Improve this Doc View Source

IPropertyEntry.DeferUpdate

Declaration
bool IPropertyEntry.DeferUpdate { get; set; }
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IPropertyEntry.EditTextChanged(String)

Declaration
bool IPropertyEntry.EditTextChanged(string newValue)
Parameters
Type Name Description
System.String newValue
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IPropertyEntry.EndEdit(Boolean, Boolean, String)

Declaration
void IPropertyEntry.EndEdit(bool aborted, bool modified, string newValue)
Parameters
Type Name Description
System.Boolean aborted
System.Boolean modified
System.String newValue
| Improve this Doc View Source

IPropertyEntry.Flags

Declaration
PropertyEntryType IPropertyEntry.Flags { get; }
Returns
Type Description
PropertyEntryType
| Improve this Doc View Source

IPropertyEntry.GetDropDownList()

Declaration
string[] IPropertyEntry.GetDropDownList()
Returns
Type Description
System.String[]
| Improve this Doc View Source

IPropertyEntry.IndentLevel

Declaration
int IPropertyEntry.IndentLevel { get; set; }
Returns
Type Description
System.Int32
| Improve this Doc View Source

IPropertyEntry.Index

Declaration
int IPropertyEntry.Index { get; set; }
Returns
Type Description
System.Int32
| Improve this Doc View Source

IPropertyEntry.IsOpen

Declaration
bool IPropertyEntry.IsOpen { get; set; }
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IPropertyEntry.Label

Declaration
string IPropertyEntry.Label { get; }
Returns
Type Description
System.String
| Improve this Doc View Source

IPropertyEntry.ListBoxSelected(Int32)

Declaration
void IPropertyEntry.ListBoxSelected(int selectedIndex)
Parameters
Type Name Description
System.Int32 selectedIndex
| Improve this Doc View Source

IPropertyEntry.Opened(Boolean)

Declaration
void IPropertyEntry.Opened(bool isOpen)
Parameters
Type Name Description
System.Boolean isOpen
| Improve this Doc View Source

IPropertyEntry.OpenOrCloseSubEntries()

Declaration
int IPropertyEntry.OpenOrCloseSubEntries()
Returns
Type Description
System.Int32
| Improve this Doc View Source

IPropertyEntry.Parent

Declaration
object IPropertyEntry.Parent { get; set; }
Returns
Type Description
System.Object
| Improve this Doc View Source

IPropertyEntry.PropertyEntryChangedStateEvent

Declaration
event PropertyEntryChangedStateDelegate IPropertyEntry.PropertyEntryChangedStateEvent
Returns
Type Description
PropertyEntryChangedStateDelegate
| Improve this Doc View Source

IPropertyEntry.ReadOnly

Declaration
bool IPropertyEntry.ReadOnly { get; set; }
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IPropertyEntry.Removed(IPropertyPage)

Declaration
void IPropertyEntry.Removed(IPropertyPage pp)
Parameters
Type Name Description
IPropertyPage pp
| Improve this Doc View Source

IPropertyEntry.ResourceId

Declaration
string IPropertyEntry.ResourceId { get; }
Returns
Type Description
System.String
| Improve this Doc View Source

IPropertyEntry.Select()

Declaration
void IPropertyEntry.Select()
| Improve this Doc View Source

IPropertyEntry.Selected(IPropertyEntry)

Declaration
void IPropertyEntry.Selected(IPropertyEntry previousSelected)
Parameters
Type Name Description
IPropertyEntry previousSelected
| Improve this Doc View Source

IPropertyEntry.StartEdit(Boolean)

Declaration
void IPropertyEntry.StartEdit(bool editValue)
Parameters
Type Name Description
System.Boolean editValue
| Improve this Doc View Source

IPropertyEntry.SubItems

Declaration
IPropertyEntry[] IPropertyEntry.SubItems { get; }
Returns
Type Description
IPropertyEntry[]
| Improve this Doc View Source

IPropertyEntry.UnSelected(IPropertyEntry)

Declaration
void IPropertyEntry.UnSelected(IPropertyEntry nowSelected)
Parameters
Type Name Description
IPropertyEntry nowSelected
| Improve this Doc View Source

IPropertyEntry.Value

Declaration
string IPropertyEntry.Value { get; }
Returns
Type Description
System.String

Implements

ICommandHandler
IPropertyEntry
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX