Method AddPointParameter
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddPointParameter(string, string, GeoPoint3)
Makes the block dynamic, where it is not, and gives it a point parameter: a position that each INSERT of the block shows as two dynamic properties, the parameter's name with " X" and " Y" after it, AutoCAD's Point parameter as its Block Editor makes one. Tie the parameter to the entities it moves with AddMoveAction(DxfBlockPointParameter, IEnumerable<DxfEntity>).
public DxfBlockPointParameter AddPointParameter(string name, string description, GeoPoint3 location)
Parameters
namestringThe label of the parameter, as Tag: the properties are named Tag X and Tag Y.
descriptionstringThe description of both properties; null or empty for none.
locationGeoPoint3The position, in the block's coordinates, where the parameter's grip stands.
Returns
- DxfBlockPointParameter
The parameter, as written.
Remarks
A tag circle of the radius 5 at (80, 20) in a rectangle 100 by 50, given AddPointParameter("Tag", "Where the tag
stands", new GeoPoint3(80, 20, 0)) and a move action of the circle, gives every INSERT the properties Tag X of 80
and Tag Y of 20; Tag X set to 120 moves the circle's centre to (120, 20).
The parameter is written as AutoCAD saved the point parameter of ACadSharp's sample: the parameter (its element named Point, the next Point1 and on) with its label at the position, its grip (an XY grip) and the grip's two location components, four nodes of the evaluation graph and three edges; the block is made dynamic as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) makes it.
Exceptions
- ArgumentNullException
Thrown when the name is null.
- ArgumentException
Thrown when the name is empty, the name or the description holds a line break, or a coordinate of the location is not a finite number. 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 parameter, as AddLinearParameter(string, string, GeoPoint3, GeoPoint3, double, DxfBlockParameterValueSet) says. Nothing is written then.