Method AddRotateAction
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddRotateAction(DxfBlockRotationParameter, IEnumerable<DxfEntity>)
Gives the block a rotate action tied to a rotation parameter of it, AutoCAD's Rotate action as its Block Editor makes one: the entities turn about the parameter's base point by the parameter's angle less the block's own.
public void AddRotateAction(DxfBlockRotationParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockRotationParameterThe rotation parameter of this block the action follows.
entitiesIEnumerable<DxfEntity>The entities of the block to turn.
Remarks
An arrow from (50, 25) to (80, 25) whose Angle turns about (50, 25) from nought runs to (50, 55) as Angle is set to Math.PI / 2. The action is written as AutoCAD saved the rotate of ACadSharp's rotation sample: the entities it turns, its base the parameter's base point (dependent, of no offset), its connection AngleDelta; its element named Rotate. An entity given twice is taken once; one a stretch or a move holds is not turned, either way round. An attribute definition locked in the block (LockPositionInBlock) turns too, and each INSERT's ATTRIB of its tag: LEFT at (100, 10), turned about the origin by a quarter turn, stands at (-10, 100), turned a quarter turn, as AutoCAD 2021 turned it (check D30); one not locked is refused, as AddMoveAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>) says.
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 when the block has a flip action, or an entity is also copied by an array action or turned by a polar stretch, or held by a stretch or a move: AutoCAD 2021 stretched a shaft it had turned a quarter turn along x, to (0, 155) for a Reach of 150 set after 200, where the block's values give (50, 105) (plugin v21, 24e-g). Nothing is written then.