Method SetDimAssoc
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
SetDimAssoc(IEnumerable<DxfOsnapPointRef>)
Ties the dimension's points to objects, as AutoCAD 2021 ties a dimension made with DIMASSOC 2 by object snaps: a
DIMASSOC under ACAD_DIMASSOC in the dimension's extension dictionary (made where it has none), owned by the dictionary,
naming the dimension and each reference, and listed among the reactors of the dimension and of every object it names;
the class DIMASSOC listed. A dimension tied already has its DIMASSOC written anew, the same handle, an object it no
longer names losing the reactor. A DIMLINEAR from the start of the line 2A to its end is tied by
dimension.SetDimAssoc(new[] { new DxfOsnapPointRef(0, DxfOsnapType.StartPoint, "2A", 0, 0, start, null), new DxfOsnapPointRef(1, DxfOsnapType.Endpoint, "2A", 0, 1, end, null) }).
The dimension's points are not moved: they are where the references say already.
public DxfDimAssoc SetDimAssoc(IEnumerable<DxfOsnapPointRef> references)
Parameters
referencesIEnumerable<DxfOsnapPointRef>The references, one for each point tied, in any order.
Returns
- DxfDimAssoc
The DIMASSOC.
Exceptions
- ArgumentNullException
Thrown when the references are null.
- ArgumentException
Thrown when there are none, one is null, two tie the same point, or one names an object the drawing has not.
- InvalidOperationException
Thrown when the dimension is in no file, is erased, or its file has no OBJECTS section (R12).