Repository URL to install this package:
|
Version:
2016.3.0.4050 ▾
|
draftsight
/
opt
/
dassault-systemes
/
DraftSight
/
APISDK
/
Create_and_Apply_DimensionStyle_Example_VBA.htm
|
|---|
<html>
<head>
<title>Create and Apply DimensionStyle Example (VBA)</title>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" type="text/css" href="ApiHelp.css">
<meta name=MS-HKWD content="VBA examples">
<meta name=MS-HKWD content="VBA examples,DimensionStyles">
<meta name=MS-HKWD content="VBA examples,Dimensions">
<meta name=MS-HKWD content="VBA examples,arc length Dimensions">
<meta name=MS-HKWD content="VBA examples,jogged Dimensions">
<meta name=MS-HKWD content="VBA examples,radius Dimensions">
<meta name=MS-HKWD content="VBA examples,diameter Dimensions">
<meta name=MS-HKWD content="VBA examples,rotated Dimensions">
<meta name=MS-HKWD content="VBA examples,Dimensions">
<meta name=MS-HKWD content="DimensionStyle, create">
<meta name=MS-HKWD content="DimensionStyle, activate">
<meta name=MS-HKWD content="DimensionStyle, set">
<meta name=MS-HKWD content="Dimension, jogged">
<meta name=MS-HKWD content="Dimension, arc length">
<meta name=MS-HKWD content="Dimension, rotated">
<meta name=MS-HKWD content="Dimension, radius">
<meta name=MS-HKWD content="Dimension, diameter">
<meta name=MS-HKWD content="Dimension, general">
<meta name=MS-HKWD content="Dimension">
<meta name=MS-HKWD content="Diameter Dimension">
<meta name=MS-HKWD content="Jogged Dimension">
<meta name=MS-HKWD content="Radius Dimension">
<meta name=MS-HKWD content="Rotated Dimension">
</head>
<body>
<h1>Create and Apply DimensionStyle Example (VBA)</h1>
<font SIZE="2">
<p>This example shows how to create, activate, and apply a new DimensionStyle.
This example also shows how to create arc length, jogged, rotated, radius, and
diameter Dimensions for circles, arcs, and a line.</p>
</font>
<pre>'-------------------------------------------------------------
' Preconditions:
' 1. Create a VBA macro in a software product in which VBA is
' embedded.
' 2. Copy and paste this example into the Visual Basic IDE.
' 3. Add a reference to the DraftSight type library,
' <i>install_dir</i>\<b>bin\dsAutomation.dll</b>
' 4. Open the Immediate window.
' 5. Start DraftSight and open a document.
' 6. Run the macro.
'
' Postconditions:
' 1. A new DimensionStyle named SampleDimStyle is created and
' activated.
' 2. Arc length, jogged, rotated, radius, and diameter dimensions
' are created for circles, arcs, and a line, using the new
' DimensionStyle.
' 3. Examine the Immediate window and the drawing.
'------------------------------------------------------------
Option Explicit
Sub main()
Dim dsApp As DraftSight.Application </pre>
<pre> 'Connect to DraftSight application
Set dsApp = GetObject(, "DraftSight.Application")
'Abort any command currently running in DraftSight
'to avoid nested commands
dsApp.<b>AbortRunningCommand</b></pre>
<pre> 'Get active document
Dim dsDoc As DraftSight.Document
Set dsDoc = dsApp.<b>GetActiveDocument</b>()
If dsDoc Is Nothing Then
MsgBox ("There are no open documents in DraftSight.")
Return
End If </pre>
<pre> 'Get DimensionStyle manager
Dim dsDimStyleManager As DraftSight.DimensionStyleManager
Set dsDimStyleManager = dsDoc.<b>GetDimensionStyleManager</b>() </pre>
<pre> 'Create DimensionStyle named SampleDimStyle
Dim createDimStyleResult As dsCreateObjectResult_e
Dim dimStyleName As String
dimStyleName = "SampleDimStyle"
Dim dsDimStyle As DraftSight.DimensionStyle
dsDimStyleManager.<b>CreateDimensionStyle</b> dimStyleName, dsDimStyle, createDimStyleResult
Select Case True
Case (dsCreateObjectResult_e.dsCreateObjectResult_Error = createDimStyleResult), dsCreateObjectResult_e.dsCreateObjectResult_AlreadyExists = createDimStyleResult, dsDimStyle Is Nothing
MsgBox ("Failed to create " & dimStyleName & " DimensionStyle, or DimensionStyle already exists.")
Exit Sub
End Select </pre>
<pre> SetDimensionStyleSettings dsDimStyle
'Activate DimensionStyle
dsDimStyle.<b>Activate</b> </pre>
<pre> 'Get model space
Dim dsModel As DraftSight.Model
Set dsModel = dsDoc.<b>GetModel</b>() </pre>
<pre> 'Get sketch manager
Dim dsSketchMgr As DraftSight.SketchManager
Set dsSketchMgr = dsModel.<b>GetSketchManager</b>() </pre>
<pre> 'Draw arc length Dimension
DrawArcLengthDimension dsSketchMgr </pre>
<pre> 'Draw jogged Dimension for circle and arc
DrawJoggedDimension dsSketchMgr </pre>
<pre> 'Draw rotated Dimension
DrawRotatedDimension dsSketchMgr </pre>
<pre> 'Draw radius Dimension for circle and arc
DrawRadialDimension dsSketchMgr </pre>
<pre> 'Draw diameter Dimension for circle and arc
DrawDiameterDimension dsSketchMgr </pre>
<pre> 'Zoom to fit
dsApp.<b>Zoom</b> dsZoomRange_e.dsZoomRange_Fit, Nothing, Nothing
End Sub</pre>
<pre>
Sub SetDimensionStyleSettings(ByVal dsDimStyle As DimensionStyle)
'Get DimensionStyle arrows options
Dim dsArrowsDimStyleOptions As DraftSight.DimensionStyleArrowsOptions
Set dsArrowsDimStyleOptions = dsDimStyle.<b>GetDimensionStyleArrowsOptions</b>() </pre>
<pre> 'Set start and end arrow types
dsArrowsDimStyleOptions.<b>SetStartArrow</b> dsDimensionArrowType_e.dsDimensionArrowType_ClosedBlank, ""
dsArrowsDimStyleOptions.<b>SetEndArrow</b> dsDimensionArrowType_e.dsDimensionArrowType_ClosedBlank, "" </pre>
<pre> 'Get DimensionStyle line options
Dim dsLineDimStyleOptions As DraftSight.DimensionStyleLineOptions
Set dsLineDimStyleOptions = dsDimStyle.<b>GetDimensionStyleLineOptions</b>() </pre>
<pre> 'Set Dimension line color
Dim dsColor As DraftSight.Color
Set dsColor = dsLineDimStyleOptions.<b>DimensionLineColor</b>
dsColor.<b>SetNamedColor</b> dsNamedColor_e.dsNamedColor_Green
dsLineDimStyleOptions.<b>DimensionLineColor</b> = dsColor </pre>
<pre> 'Set extension line color
dsColor.<b>SetNamedColor</b> dsNamedColor_e.dsNamedColor_Yellow
dsLineDimStyleOptions.<b>ExtensionLineColor</b> = dsColor </pre>
<pre> 'Get DimensionStyle radius and diameter Dimension options
Dim dsRadialAndDiameterDimStyleOptions As DraftSight.DimensionStyleRadialDiameterDimensionOptions
Set dsRadialAndDiameterDimStyleOptions = dsDimStyle.<b>GetDimensionStyleRadialDiameterDimensionOptions</b>() </pre>
<pre> 'Set jog angle 45 degrees (in radians)
dsRadialAndDiameterDimStyleOptions.<b>RadiusDimensionJogAngle</b> = 3.14159265358979 / 4 </pre>
<pre> 'Set center mark
Dim markSize As Double
markSize = 0.05
dsRadialAndDiameterDimStyleOptions.<b>SetCenterMarkDisplay</b> dsDimensionCenterMarkDisplay_e.dsDimensionCenterMarkDisplay_AsMark, markSize </pre>
<pre> 'Get Dimension style text options
Dim dsTextOptions As DraftSight.DimensionStyleTextOptions
Set dsTextOptions = dsDimStyle.<b>GetDimensionStyleTextOptions</b>() </pre>
<pre> 'Frame Dimension text
dsTextOptions.<b>FrameDimensionText</b> = True </pre>
<pre> 'Set text position
dsTextOptions.<b>HorizontalPosition</b> = dsDimensionTextHorizontalPosition_e.dsDimensionTextHorizontalPosition_Centered
dsTextOptions.<b>VerticalPosition</b> = dsDimensionTextVerticalPosition_e.dsDimensionTextVerticalPosition_Centered </pre>
<pre> 'Set text alignment
dsTextOptions.<b>Alignment</b> = dsDimensionTextAlignment_e.dsDimensionTextAlignment_AlignWithDimensionLines
End Sub</pre>
<pre>
Sub DrawArcLengthDimension(ByVal dsSketchMgr As DraftSight.SketchManager)
'Add arc to drawing
Dim centerX As Double
centerX = -8
Dim centerY As Double
centerY = 1
Dim centerZ As Double
centerZ = 0
Dim radius As Double
radius = 5
Dim startAngle As Double
startAngle = 3.14159265358979 / 6
Dim endAngle As Double
endAngle = 3.14159265358979
Dim dsArc As DraftSight.CircleArc
Set dsArc = dsSketchMgr.<b>InsertArc</b>(centerX, centerY, centerZ, radius, startAngle, endAngle) </pre>
<pre> 'Add arc length Dimension
Dim dimensionPosition(2) As Double
dimensionPosition(0) = -6
dimensionPosition(1) = 6
dimensionPosition(2) = 0
Dim dimensionTextOverride As String
dimensionTextOverride = ""
Dim dsArcLengthDim As DraftSight.ArcLengthDimension
Set dsArcLengthDim = dsSketchMgr.<b>InsertArcLengthDimension</b>(dsArc, dimensionPosition, dimensionTextOverride) </pre>
<pre> 'Print information about arc length Dimension
PrintArcLengthDimProperties dsArcLengthDim </pre>
<pre> 'Add a partial arc length Dimension
Dim firstPoint(2) As Double
firstPoint(0) = -4
firstPoint(1) = 3
firstPoint(2) = 0
Dim secondPoint(2) As Double
secondPoint(0) = -7
secondPoint(1) = 6
secondPoint(2) = 0
dimensionPosition(0) = -6
dimensionPosition(1) = 7
Dim dsArcLengthPartialDim As DraftSight.ArcLengthDimension
Set dsArcLengthPartialDim = dsSketchMgr.<b>InsertArcLengthDimensionPartial</b>(dsArc, firstPoint, secondPoint, dimensionPosition, dimensionTextOverride) </pre>
<pre> 'Print information about partial arc length Dimension
PrintArcLengthDimProperties dsArcLengthDim
End Sub</pre>
<pre>
Sub DrawJoggedDimension(ByVal dsSketchMgr As DraftSight.SketchManager)
'Draw a circle
Dim centerX As Double
centerX = -7
Dim centerY As Double
centerY = -5
Dim centerZ As Double
centerZ = 0
Dim radius As Double
radius = 3
Dim dsCircle As DraftSight.Circle
Set dsCircle = dsSketchMgr.<b>InsertCircle</b>(centerX, centerY, centerZ, radius) </pre>
<pre> 'Add jogged Dimension to circle
Dim centerPositionOverride(2) As Double
centerPositionOverride(0) = -12
centerPositionOverride(1) = -8
centerPositionOverride(2) = 0
Dim jogLinePosition(2) As Double
jogLinePosition(0) = -11
jogLinePosition(1) = -8
jogLinePosition(2) = 0
Dim dimensionPosition(2) As Double
dimensionPosition(0) = -10
dimensionPosition(1) = -7.5
dimensionPosition(2) = 0
Dim dimensionTextOverride As String
dimensionTextOverride = ""
Dim dsJoggedDimForCircle As DraftSight.JoggedDimension
Set dsJoggedDimForCircle = dsSketchMgr.<b>InsertJoggedDimensionCircle</b>(dsCircle, centerPositionOverride, jogLinePosition, dimensionPosition, dimensionTextOverride) </pre>
<pre> 'Print information about jogged Dimension
PrintJoggedDimProperties dsJoggedDimForCircle </pre>
<pre> 'Draw an arc
centerX = 2
centerY = -6
Dim arcRadius As Double
arcRadius = 3
Dim startAngle As Double
startAngle = 0#
Dim endAngle As Double
endAngle = 3.14159265358979 / 3
Dim dsArc As DraftSight.CircleArc
Set dsArc = dsSketchMgr.<b>InsertArc</b>(centerX, centerY, centerZ, arcRadius, startAngle, endAngle) </pre>
<pre> 'Add jogged Dimension to arc
centerPositionOverride(0) = 7
centerPositionOverride(1) = -3
jogLinePosition(0) = 7
jogLinePosition(1) = -4
dimensionPosition(0) = 5.5
dimensionPosition(1) = -4.5
Dim dsJoggedDimForArc As DraftSight.JoggedDimension
Set dsJoggedDimForArc = dsSketchMgr.<b>InsertJoggedDimensionArc</b>(dsArc, centerPositionOverride, jogLinePosition, dimensionPosition, dimensionTextOverride) </pre>
<pre> 'Print information about jogged Dimension
PrintJoggedDimProperties dsJoggedDimForArc
End Sub</pre>
<pre>
Sub DrawRadialDimension(ByVal dsSketchMgr As DraftSight.SketchManager)
'Draw a circle
Dim centerX As Double
centerX = 2
Dim centerY As Double
centerY = 2
Dim centerZ As Double
centerZ = 0
Dim radius As Double
radius = 3
Dim dsCircle As DraftSight.Circle
Set dsCircle = dsSketchMgr.<b>InsertCircle</b>(centerX, centerY, centerZ, radius) </pre>
<pre> 'Draw an arc
centerX = 10
centerY = 2
Dim arcRadius As Double
arcRadius = 3
Dim startAngle As Double
startAngle = 0#
Dim endAngle As Double
endAngle = 3.14159265358979 / 3
Dim dsArc As DraftSight.CircleArc
Set dsArc = dsSketchMgr.<b>InsertArc</b>(centerX, centerY, centerZ, arcRadius, startAngle, endAngle) </pre>
<pre> 'Add radius Dimension to circle
Dim dimPosition(2) As Double
dimPosition(0) = 7
dimPosition(1) = 6
dimPosition(2) = 0
Dim dimTextOverride As String
dimTextOverride = ""
Dim dsRadialCircleDim As DraftSight.RadialDimension
Set dsRadialCircleDim = dsSketchMgr.<b>InsertRadialDimensionCircle</b>(dsCircle, dimPosition, dimTextOverride) </pre>
<pre> 'Print information about radius Dimension
PrintRadialDimProperties dsRadialCircleDim </pre>
<pre> 'Add radius Dimension to arc
dimPosition(0) = 16
dimPosition(1) = 3
Dim dsRadialArcDim As DraftSight.RadialDimension
Set dsRadialArcDim = dsSketchMgr.<b>InsertRadialDimensionArc</b>(dsArc, dimPosition, dimTextOverride) </pre>
<pre> 'Print information about radius Dimension
PrintRadialDimProperties dsRadialArcDim
End Sub</pre>
<pre>
Sub DrawDiameterDimension(ByVal dsSketchMgr As DraftSight.SketchManager)
'Draw a circle
Dim centerX As Double
centerX = 2
Dim centerY As Double
centerY = 2
Dim centerZ As Double
centerZ = 0
Dim radius As Double
radius = 3
Dim dsCircle As DraftSight.Circle
Set dsCircle = dsSketchMgr.<b>InsertCircle</b>(centerX, centerY, centerZ, radius) </pre>
<pre> 'Draw an arc
centerX = 10
centerY = 2
Dim arcRadius As Double
arcRadius = 3
Dim startAngle As Double
startAngle = 0#
Dim endAngle As Double
endAngle = 3.14159265358979 / 3
Dim dsArc As DraftSight.CircleArc
Set dsArc = dsSketchMgr.<b>InsertArc</b>(centerX, centerY, centerZ, arcRadius, startAngle, endAngle) </pre>
<pre> 'Add diameter Dimension to circle
Dim dimPosition(2) As Double
dimPosition(0) = 3
dimPosition(1) = 8
dimPosition(2) = 0 </pre>
<pre> 'No text override - empty string
Dim dimTextOverride As String
dimTextOverride = ""
Dim dsDiameterCircleDim As DraftSight.DiameterDimension
Set dsDiameterCircleDim = dsSketchMgr.<b>InsertDiameterDimensionCircle</b>(dsCircle, dimPosition, dimTextOverride) </pre>
<pre> 'Print information about diameter Dimension
PrintDiameterDimProperties dsDiameterCircleDim </pre>
<pre> 'Add diameter Dimension to arc
dimPosition(0) = 14
dimPosition(1) = 6
Dim dsDiameterArcDim As DraftSight.DiameterDimension
Set dsDiameterArcDim = dsSketchMgr.<b>InsertDiameterDimensionArc</b>(dsArc, dimPosition, dimTextOverride) </pre>
<pre> 'Print information about diameter Dimension
PrintDiameterDimProperties dsDiameterArcDim
End Sub</pre>
<pre>
Sub DrawRotatedDimension(ByVal dsSketchMgr As DraftSight.SketchManager)
'Draw line
Dim startX As Double
startX = 10
Dim startY As Double
startY = -5
Dim startZ As Double
startZ = 0
Dim endX As Double
endX = 14
Dim endY As Double
endY = -5
Dim endZ As Double
endZ = 0
Dim dsLine As DraftSight.Line
Set dsLine = dsSketchMgr.<b>InsertLine</b>(startX, startY, startZ, endX, endY, endZ) </pre>
<pre> 'Draw rotated Dimension
Dim extLine1Point(2) As Double
extLine1Point(0) = startX
extLine1Point(1) = startY
extLine1Point(2) = startZ
Dim extLine2Point(2) As Double
extLine2Point(0) = endX
extLine2Point(1) = endY
extLine2Point(2) = endZ
Dim dimensionLinePosition(2) As Double
dimensionLinePosition(0) = 16
dimensionLinePosition(1) = -6
dimensionLinePosition(2) = 0
Dim dimTextOverride As String
dimTextOverride = "" </pre>
<pre> 'Angle 45 degrees (in radians)
Dim rotationAngle As Double
rotationAngle = 3.14159265358979 / 4
Dim dsRotatedDim As DraftSight.RotatedDimension
Set dsRotatedDim = dsSketchMgr.<b>InsertRotatedDimension</b>(extLine1Point, extLine2Point, dimensionLinePosition, dimTextOverride, rotationAngle) </pre>
<pre> 'Print information about rotated Dimension
PrintRotatedDimProperties dsRotatedDim
End Sub</pre>
<pre>
Sub PrintArcLengthDimProperties(ByVal dsArcLengthDim As ArcLengthDimension)
Debug.Print (" Arc length Dimension parameters...")
</pre>
<pre> 'Get general Dimension object, which contains common Dimension properties,
'and print them
Dim dsGeneralDim As DraftSight.GeneralDimension
Set dsGeneralDim = dsArcLengthDim.<b>GetGeneralDimension</b>()
PrintGeneralDimProperties dsGeneralDim </pre>
<pre> 'Print specific parameters for arc length Dimension
Debug.Print (" ArcSymbolType = " & dsArcLengthDim.<b>ArcSymbolType</b>)
Debug.Print (" HasLeader = " & dsArcLengthDim.<b>HasLeader</b>)
Debug.Print (" IsPartial = " & dsArcLengthDim.<b>IsPartial</b>)
Dim x As Double, y As Double, z As Double </pre>
<pre> 'Get center point
dsArcLengthDim.<b>GetCenterPoint</b> x, y, z
Debug.Print (" Center point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get arc point
dsArcLengthDim.<b>GetArcPoint</b> x, y, z
Debug.Print (" Arc point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get extension line 1 point
dsArcLengthDim.<b>GetExtensionLine1Point</b> x, y, z
Debug.Print (" Extension line 1 point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get extension line 2 point
dsArcLengthDim.<b>GetExtensionLine2Point</b> x, y, z
Debug.Print (" Extension line 2 point (" & x & "," & y & "," & z & ")")
End Sub</pre>
<pre>
Sub PrintRadialDimProperties(ByVal dsRadialDim As RadialDimension)
Debug.Print (" Radius Dimension parameters...") </pre>
<pre> 'Get general Dimension object, which contains common Dimension properties,
'and print them
Dim dsGeneralDim As DraftSight.GeneralDimension
Set dsGeneralDim = dsRadialDim.<b>GetGeneralDimension</b>()
PrintGeneralDimProperties dsGeneralDim </pre>
<pre> 'Print specific parameters for radius Dimension
Dim x As Double, y As Double, z As Double </pre>
<pre> 'Get center point
dsRadialDim.<b>GetCenterPoint</b> x, y, z
Debug.Print (" Center point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get defining point
dsRadialDim.<b>GetDefiningPoint</b> x, y, z
Debug.Print (" Defining point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Print leader length value
Debug.Print (" Leader length = " & dsRadialDim.<b>LeaderLength</b>)
End Sub</pre>
<pre>
Sub PrintDiameterDimProperties(ByVal dsDiameterDim As DiameterDimension)
Debug.Print (" Diameter Dimension parameters...") </pre>
<pre> 'Get general Dimension object, which contains common Dimension properties,
'and print them
Dim dsGeneralDim As DraftSight.GeneralDimension
Set dsGeneralDim = dsDiameterDim.<b>GetGeneralDimension</b>()
PrintGeneralDimProperties dsGeneralDim </pre>
<pre> 'Print specific parameters for diameter Dimension
Dim x As Double, y As Double, z As Double
'Get defining point
dsDiameterDim.<b>GetDefiningPoint</b> x, y, z
Debug.Print (" Defining point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get far defining point
dsDiameterDim.<b>GetFarDefiningPoint</b> x, y, z
Debug.Print (" Far defining point (" & x & "," & y & "," & z & ")")
'Print leader length value
Debug.Print (" Leader length = " & dsDiameterDim.<b>LeaderLength</b>)
End Sub</pre>
<pre>
Sub PrintJoggedDimProperties(ByVal dsJoggedDim As JoggedDimension)
Debug.Print (" Jogged Dimension parameters...") </pre>
<pre> 'Get general Dimension object, which contains common Dimension properties,
'and print them
Dim dsGeneralDim As DraftSight.GeneralDimension
Set dsGeneralDim = dsJoggedDim.<b>GetGeneralDimension</b>()
PrintGeneralDimProperties dsGeneralDim </pre>
<pre> 'Print specific parameters for jogged Dimension
Debug.Print (" Jog angle = " & dsJoggedDim.<b>JogAngle</b>)
Dim x As Double, y As Double, z As Double </pre>
<pre> 'Get center point
dsJoggedDim.<b>GetCenterPoint</b> x, y, z
Debug.Print (" Center point (" & x & "," & y & "," & z & ")")
'Get chord point
dsJoggedDim.<b>GetChordPoint</b> x, y, z
Debug.Print (" Chord point (" & x & "," & y & "," & z & ")")
'Get jog point
dsJoggedDim.<b>GetJogPoint</b> x, y, z
Debug.Print (" Jog point (" & x & "," & y & "," & z & ")")
'Get override center point
dsJoggedDim.<b>GetOverrideCenterPoint</b> x, y, z
Debug.Print (" Override center point (" & x & "," & y & "," & z & ")")
End Sub</pre>
<pre>
Sub PrintRotatedDimProperties(ByVal dsRotatedDim As RotatedDimension)
Debug.Print (" Rotated Dimension parameters...") </pre>
<pre> 'Get general Dimension object, which contains common Dimension properties,
'and print them
Dim dsGeneralDim As DraftSight.GeneralDimension
Set dsGeneralDim = dsRotatedDim.<b>GetGeneralDimension</b>()
PrintGeneralDimProperties dsGeneralDim </pre>
<pre> 'Print specific parameters for rotated Dimension
Debug.Print (" Rotation angle = " & dsRotatedDim.<b>Rotation</b>)
Dim x As Double, y As Double, z As Double </pre>
<pre> 'Get Dimension line point
dsRotatedDim.<b>GetDimensionLinePoint</b> x, y, z
Debug.Print (" Dimension line point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get extension line 1 point
dsRotatedDim.<b>GetExtensionLine1Point</b> x, y, z
Debug.Print (" Extension line 1 point (" & x & "," & y & "," & z & ")") </pre>
<pre> 'Get extension line 2 point
dsRotatedDim.<b>GetExtensionLine2Point</b> x, y, z
Debug.Print (" Extension line 2 point (" & x & "," & y & "," & z & ")")
End Sub</pre>
<pre>
Sub PrintGeneralDimProperties(ByVal dsGeneralDim As GeneralDimension)
'Get general Dimension object, which contains common Dimension properties,
'and print them
Debug.Print (" Dimension style = " & dsGeneralDim.<b>DimensionStyle</b>)
Debug.Print (" Handle = " & dsGeneralDim.<b>Handle</b>)
Debug.Print (" Measurement = " & dsGeneralDim.<b>Measurement</b>)
Debug.Print (" Related = " & dsGeneralDim.<b>Related</b>)
Debug.Print (" Text override = " & dsGeneralDim.<b>TextOverride</b>)
Debug.Print (" TextRotation = " & dsGeneralDim.<b>TextRotation</b>)
'Get text position
Dim x As Double, y As Double
dsGeneralDim.<b>GetTextPosition</b> x, y
Debug.Print (" Text position (" & x & "," & y & ")")
End Sub
</pre>
<p> </p>
</body>
</html>