Method AddMoveAction
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>)
Gives the block a move action tied to a linear parameter of it, AutoCAD's Move action as its Block Editor makes one: as the parameter's distance grows by an amount, the entities move whole by that amount along the line from the parameter's base point to its end point, following the end point.
public void AddMoveAction(DxfBlockLinearParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockLinearParameterThe parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
Remarks
A rectangle 100 by 50 whose Width runs from (0, 0, 0) to (100, 0, 0), given a move action of a circle at (90, 25), moves the circle to (190, 25) as Width is set to 200, while a stretch of the right edge takes the edge to x = 200. The action is written as AutoCAD writes one: the entities it moves, its connections EndXDelta and EndYDelta, the distance multiplier 1 and the angle offset nought, and the edge from the parameter in the evaluation graph; its element is named Move, the next Move1 and on. An entity given twice is taken once. An attribute definition locked in the block (LockPositionInBlock) moves with the rest, and each INSERT's ATTRIB of its tag with it, by the move its INSERT's placing gives: MARK at (100, 10) stands at (150, 10) as Width is set from 100 to 150, and an INSERT turned a quarter turn at the scale 2, whose Width reads 200, takes its MARK 50 down along y as Width is set to 150, as AutoCAD 2021 moved them (check D30). AutoCAD left one not locked where it was, and the library refuses it, as AutoCAD's Block Editor does.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown when the parameter is of another block or no longer in its graph, there are no entities, or an entity is not of this block, is erased, is an attribute definition not locked in the block, or is of a type the library keeps as it is (DxfUnknownEntity, and an OLE2FRAME, which it does not move yet). Nothing is written then.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown when the block has a flip action, or an entity is also copied by an array action or turned by a polar stretch, or turned or scaled by a rotate or a scale action: AutoCAD 2021 worked a flip with a stretch out from each INSERT's last state and did not flip an INSERT of such a block itself (plugins v20 and v20b), and stretched a line it turned or scaled from where its last set left it (plugin v21, 24e-g). Nothing is written then.
AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>, double, double)
Gives the block a move action tied to a linear parameter of it, as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) does, of a distance multiplier and an angle offset, AutoCAD's Distance Multiplier and Angle Offset of the action: the entities move by the change of the parameter's end point times the multiplier, turned by the offset.
public void AddMoveAction(DxfBlockLinearParameter parameter, IEnumerable<DxfEntity> entities, double distanceMultiplier, double angleOffset)
Parameters
parameterDxfBlockLinearParameterThe parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
distanceMultiplierdoubleWhat the change of the end point is multiplied by, a finite number: 0.5 moves the entities half as far, keeping a mark in the middle of a stretched panel; 1 as far.
angleOffsetdoubleThe angle the move is turned by, counter-clockwise in radians, a finite number: Math.PI / 2 turns a move along x to one along y; nought keeps it.
Remarks
A circle at (50, 25), the middle of a rectangle 100 by 50 whose Width runs from (0, 0, 0) to (100, 0, 0), moved of the multiplier 0.5 stands at (100, 25), the middle still, when Width is set to 200; of the multiplier 1 and the offset Math.PI / 2 it stands at (50, 125). The multiplier and the offset are written as AutoCAD writes them (140 and 141 of the action); 1 and nought write the action the overload of none writes.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- ArgumentOutOfRangeException
Thrown when the multiplier or the offset is not a finite number.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockPointParameter, IEnumerable<DxfEntity>)
Gives the block a move action tied to a point parameter of it, AutoCAD's Move action as its Block Editor makes one: the entities move whole as the parameter's position moves.
public void AddMoveAction(DxfBlockPointParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockPointParameterThe point parameter of this block the action follows.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
Remarks
A tag circle at (80, 20) whose point parameter Tag stands at its centre moves to (120, 35) as Tag X is set to 120 and Tag Y to 35. The action is written as AutoCAD saved the move of ACadSharp's point sample: the entities it moves, its connections XDelta and YDelta, the distance multiplier 1 and the angle offset nought; its element named Move. AutoCAD's sample also lists the parameter's own grip among what it moves; such a block, of AutoCAD's or the user's, is worked out by Value as the grip follows its parameter anyway, and the library writes the entities only, as AutoCAD 2021 read them (plugin v20).
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockPointParameter, IEnumerable<DxfEntity>, double, double)
Gives the block a move action tied to a point parameter of it, as AddMoveAction(DxfBlockPointParameter, IEnumerable<DxfEntity>) does, of a distance multiplier and an angle offset: the entities move by the move of the parameter's position times the multiplier, turned by the offset.
public void AddMoveAction(DxfBlockPointParameter parameter, IEnumerable<DxfEntity> entities, double distanceMultiplier, double angleOffset)
Parameters
parameterDxfBlockPointParameterThe point parameter of this block the action follows.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
distanceMultiplierdoubleWhat the move of the position is multiplied by, a finite number; 1 as far.
angleOffsetdoubleThe angle the move is turned by, counter-clockwise in radians, a finite number; nought keeps it.
Remarks
A circle at (80, 20) moved of the multiplier 0.5 by a Tag at (80, 20) stands at (100, 20) when Tag X is set to 120.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- ArgumentOutOfRangeException
Thrown when the multiplier or the offset is not a finite number.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockXYParameter, IEnumerable<DxfEntity>)
Gives the block a move action tied to an XY parameter of it, AutoCAD's Move action of the XY type as its Block Editor makes one: the entities move whole with the parameter's end point, along x and along y.
public void AddMoveAction(DxfBlockXYParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockXYParameterThe XY parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
Remarks
A circle at the top right corner (100, 50) of a rectangle whose XY parameter runs from (0, 0, 0) to (100, 50, 0) moves to (160, 80) as Width is set to 160 and Depth to 80. The action is written as the move of a linear parameter is, its connections EndXDelta and EndYDelta of the XY parameter, of the XY type (280 of nought).
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockXYParameter, IEnumerable<DxfEntity>, double, double)
Gives the block a move action tied to an XY parameter of it, as AddMoveAction(DxfBlockXYParameter, IEnumerable<DxfEntity>) does, of a distance multiplier and an angle offset: the entities move by the move of the parameter's end point times the multiplier, turned by the offset.
public void AddMoveAction(DxfBlockXYParameter parameter, IEnumerable<DxfEntity> entities, double distanceMultiplier, double angleOffset)
Parameters
parameterDxfBlockXYParameterThe XY parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
distanceMultiplierdoubleWhat the move of the end point is multiplied by, a finite number; 1 as far.
angleOffsetdoubleThe angle the move is turned by, counter-clockwise in radians, a finite number; nought keeps it.
Remarks
A circle at (50, 25), the middle of a rectangle whose XY parameter runs from (0, 0, 0) to (100, 50, 0), moved of the multiplier 0.5 stands at (80, 40), the middle still, when Width is set to 160 and Depth to 80.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- ArgumentOutOfRangeException
Thrown when the multiplier or the offset is not a finite number.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockPolarParameter, IEnumerable<DxfEntity>)
Gives the block a move action tied to a polar parameter of it, AutoCAD's Move action as its Block Editor makes one on a polar parameter: the entities move whole with the parameter's end point, along x and along y, unturned.
public void AddMoveAction(DxfBlockPolarParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockPolarParameterThe polar parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
Remarks
A circle at the end point (100, 0) of a polar parameter from (0, 0, 0) moves to (0, 150) as Length is set to 150 and Angle to a quarter turn, and a text at (95, 3) by it to (-5, 153), unturned, as AutoCAD 2021 moved them (plugin D25b). The action is written as the move of a linear parameter is, its connections EndXDelta and EndYDelta of the polar parameter.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
AddMoveAction(DxfBlockPolarParameter, IEnumerable<DxfEntity>, double, double)
Gives the block a move action tied to a polar parameter of it, as AddMoveAction(DxfBlockPolarParameter, IEnumerable<DxfEntity>) does, of a distance multiplier and an angle offset: the entities move by the move of the parameter's end point times the multiplier, turned by the offset.
public void AddMoveAction(DxfBlockPolarParameter parameter, IEnumerable<DxfEntity> entities, double distanceMultiplier, double angleOffset)
Parameters
parameterDxfBlockPolarParameterThe polar parameter of this block the action follows, by its end point.
entitiesIEnumerable<DxfEntity>The entities of the block to move.
distanceMultiplierdoubleWhat the move of the end point is multiplied by, a finite number; 1 as far.
angleOffsetdoubleThe angle the move is turned by, counter-clockwise in radians, a finite number; nought keeps it.
Remarks
A circle at (50, 0), halfway along a polar parameter from (0, 0, 0) to (100, 0, 0), moved of the multiplier 0.5 stands at (0, 75), halfway still, when Length is set to 150 and Angle to a quarter turn.
Exceptions
- ArgumentNullException
Thrown when the parameter, the entities or one of them is null.
- ArgumentException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.
- ArgumentOutOfRangeException
Thrown when the multiplier or the offset is not a finite number.
- InvalidOperationException
Thrown when the block cannot be dynamic, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says.
- NotSupportedException
Thrown as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says. Nothing is written then.