OperationSplitMarks Method

Splits given marks to original marks.

Namespace:  Tekla.Structures.Drawing.Operations
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
public static bool SplitMarks(
	IList<MarkBase> marks
)

Parameters

marks
Type: System.Collections.GenericIListMarkBase
Contains the list of marks to be splitted

Return Value

Type: Boolean
True in case of success, false otherwise
Examples
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 SplitMarksTest()
    {
        DrawingHandler drawingHandler = new DrawingHandler();

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

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

            if (markstoBeSplitted.Count > 0)
            {
                if(TSD.Operations.Operation.SplitMarks(markstoBeSplitted))
                {
                    drawing.CommitChanges();
                    drawingHandler.SaveActiveDrawing();
                    Console.WriteLine("Split operation successfull..");
                }
                else
                {
                    Console.WriteLine("Split operation failed..");
                }
            }
        }
    }
}
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next