Method AddScaleAction
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddScaleAction(DxfBlockLinearParameter, IEnumerable<DxfEntity>)
Gives the block a scale action tied to a linear parameter of it, AutoCAD's Scale action as its Block Editor makes one: the entities are scaled alike in every direction about the parameter's base point, by the parameter's distance over the block's own.
public void AddScaleAction(DxfBlockLinearParameter parameter, IEnumerable<DxfEntity> entities)
Parameters
parameterDxfBlockLinearParameterThe parameter of this block the action follows.
entitiesIEnumerable<DxfEntity>The entities of the block to scale.
Remarks
A circle of the radius 25 at (50, 25) whose block has a Size from (0, 0, 0) to (100, 0, 0) is scaled by 2 about the origin as Size is set to 200: its centre goes to (100, 50) and its radius to 50. The action is written as AutoCAD saved the scale of ACadSharp's linear sample: the entities it scales, its base the parameter's base point (dependent, of no offset), its connections Scale, XScale and YScale; its element named Scale. An entity given twice is taken once; one a stretch or a move holds is not scaled, either way round. An attribute definition locked in the block (LockPositionInBlock) is scaled too, its height with it, and each INSERT's ATTRIB of its tag: LEFT at (100, 10), 5 high, stands at (150, 15), 7.5 high, as Size is set from 100 to 150, as AutoCAD 2021 scaled 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 scaled a line it also stretched from where its last set left it, to (40, 20)-(180, 20) for a Width of 140 set after 120 where the block's values give (40, 20)-(200, 20) (plugin v21, 24e-g). Nothing is written then.