Method AddFlipParameter
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
AddFlipParameter(string, string, GeoPoint3, GeoPoint3)
Makes the block dynamic, where it is not, and gives it a flip parameter: a reflection line that each INSERT of the block flips about as the dynamic property of its name says, 0 not flipped and 1 flipped, AutoCAD's Flip parameter as its Block Editor makes one. Tie the parameter to the entities it flips with AddFlipAction(DxfBlockFlipParameter, IEnumerable<DxfEntity>).
public DxfBlockFlipParameter AddFlipParameter(string name, string description, GeoPoint3 basePoint, GeoPoint3 endPoint)
Parameters
namestringThe label of the parameter, the name of the property, as Hand.
descriptionstringThe description of the property; null or empty for none.
basePointGeoPoint3The point the reflection line starts at, in the block's coordinates.
endPointGeoPoint3The point the reflection line runs to.
Returns
- DxfBlockFlipParameter
The parameter, as written.
Remarks
A door leaf from (0, 0) to (90, 0) given AddFlipParameter("Hand", "Which way the door opens", new GeoPoint3(0, 0,
0), new GeoPoint3(0, 50, 0)) and a flip action of the leaf gives every INSERT the property Hand of 0, allowed 0
and 1; set to 1, the leaf is mirrored about the y axis and runs from (0, 0) to (-90, 0).
The parameter is written as AutoCAD saved the flip parameter of ACadSharp's sample: the line from the base point to the end point, its states labelled Not flipped and Flipped, its label and its grip at the end point, the grip's three components (the state, the base point's x and y), five nodes of the evaluation graph and four edges; its element is named Flip.
A flip parameter is the only parameter of its block, either way round: AutoCAD 2021 flipped a door of the flip alone both ways (plugin v20, 24d-g), but set Hand to 1 on the INSERTs of a door that also had a linear parameter of no action, or of a panel whose stretch held other entities, it read 0 back each time and left the leaf as it was (plugins v20b and v21, 24d-i and 24e-h).
Exceptions
- ArgumentNullException
Thrown when the name is null.
- ArgumentException
Thrown when the name is empty, the name or the description holds a line break, a coordinate is not a finite number, or the two points are within the point tolerance of Default of each other seen along z. 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 parameter already, of any kind, a flip among them. Nothing is written then.