Table of Contents

Class CadOwnerTag

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The mark of an owned entity: the name of its owner, the id of the object it draws and, where the owner wants one, a second id, kept in the entity's extended data under the application ApplicationName.

public sealed class CadOwnerTag
Inheritance
CadOwnerTag
Inherited Members

Remarks

A line of the front view of a model drawing drawing the beam B-12 is tagged new CadOwnerTag("ModelDrawing", "B-12", "V-1").WriteTo(line), and its extended data reads 1001 OPENCAD2D_OWNER, 1000 ModelDrawing, 1000 B-12, 1000 V-1; with no second id the last group is left out. The application is registered in the drawing's table of applications when the tag is written. AutoCAD keeps the data and ignores it, so a tagged drawing opens there as any other.

Each text is written so that it reads back exactly as it was given: a per cent sign, a backslash, a line break or another control character is written as % and its two hexadecimal digits (%25, %5C, %0A), and half of a surrogate pair standing alone as %u and four (%uD800); every other letter, accented letters among them, is written as it is. Without that, a backslash followed by U+0041 would read back as an A. Each text, so written, is at most 255 characters, as extended data holds one.

Constructors

CadOwnerTag(string, string, string)

Makes a tag.

Fields

ApplicationName

The name of the application whose extended data holds the tag: OPENCAD2D_OWNER.

Properties

ExtraId

Gets the second id; null where the tag has none.

ObjectId

Gets the id of the object the entity draws.

Owner

Gets the owner's name.

Methods

Remove(DxfEntity)

Takes the tag out of an entity's extended data, the data of other applications kept: for a copy of an owned entity, which is the presenter's own and no longer its original owner's.

ToString()

Gives the tag as a line for debugging.

TryRead(DxfEntity, out CadOwnerTag)

Reads the tag of an entity: its extended data of ApplicationName, two or three strings (1000), the owner and the object id not empty. Strings after the third are left unread.

WriteTo(DxfEntity)

Writes the tag into an entity's extended data, in place of a tag it has; the data of other applications is kept. An entity in no drawing yet takes it when it is appended.