API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

OperationMergeMarks Method

Merges given marks objects.

NOTE!! Merge requires the original mark content to be similar and of same type. Operation does not support associative notes, mark sets or template content.

Namespace:  Tekla.Structures.Drawing.Operations
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2022.0.13611
public static bool MergeMarks(
	IList<MarkBase> marks,
	out List<MarkBase> mergedMarks


Type: System.Collections.GenericIListMarkBase
Contains the of marks to be merged
Type: System.Collections.GenericListMarkBase
Merged marks

Return Value

Type: Boolean
True in case of success, false otherwise
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 System;
using System.Collections.Generic;
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Drawing;
using TSD = Tekla.Structures.Drawing;

class Example
    public void MergeMarksTest()
        DrawingHandler drawingHandler = new DrawingHandler();

        var drawing = drawingHandler.GetActiveDrawing();
        if (drawing != null)
            List<MarkBase> markstoBeMerged = new List<MarkBase>();

            // pick marks to be merged
            ViewBase pickedView;
            DrawingObject mark;
            var picker = drawingHandler.GetPicker();
            bool continuePicking = true;
            while (continuePicking)
                    var message = "Pick mark " + (markstoBeMerged.Count + 1).ToString() + " to be merged. Press Esc to finish..";
                    picker.PickObject(message, out mark, out pickedView);
                    if (mark == null || pickedView == null || !(mark is Tekla.Structures.Drawing.MarkBase))
                        continuePicking = false;
                        markstoBeMerged.Add(mark as MarkBase);
                    continuePicking = false;

            if (markstoBeMerged.Count > 1)
                List<MarkBase> mergedMarks = new List<MarkBase>();
                TSD.Operations.Operation.MergeMarks(markstoBeMerged, out mergedMarks);
                if (mergedMarks.Count > 0)
                    Console.WriteLine("Merge operation successfull with " + mergedMarks.Count.ToString() + " merged marks..");
                    Console.WriteLine("Merge operation failed..");
See Also