PlacingAttributes Class |
The PlacingAttributes class contains the basic attributes for determining an object's placing.
Inheritance Hierarchy
SystemObject
Tekla.Structures.DrawingGenericAttributesBase
Tekla.Structures.DrawingPlacingAttributes
Tekla.Structures.DrawingGenericAttributesBase
Tekla.Structures.DrawingPlacingAttributes
Namespace: Tekla.Structures.Drawing
Assembly: Tekla.Structures.Drawing (in Tekla.Structures.Drawing.dll) Version: 2024.0.0+a110b435391768740483e3032720a566518c9a63
Syntax
The PlacingAttributes type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PlacingAttributes |
Creates a new placing attributes instance. The default parameters are:
IsFixed = true, default PlacingDistanceAttributes, default PlacingQuarterAttributes.
| |
PlacingAttributes(Boolean, PlacingDistanceAttributes, PlacingQuarterAttributes) |
Creates a new placing quarter attributes instance with the given parameters.
|
Properties
Name | Description | |
---|---|---|
IsFixed |
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.
| |
PlacingDistance |
Gets or sets the placing distance attributes.
| |
PlacingQuarter |
Gets or sets the placing quarter attributes.
|
Methods
Name | Description | |
---|---|---|
Clone |
Creates a new object that is a copy of the current instance.
| |
IsEqual |
Compares the current object with an object of the same type.
(Overrides GenericAttributesBaseIsEqual(Object).) |
Examples
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(); if(MyDrawingHandler.GetConnectionStatus()) { MarkBase MyMarkBase; DrawingObjectEnumerator views = MyDrawingHandler.GetActiveDrawing().GetSheet().GetAllViews(); while(views.MoveNext()) { DrawingObjectEnumerator allObjects = (views.Current as ViewBase).GetAllObjects(); while(allObjects.MoveNext()) { 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); MyMarkBase.Modify(); // 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); MyMarkBase.Modify(); } } } } } }
See Also