PlacingAttributes Class

The PlacingAttributes class contains the basic attributes for determining an object's placing.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Drawing
Assembly:  Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2023.0.3
public sealed class PlacingAttributes : GenericAttributesBase, 

The PlacingAttributes type exposes the following members.

Public methodPlacingAttributes
Creates a new placing attributes instance. The default parameters are: IsFixed = true, default PlacingDistanceAttributes, default PlacingQuarterAttributes.
Public methodPlacingAttributes(Boolean, PlacingDistanceAttributes, PlacingQuarterAttributes)
Creates a new placing quarter attributes instance with the given parameters.
Public propertyIsFixed
Defines whether the object is using fixed or free placing. If set to true, it means that fixed placing is enabled, and the object will not be rearranged in the drawing automatically. If set to false, then free placing is enabled, and the object will be placed in the most appropriate location near the original location.
Public propertyPlacingDistance
Gets or sets the placing distance attributes.
Public propertyPlacingQuarter
Gets or sets the placing quarter attributes.
Public methodClone
Creates a new object that is a copy of the current instance.
Public methodIsEqual
Compares the current object with an object of the same type.
(Overrides GenericAttributesBaseIsEqual(Object).)
The following example enumerates through all marks in all views and changes their PlacingAttributes and InsertionPoints. You may try commenting out either Modify part to see how it affects the end result.
using Tekla.Structures.Drawing;
using Tekla.Structures.Geometry3d;

public class Example
    public void Example1()
        DrawingHandler MyDrawingHandler = new DrawingHandler();
            MarkBase MyMarkBase;
            DrawingObjectEnumerator views = MyDrawingHandler.GetActiveDrawing().GetSheet().GetAllViews();
                DrawingObjectEnumerator allObjects = (views.Current as ViewBase).GetAllObjects();
                    if(allObjects.Current is MarkBase)
                        MyMarkBase = allObjects.Current as MarkBase;
                        // Using PlacingAttributes.IsFixed = true will force the mark to go to the specified point.
                        MyMarkBase.Attributes.PlacingAttributes.IsFixed = true;
                        MyMarkBase.InsertionPoint = new Point(100, 100);
                        // Using PlacingAttributes.IsFixed = false will try to place the mark to the specified point,
                        // however, if there's already an object there, it will find a new place around that area.
                        // When finding a place around the area, the rest of the PlacingAttributes take effect.
                        MyMarkBase.Attributes.PlacingAttributes.IsFixed = false;
                        // Minimum distance from other objects when searching for a space to place the mark
                        MyMarkBase.Attributes.PlacingAttributes.PlacingDistance.SearchMargin = 10.0;
                        // Minimum distance from the drawing object
                        MyMarkBase.Attributes.PlacingAttributes.PlacingDistance.MinimalDistance = 1.0;
                        // Maximum distance from the drawing object (0.0 = no limit)
                        MyMarkBase.Attributes.PlacingAttributes.PlacingDistance.MaximalDistance = 0.0;
                        // The directions to look for possible places
                        MyMarkBase.Attributes.PlacingAttributes.PlacingQuarter = new PlacingQuarterAttributes(TopLeft: true, TopRight: true, BottomLeft: true, BottomRight: true);
                        MyMarkBase.InsertionPoint = new Point(100, 100);
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.