GetUCSMatrix method example
Sub GetUCSMatrix_Example()
Dim ucsObj As AcadUCS
Dim origin(0 To 2) As Double
Dim xAxisPoint(0 To 2) As Double
Dim yAxisPoint(0 To 2) As Double
origin(0) = 2: origin(1) = 2: origin(2) = 0
xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0
Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPoint, yAxisPoint, "UCS1")
ThisDrawing.ActiveUCS = ucsObj
ThisDrawing.ActiveViewport.UCSIconOn = True
ThisDrawing.ActiveViewport.UCSIconAtOrigin = True
ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
Dim circleObj As AcadCircle
Dim center(0 To 2) As Double
Dim radius As Double
center(0) = 1: center(1) = 1: center(2) = 0
radius = 0.5
Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
ZoomAll
Dim TransMatrix As Variant
TransMatrix = ucsObj.GetUCSMatrix()
MsgBox "Transform the circle.", , "GetUCSMatrix Example"
circleObj.TransformBy (TransMatrix)
circleObj.Update
MsgBox "The circle is transformed.", , "GetUCSMatrix Example"
End Sub
© Bricsys NV. All rights reserved. |