Mark Class |
The Mark class represents a mark object that contains a single mark.
Several mark objects can be merged into one mark set.
SystemObject
Tekla.Structures.DrawingDatabaseObject
Tekla.Structures.DrawingDrawingObject
Tekla.Structures.DrawingMarkBase
Tekla.Structures.DrawingMark
Tekla.Structures.DrawingDatabaseObject
Tekla.Structures.DrawingDrawingObject
Tekla.Structures.DrawingMarkBase
Tekla.Structures.DrawingMark
Namespace: Tekla.Structures.Drawing
Assembly: Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2025.0.0-alpha00045580+dc02c3918546f1e94eb2d3b13ea99057fb3313e0
The Mark type exposes the following members.
| Name | Description | |
|---|---|---|
| Mark |
Constructs a Mark that will be attached to the specified ModelObject upon Insert.
|
| Name | Description | |
|---|---|---|
| Attributes |
Gets or sets the mark attributes.
| |
| Hideable |
Accesses the information if this object is hidden or not or if it should be.
(Inherited from MarkBase.) | |
| InsertionPoint |
The insertion point of the mark.
(Inherited from MarkBase.) | |
| IsAssociativeNote |
Gets a value indicating whether the mark is an associative note.
(Inherited from MarkBase.) | |
| Placing |
The current placing of the object.
See the placing types for different placing options.
(Inherited from MarkBase.) | |
| QueryReturnValue |
Status information about the latest database operation (select, insert, modify, delete).
(Inherited from DatabaseObject.) |
| Name | Description | |
|---|---|---|
| Delete |
Calls the system to delete the mark attached to a model object.
After this operation, only associative notes can be attached to that model object.
(Overrides DatabaseObjectDelete.) | |
| GetAxisAlignedBoundingBox |
Returns the axis aligned bounding box of the text (rectangle format).
(Inherited from MarkBase.) | |
| GetDoubleUserProperties(DictionaryString, Double) |
Retrieves all double user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetDoubleUserProperties(ListString, DictionaryString, Double) |
Retrieves all double user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetDrawing |
Gets the drawing where the drawing object is.
(Inherited from DrawingObject.) | |
| GetIntegerUserProperties(DictionaryString, Int32) |
Retrieves all integer user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetIntegerUserProperties(ListString, DictionaryString, Int32) |
Retrieves all integer user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetObjectAlignedBoundingBox |
Returns the object aligned bounding box of the text (rectangle format).
(Inherited from MarkBase.) | |
| GetObjects |
Gets the children objects of the current object.
(Inherited from MarkBase.) | |
| GetObjects(Type) |
Gets the children objects of the current object that are of certain types.
(Inherited from MarkBase.) | |
| GetRelatedObjects |
Gets the related objects of the current object.
(Inherited from DrawingObject.) | |
| GetRelatedObjects(Type) |
Gets the related objects of the current object that are of certain types.
(Inherited from DrawingObject.) | |
| GetStringUserProperties(DictionaryString, String) |
Retrieves all string user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetStringUserProperties(ListString, DictionaryString, String) |
Retrieves all string user properties for the object with the given list of names.
(Inherited from DatabaseObject.) | |
| GetUserProperty(String, Double) |
Gets a double property from the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| GetUserProperty(String, Int32) |
Gets an integer property from the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| GetUserProperty(String, String) |
Gets a string property from the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| GetView |
Gets the view where the drawing object is.
(Inherited from DrawingObject.) | |
| Insert |
Calls the system to insert the new object.
(Overrides DatabaseObjectInsert.) | |
| IsEqual |
Compares the current object with an object of the same type.
(Overrides DrawingObjectIsEqual(Object).) | |
| IsSameDatabaseObject |
Returns true if the current object and the given object are referencing the same database object.
(Inherited from DatabaseObject.) | |
| Modify |
Calls the system to update/modify the object.
(Overrides DatabaseObjectModify.) | |
| MoveObjectRelative |
Moves the object using the move vector.
(Inherited from MarkBase.) | |
| Select |
Calls the system to select and retrieve the object.
(Overrides DatabaseObjectSelect.) | |
| SetUserProperty(String, Double) |
Sets a double property for the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| SetUserProperty(String, Int32) |
Sets an integer property for the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| SetUserProperty(String, String) |
Sets a string property for the drawing object. The object has to be in a drawing before
the method can be used.
(Inherited from DatabaseObject.) | |
| ToString |
Changes the string presentation of the drawing object.
(Inherited from DrawingObject.) |
The following example enumerates through all parts in all views and inserts
marks for all those parts, the marks are placed in the middle of the part.
using Tekla.Structures.Geometry3d; using Tekla.Structures.Drawing; using TSM = Tekla.Structures.Model; class Example { public void InsertMarksForAllPartsInDrawing() { TSM.Model MyModel = new TSM.Model(); DrawingHandler MyDrawingHandler = new DrawingHandler(); if(MyModel.GetConnectionStatus()) { if(MyDrawingHandler.GetConnectionStatus()) { DrawingHandler.SetMessageExecutionStatus(DrawingHandler.MessageExecutionModeEnum.INSTANT); Drawing CurrentDrawing = MyDrawingHandler.GetActiveDrawing(); DrawingObjectEnumerator allParts = CurrentDrawing.GetSheet().GetAllObjects(typeof(Part)); while(allParts.MoveNext()) { ModelObject modelObject = (ModelObject)allParts.Current; Point PartMiddleStart = null, PartMiddleEnd = null, PartCenterPoint = null; GetPartPoints(MyModel, modelObject.GetView(), modelObject, out PartMiddleStart, out PartMiddleEnd, out PartCenterPoint); Mark Mark = new Mark(modelObject); Mark.Attributes.Content.Clear(); Mark.Attributes.Content.Add(new TextElement("My Mark")); Mark.Placing = new AlongLinePlacing(PartMiddleStart, PartMiddleEnd); Mark.InsertionPoint = PartCenterPoint; Mark.Insert(); } } } } private void GetPartPoints(TSM.Model MyModel, ViewBase PartView, ModelObject modelObject, out Point PartMiddleStart, out Point PartMiddleEnd, out Point PartCenterPoint) { TSM.ModelObject modelPart = GetModelObjectFromDrawingModelObject(MyModel, modelObject); GetModelObjectStartAndEndPoint(modelPart, (View)PartView, out PartMiddleStart, out PartMiddleEnd); PartCenterPoint = GetInsertionPoint(PartMiddleStart, PartMiddleEnd); } private TSM.ModelObject GetModelObjectFromDrawingModelObject(TSM.Model MyModel, ModelObject PartOfMark) { TSM.ModelObject modelObject = MyModel.SelectModelObject(PartOfMark.ModelIdentifier); TSM.Part modelPart = (TSM.Part)modelObject; return modelPart; } private void GetModelObjectStartAndEndPoint(TSM.ModelObject modelObject, View PartView, out Point PartStartPoint, out Point PartEndPoint) { TSM.Part modelPart = (TSM.Part)modelObject; PartStartPoint = modelPart.GetSolid().MinimumPoint; PartEndPoint = modelPart.GetSolid().MaximumPoint; Matrix convMatrix = MatrixFactory.ToCoordinateSystem(PartView.DisplayCoordinateSystem); PartStartPoint = convMatrix.Transform(PartStartPoint); PartEndPoint = convMatrix.Transform(PartEndPoint); } private Point GetInsertionPoint(Point PartStartPoint, Point PartEndPoint) { Point MinPoint = PartStartPoint; Point MaxPoint = PartEndPoint; Point InsertionPoint = new Point((MaxPoint.X + MinPoint.X) * 0.5, (MaxPoint.Y + MinPoint.Y) * 0.5, (MaxPoint.Z + MinPoint.Z) * 0.5); InsertionPoint.Z = 0; return InsertionPoint; } }