API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateLinearDimension method
Creates a linear dimension
Syntax:
Function CreateLinearDimension(ByVal Type As cdrLinearDimensionType, ByVal Point1 As SnapPoint, ByVal Point2 As SnapPoint, Optional ByVal TextCentered As Boolean = True, Optional ByVal TextX As Double = 0, Optional ByVal TextY As Double = 0, Optional ByVal Style As cdrDimensionStyle = cdrDimensionStyleDecimal, Optional ByVal Precision As Long = 2, Optional ByVal ShowUnits As Boolean = True, Optional ByVal Units As cdrDimensionLinearUnits = cdrDimensionUnitMM, Optional ByVal Placement As cdrDimensionPlacement = cdrDimensionWithinLine, Optional ByVal HorizontalText As Boolean = False, Optional ByVal BoxedText As Boolean = False, Optional ByVal LeadingZero As Boolean = True, Optional ByVal Prefix As String, Optional ByVal Suffix As String, Optional ByVal OutlineWidth As Double = -1, Optional ByVal Arrows As ArrowHead = Nothing, Optional ByVal OutlineColor As Color = Nothing, Optional ByVal TextFont As String, Optional ByVal TextSize As Double = 0, Optional ByVal TextColor As Color = Nothing) As Shape
Parameters:
Name Type Description
Type
Point1
Point2
TextCentered
Boolean
Specifies whether to center the text on the dimension line. True centers the text, while False leaves the text at the specified coordinates.
TextX
Double
Specifies the horizontal position of the text label.
TextY
Double
Specifies the vertical position of the text label.
Style
Specifies the number-formatting style for the dimension value of the text label.
Precision
Long
Specifies the number of significant digits for the dimension label to display after the decimal point, if using a decimal format for the dimension value.
ShowUnits
Boolean
Specifies whether to display the unit of measurement in the label.
Units
Specifies the unit of measurement for the dimension value.
Placement
Specifies the placement of the text label relative to its dimension line.
HorizontalText
Boolean
Specifies how to position dimension text. True rotates the dimension text horizontally, while False leaves the dimension text parallel to the dimension line.
BoxedText
Boolean
Specifies whether the dimension value has a visible border with the same properties as the dimension line - that is, whether the dimension label is enclosed by a rectangle.
LeadingZero
Boolean
Specifies whether the text value displays a leading zero for numbers that are less than 1.0 and for which a decimal format is used.
Prefix
String
Suffix
String
OutlineWidth
Double
Specifies the outline width.
Arrows
Specifies the desired arrowheads.
OutlineColor
Specifies the outline color.
TextFont
String
TextSize
Double
Specifies the text size.
TextColor
Specifies the text color.
Remarks:
The CreateLinearDimension method creates a linear dimension at a specified location on a layer.