• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DomCR / ACadSharp / 14214082189

02 Apr 2025 07:34AM UTC coverage: 75.523% (-0.8%) from 76.343%
14214082189

Pull #457

github

web-flow
Merge b2c68aa3f into 04434c5d6
Pull Request #457: Geometric transform

5606 of 8150 branches covered (68.79%)

Branch coverage included in aggregate %.

282 of 716 new or added lines in 47 files covered. (39.39%)

318 existing lines in 23 files now uncovered.

22348 of 28864 relevant lines covered (77.43%)

72757.24 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/ACadSharp/Entities/MultiLeader.cs
1
using System;
2
using System.Collections.Generic;
3
using ACadSharp.Attributes;
4
using ACadSharp.Objects;
5
using ACadSharp.Tables;
6

7
using CSMath;
8

9

10
namespace ACadSharp.Entities
11
{
12
        /// <summary>
13
        /// Represents a <see cref="MultiLeader"/> entity.
14
        /// </summary>
15
        /// <remarks>
16
        /// Object name <see cref="DxfFileToken.EntityMultiLeader"/> <br/>
17
        /// Dxf class name <see cref="DxfSubclassMarker.MultiLeader"/>
18
        /// </remarks>
19
        [DxfName(DxfFileToken.EntityMultiLeader)]
20
        [DxfSubClass(DxfSubclassMarker.MultiLeader)]
21
        public class MultiLeader : Entity
22
        {
23
                /// <inheritdoc/>
24
                public override ObjectType ObjectType => ObjectType.UNLISTED;
1✔
25

26
                /// <inheritdoc/>
27
                public override string ObjectName => DxfFileToken.EntityMultiLeader;
211✔
28

29
                /// <inheritdoc/>
30
                public override string SubclassMarker => DxfSubclassMarker.MultiLeader;
2✔
31

32
                // TODO
33
                // We omit this class because we assumed that the multileader
34
                // does not have a list of arrow heads associated (see below).
35
                // According to the OpenDesign_Specification_for_.dwg_files
36
                // each arrowhead shall be associated with an IsDefault flag
37
                // having the group code 94. This means the type of the field
38
                // is BL instead of B.
39
                // According to the DXF reference the 94 group code refers to
40
                // the index of the arrow head.
41
                /*
42
                /// <summary>
43
                /// Represents an associated arrow head, with the arrowhead index.
44
                /// </summary>
45
                public class ArrowheadAssociation {
46

47
                        /// <summary>
48
                        /// Arrowhead Index
49
                        /// </summary>
50
                        [DxfCodeValue(94)]
51
                        public int ArrowheadIndex { get; set; }
52

53
                        //        IsDefault property
54

55
                        /// <summary>
56
                        /// Arrowhead ID
57
                        /// </summary>
58
                        [DxfCodeValue(345)]
59
                        public BlockRecord Arrowhead { get; set; }
60
                }
61
                */
62

63

64
                /// <summary>
65
                /// 
66
                /// </summary>
67
                public class BlockAttribute : ICloneable
68
                {
69
                        /// <summary>
70
                        /// Block Attribute Id
71
                        /// </summary>
72
                        [DxfCodeValue(330)]
73
                        public AttributeDefinition AttributeDefinition { get; set; }
×
74

75
                        /// <summary>
76
                        /// Block Attribute Index
77
                        /// </summary>
78
                        [DxfCodeValue(177)]
79
                        public short Index { get; set; }
×
80

81
                        /// <summary>
82
                        /// Block Attribute Width
83
                        /// </summary>
84
                        [DxfCodeValue(44)]
85
                        public double Width { get; set; }
×
86

87
                        /// <summary>
88
                        /// Block Attribute Text String
89
                        /// </summary>
90
                        [DxfCodeValue(302)]
91
                        public string Text { get; set; }
×
92

93
                        public object Clone()
94
                        {
×
95
                                return this.MemberwiseClone();
×
96
                        }
×
97
                }
98

99
                /// <summary>
100
                /// Contains the multileader content (block/text) and the leaders.
101
                /// </summary>
102
                public MultiLeaderAnnotContext ContextData { get; set; }
4,300✔
103

104
                /// <summary>
105
                /// Gets a <see cref="MultiLeaderStyle"/> providing reusable style information
106
                /// for this <see cref="MultiLeader"/>.
107
                /// </summary>
108
                [DxfCodeValue(340)]
109
                public MultiLeaderStyle Style { get; set; }
1,065✔
110

111
                /// <summary>
112
                /// Gets or sets a value containing a list of flags indicating which multileader
113
                /// properties specified by the associated <see cref="MultiLeaderStyle"/> 
114
                /// are to be overridden by properties specified by this <see cref="MultiLeader"/>
115
                /// or the attached <see cref="MultiLeaderAnnotContext"/>.
116
                /// </summary>
117
                [DxfCodeValue(90)]
118
                public MultiLeaderPropertyOverrideFlags PropertyOverrideFlags { get; set; }
2,205✔
119

120
                /// <summary>
121
                /// Gets or sets a value indicating the path type of this <see cref="MultiLeader"/>
122
                /// (see <see cref="MultiLeaderStyle.PathType"/>).
123
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
124
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.PathType"/> flag is set in the
125
                /// <see cref="PropertyOverrideFlags"/> property.
126
                /// </summary>
127
                [DxfCodeValue(170)]
128
                public MultiLeaderPathType PathType { get; set; }
2,205✔
129

130
                /// <summary>
131
                /// Gets or sets color of the leader lines of this <see cref="MultiLeader"/>
132
                /// (see <see cref="MultiLeaderStyle.LineColor"/>).
133
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
134
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LineColor"/> flag is set in the
135
                /// <see cref="PropertyOverrideFlags"/> property.
136
                /// </summary>
137
                /// <remarks>
138
                /// The value for all leader lines can be overridden for each individual leader line by the
139
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineColor"/> property when the
140
                /// <see cref="LeaderLinePropertOverrideFlags.LineColor"/> flag is set in the 
141
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
142
                /// </remarks>
143
                [DxfCodeValue(91)]
144
                public Color LineColor { get; set; }
2,210✔
145

146
                //  TODO Additional Line Type? see Entity.LineType.
147
                /// <summary>
148
                /// Gets or sets <see cref="LineType"/> of the leader lines of this <see cref="MultiLeader"/>
149
                /// (see <see cref="MultiLeaderStyle.LeaderLineType"/>).
150
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
151
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineType"/> flag is set in the
152
                /// <see cref="PropertyOverrideFlags"/> property.
153
                /// </summary>
154
                /// <remarks>
155
                /// The setting for all leader lines can be overridden for each individual leader line by the
156
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineType"/> property when the
157
                /// <see cref="LeaderLinePropertOverrideFlags.LineType"/> flag is set in the 
158
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
159
                /// </remarks>
160
                [DxfCodeValue(341)]
161
                public LineType LeaderLineType { get; set; }
1,995✔
162

163
                //  TODO Additional Line Weight? see Entity.LineWeight.
164
                /// <summary>
165
                /// Gets or sets a value specifying the line weight to be applied to all leader lines of this
166
                /// <see cref="MultiLeader"/> (see <see cref="MultiLeaderStyle.LeaderLineWeight"/>).
167
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
168
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LeaderLineWeight"/> flag is set in the
169
                /// <see cref="PropertyOverrideFlags"/> property.
170
                /// </summary>
171
                /// <remarks>
172
                /// The value for all leader lines can be overridden for each individual leader line by the
173
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.LineWeight"/> property when the
174
                /// <see cref="LeaderLinePropertOverrideFlags.LineWeight"/> flag is set in the 
175
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
176
                /// </remarks>
177
                [DxfCodeValue(171)]
178
                public LineweightType LeaderLineWeight { get; set; }
2,205✔
179

180
                /// <summary>
181
                /// Gets or sets a value indicating whether landing is enabled.
182
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
183
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableLanding"/> flag is set in the
184
                /// <see cref="PropertyOverrideFlags"/> property.
185
                /// </summary>
186
                [DxfCodeValue(290)]
187
                public bool EnableLanding { get; set; }
2,210✔
188

189
                /// <summary>
190
                /// Gets or sets a value indicating that leader lines of this <see cref="MultiLeader"/>
191
                /// are to be drawn with a dogleg (see <see cref="MultiLeaderStyle.EnableDogleg"/>).
192
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
193
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.EnableDogleg"/> flag is set in the
194
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
195
                /// </summary>
196
                [DxfCodeValue(291)]
197
                public bool EnableDogleg { get; set; }
2,210✔
198

199
                /// <summary>
200
                /// Gets or sets the landing distance, i.e. the length of the dogleg, for this <see cref="MultiLeader"/>.
201
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
202
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is set in the
203
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
204
                /// </summary>
205
                /// <remarks><para>
206
                /// There is only one field for the landing distance in the multileader property grid.
207
                /// The value entered arrives in this property and the <see cref="Objects.MultiLeaderAnnotContext.LeaderRoot.LandingDistance"/>
208
                /// property. If two leader roots exist both receive the same value. I seems 
209
                /// <see cref="MultiLeaderPropertyOverrideFlags.LandingDistance"/> flag is never set.
210
                /// </para>
211
                /// </remarks>
212
                [DxfCodeValue(41)]
213
                public double LandingDistance { get; set; }
2,304✔
214

215
                /// <summary>
216
                /// Gets or sets a <see cref="BlockRecord"/> representing the arrowhead
217
                /// (see <see cref="MultiLeaderStyle.Arrowhead"/>) to be displayed with every leader line.
218
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
219
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.Arrowhead"/> flag is set in the
220
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
221
                /// </summary>
222
                /// <remarks>
223
                /// The value for all leader lines can be overridden for each individual leader line by the
224
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.Arrowhead"/> property when the
225
                /// <see cref="LeaderLinePropertOverrideFlags.Arrowhead"/> flag is set in the 
226
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
227
                /// </remarks>
228
                [DxfCodeValue(342)]
229
                public BlockRecord Arrowhead { get; set; }
×
230

231
                /// <summary>
232
                /// Gets or sets the arrowhead size (see <see cref="MultiLeaderStyle.Arrowhead"/>)
233
                /// for every leader line
234
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ArrowheadSize"/> flag is set in the
235
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
236
                /// </summary>
237
                /// <remarks>
238
                /// <para>
239
                /// The value for all leader lines can be overridden for each individual leader line by the
240
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.ArrowheadSize"/> property when the
241
                /// <see cref="LeaderLinePropertOverrideFlags.ArrowheadSize"/> flag is set in the 
242
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
243
                /// </para><para>
244
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
245
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.ArrowheadSize"/> is
246
                /// assumed to be used.
247
                /// </para>
248
                /// </remarks>
249
                [DxfCodeValue(42)]
250
                public double ArrowheadSize { get; set; }
2,210✔
251

252
                /// <summary>
253
                /// Gets or sets a value indicating whether the content of this <see cref="MultiLeader"/>
254
                /// is a text label, a content block, or a tolerance.
255
                /// </summary>
256
                [DxfCodeValue(172)]
257
                public LeaderContentType ContentType { get; set; }
2,205✔
258

259
                #region Text Menu Properties
260

261
                /// <summary>
262
                /// Gets or sets the <see cref="TextStyle"/> to be used to display the text label of this
263
                /// <see cref="MultiLeader"/>.
264
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
265
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextStyle"/> flag is set in the
266
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
267
                /// </summary>
268
                /// <remarks>
269
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class
270
                /// (<see cref="MultiLeaderAnnotContext.TextStyle"/>).
271
                /// Values should be equal, the <see cref="MultiLeaderAnnotContext.TextStyle"/>
272
                /// is assumed to be used.
273
                /// </remarks>
274
                [DxfCodeValue(343)]
275
                public TextStyle TextStyle { get; set; }
2,205✔
276

277
                /// <summary>
278
                /// Gets or sets the text left attachment type (see <see cref="MultiLeaderStyle.TextLeftAttachment"/>).
279
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
280
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextLeftAttachment"/> flag is set (see
281
                /// <see cref="PropertyOverrideFlags"/> property).
282
                /// </summary>
283
                /// <remarks>
284
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
285
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextLeftAttachment"/> is
286
                /// assumed to be used.
287
                /// </remarks>
288
                /// <value>
289
                /// A <see cref="TextAttachmentType"/> having the values 0-8 can be used
290
                /// ("horizontal" attachment types).
291
                /// </value>
292
                [DxfCodeValue(173)]
293
                public TextAttachmentType TextLeftAttachment { get; set; }
2,299✔
294

295
                /// <summary>
296
                /// Gets or sets the text right attachment type (see <see cref="MultiLeaderStyle.TextRightAttachment"/>).
297
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
298
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextRightAttachment"/> flag is set (see
299
                /// <see cref="PropertyOverrideFlags"/> property).
300
                /// </summary>
301
                /// <remarks>
302
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
303
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextRightAttachment"/> is
304
                /// assumed to be used.
305
                /// </remarks>
306
                /// <value>
307
                /// A <see cref="TextAttachmentType"/> having the values 0-8 can be used
308
                /// ("horizontal" attachment types).
309
                /// </value>
310
                [DxfCodeValue(95)]
311
                public TextAttachmentType TextRightAttachment { get; set; }
2,205✔
312

313
                //        TODO How to set this value?
314
                /// <summary>
315
                /// Gets or sets a value indicating the text angle.
316
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
317
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAngle"/> flag is set (see
318
                /// <see cref="PropertyOverrideFlags"/> property).
319
                /// </summary>
320
                [DxfCodeValue(174)]
321
                public TextAngleType TextAngle { get; set; }
2,205✔
322

323
                /// <summary>
324
                /// Gets or sets the text alignement type.
325
                /// </summary>
326
                /// <remarks><para>
327
                /// The Open Design Specification for DWG documents this property as <i>Unknown</i>,
328
                /// DXF reference as <i>Text Aligment Type</i>.
329
                /// Available DWG and DXF sample documents saved by AutoCAD return always 0=Left.
330
                /// </para><para>
331
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
332
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextAlignment"/> is
333
                /// assumed to be used.
334
                /// </para>
335
                /// </remarks>
336
                [DxfCodeValue(175)]
337
                public TextAlignmentType TextAlignment { get; set; }
2,205✔
338

339
                /// <summary>
340
                /// Gets or sets the color for the display of the text label.
341
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
342
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextColor"/> flag is set (see
343
                /// <see cref="PropertyOverrideFlags"/> property).
344
                /// </summary>
345
                /// <remarks>
346
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
347
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextColor"/> is
348
                /// assumed to be used.
349
                /// </remarks>
350
                [DxfCodeValue(92)]
351
                public Color TextColor { get; set; }
2,210✔
352

353
                /// <summary>
354
                /// Gets or sets a value indicating that the text label is to be drawn with a frame.
355
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
356
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextFrame"/> flag is set (see
357
                /// <see cref="PropertyOverrideFlags"/> property).
358
                /// </summary>
359
                [DxfCodeValue(292)]
360
                public bool TextFrame { get; set; }
2,304✔
361

362
                #endregion
363
                #region Block Content Properties
364

365
                /// <summary>
366
                /// Gets a <see cref="BlockRecord"/> containing elements
367
                /// to be drawn as content for the multileader.
368
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
369
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContent"/> flag is set (see
370
                /// <see cref="PropertyOverrideFlags"/> property).
371
                /// </summary>
372
                /// <remarks>
373
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
374
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContent"/> is
375
                /// assumed to be used.
376
                /// </remarks>
377
                [DxfCodeValue(344)]
378
                public BlockRecord BlockContent { get; set; }
×
379

380
                /// <summary>
381
                /// Gets or sets the block-content color.
382
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
383
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentColor"/> flag is set (see
384
                /// <see cref="PropertyOverrideFlags"/> property).
385
                /// </summary>
386
                /// <remarks>
387
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
388
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentColor"/> is
389
                /// assumed to be used.
390
                /// </remarks>
391
                [DxfCodeValue(93)]
392
                public Color BlockContentColor { get; set; }
2,210✔
393

394
                /// <summary>
395
                /// Gets or sets the scale factor for block content.
396
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
397
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentScale"/> flag is set (see
398
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
399
                /// </summary>
400
                /// <remarks>
401
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
402
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentScale"/> is
403
                /// assumed to be used.
404
                /// </remarks>
405
                [DxfCodeValue(10, 20, 30)]
406
                public XYZ BlockContentScale { get; set; }
2,210✔
407

408
                /// <summary>
409
                /// Gets or sets the rotation of the block content of the multileader.
410
                /// </summary>
411
                /// <remarks>
412
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
413
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentRotation"/> is
414
                /// assumed to be used.
415
                /// </remarks>
416
                [DxfCodeValue(DxfReferenceType.IsAngle, 43)]
417
                public double BlockContentRotation { get; set; }
2,210✔
418

419
                /// <summary>
420
                /// Gets or sets a value indicating whether the multileader connects to the content-block extents
421
                /// or to the content-block base point
422
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.BlockContentConnection"/> flag is set in the
423
                /// <see cref="PropertyOverrideFlags"/> property.
424
                /// </summary>
425
                /// <remarks>
426
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
427
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.BlockContentConnection"/> is
428
                /// assumed to be used.
429
                /// </remarks>
430
                [DxfCodeValue(176)]
431
                public BlockContentConnectionType BlockContentConnection { get; set; }
2,205✔
432

433
                #endregion
434

435
                /// <summary>
436
                /// Enable Annotation Scale
437
                /// </summary>
438
                [DxfCodeValue(293)]
439
                public bool EnableAnnotationScale { get; set; }
2,210✔
440

441
                //        TODO According to the OpenDesign_Specification_for_.dwg_files
442
                //        a list of arror head AND a list of block attributes can occur.
443
                //        If both list are empty it ist expected that two BL-fields should
444
                //        occur yielding count=0 for both lists. But when we read two
445
                //        BL-fields we get out of sync. If we read one BL-field everything
446
                //        works fine.
447
                //        We do not understand what a list of arroheads can be used for,
448
                //        and we do not know how to create such a list.
449
                //        The documentation for arrowheads list in OpenDesign_Specification_for_.dwg_files
450
                //        and the DXF Reference are contradicting.
451
                //        Decision:
452
                //                Ommit the Arrowheads property,
453
                //                try to keep the block attributes.
454

455
                //  public IList<ArrowheadAssociation> Arrowheads { get; } = new List<ArrowheadAssociation>();
456

457

458
                ///<subject>
459
                /// Gets a list of <see cref="BlockAttribute"/> objects representing
460
                /// a reference to a "block attribute"? and some properties to adjust
461
                /// the attribute.
462
                /// </subject>
463
                public IList<BlockAttribute> BlockAttributes { get; } = new List<BlockAttribute>();
4,002✔
464

465
                /// <summary>
466
                /// Text Direction Negative
467
                /// </summary>
468
                [DxfCodeValue(294)]
469
                public bool TextDirectionNegative { get; set; }
2,210✔
470

471
                /// <summary>
472
                /// Text Align in IPE (meaning unknown)
473
                /// </summary>
474
                [DxfCodeValue(178)]
475
                public short TextAligninIPE { get; set; }
2,210✔
476

477
                /// <summary>
478
                /// Gets or sets a value indicating the text attachment point.
479
                /// </summary>
480
                /// <remarks><para>
481
                ///        The Open Design Specification for DWG files documents this property as <i>Justification</i>,
482
                /// the DXF reference as <i>Text Attachments point</i>.
483
                /// </para><para>
484
                /// This property is also exposed by the <see cref="MultiLeader"/> class
485
                /// (<see cref="MultiLeader.TextAttachmentPoint"/>).
486
                /// The <see cref="MultiLeaderAnnotContext.TextAttachmentPoint"/> property always has the same value
487
                /// and seems to have the respective value as <see cref="MultiLeaderAnnotContext.TextAlignment"/>.
488
                /// The <see cref="MultiLeaderAnnotContext.TextAttachmentPoint"/> property is to be used.
489
                /// </para>
490
                /// </remarks>
491
                [DxfCodeValue(179)]
492
                public TextAttachmentPointType TextAttachmentPoint { get; set; }
2,299✔
493

494
                /// <summary>
495
                /// Gets or sets a scale factor (see <see cref="MultiLeaderStyle.ScaleFactor"/>).
496
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
497
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.ScaleFactor"/> flag is set (see
498
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property).
499
                /// The scale factor is applied by AutoCAD.
500
                /// </summary>
501
                /// <remarks>
502
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
503
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.ScaleFactor"/> is
504
                /// assumed to be relevant.
505
                /// </remarks>
506
                [DxfCodeValue(45)]
507
                public double ScaleFactor { get; set; }
2,210✔
508

509
                /// <summary>
510
                /// Gets or sets the Text attachment direction for text or block contents.
511
                /// This property overrides the value from <see cref="MultiLeaderStyle"/>
512
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the
513
                /// <see cref="MultiLeader.PropertyOverrideFlags"/> property.
514
                /// </summary>
515
                /// <remarks>
516
                /// <para>
517
                /// This property defines whether the leaders attach to the left/right of the content block/text,
518
                /// or attach to the top/bottom.
519
                /// </para><para>
520
                /// The value for all leader lines can be overridden for each individual leader line by the
521
                /// <see cref="Objects.MultiLeaderAnnotContext.LeaderRoot.TextAttachmentDirection"/> property when the
522
                /// <see cref="MultiLeaderPropertyOverrideFlags.TextAttachmentDirection"/> flag is set in the 
523
                /// <see cref="MultiLeaderAnnotContext.LeaderLine.OverrideFlags"/> property.
524
                /// </para>
525
                /// </remarks>
526
                /// <value>
527
                /// A <see cref="TextAttachmentDirectionType"/>.
528
                /// </value>
529
                [DxfCodeValue(271)]
530
                public TextAttachmentDirectionType TextAttachmentDirection { get; set; }
1,159✔
531

532
                /// <summary>
533
                /// Gets or sets the text bottom attachment type (see <see cref="MultiLeaderStyle.TextBottomAttachment"/>).
534
                /// This property override the value from <see cref="MultiLeaderStyle"/>
535
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextBottomAttachment"/> flag is set (see
536
                /// <see cref="PropertyOverrideFlags"/> property).
537
                /// </summary>
538
                /// <remarks>
539
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
540
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextBottomAttachment"/> is
541
                /// assumed to be used.
542
                /// </remarks>
543
                /// <value>
544
                /// A <see cref="TextAttachmentType"/> having the values
545
                ///         9 = Center,
546
                ///         10 = Underline and Center
547
                /// can be used ("vertical" attachment types).
548
                /// </value>
549
                [DxfCodeValue(272)]
550
                public TextAttachmentType TextBottomAttachment { get; set; }
1,065✔
551

552
                /// <summary>
553
                /// Gets or sets the text top attachment type (see <see cref="MultiLeaderStyle.TextTopAttachment"/>).
554
                /// This property override the value from <see cref="MultiLeaderStyle"/>
555
                /// when the <see cref="MultiLeaderPropertyOverrideFlags.TextTopAttachment"/> flag is set (see
556
                /// <see cref="PropertyOverrideFlags"/> property).
557
                /// </summary>
558
                /// <remarks>
559
                /// This property is also exposed by the <see cref="MultiLeaderAnnotContext"/> class. Values
560
                /// should be equal, the value <see cref="MultiLeaderAnnotContext.TextTopAttachment"/> is
561
                /// assumed to be used.
562
                /// </remarks>
563
                /// <value>
564
                /// A <see cref="TextAttachmentType"/> having the values
565
                ///         9 = Center,
566
                ///         10 = Underline and Center
567
                /// can be used ("vertical" attachment types).
568
                /// </value>
569
                [DxfCodeValue(273)]
570
                public TextAttachmentType TextTopAttachment { get; set; }
1,065✔
571

572
                /// <summary>
573
                /// Leader extended to text
574
                /// </summary>
575
                public bool ExtendedToText { get; set; }
575✔
576

577
                /// <inheritdoc/>
578
                public override CadObject Clone()
579
                {
3✔
580
                        MultiLeader clone = (MultiLeader)base.Clone();
3✔
581

582
                        clone.ContextData = (MultiLeaderAnnotContext)this.ContextData?.Clone();
3!
583

584
                        clone.BlockAttributes.Clear();
3✔
585
                        foreach (var att in this.BlockAttributes)
9!
586
                        {
×
587
                                clone.BlockAttributes.Add((BlockAttribute)att.Clone());
×
588
                        }
×
589

590
                        return clone;
3✔
591
                }
3✔
592

593
                /// <inheritdoc/>
594
                public override BoundingBox GetBoundingBox()
595
                {
1✔
596
                        return BoundingBox.Null;
1✔
597
                }
1✔
598

599
                /// <inheritdoc/>
600
                public override void ApplyTransform(Transform transform)
NEW
601
                {
×
NEW
602
                }
×
603
        }
604
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc