Support

As evidenced by over 30 years of development history, trust-worthy Korean CAD, CADian!

FAQ · 2013.12.11
CADian VBA Sample Code - 14 [ UCS #2 ]
Dim ucsObj As IntelliCAD.UserCoordSystem
Dim originPt As Point
Dim xAxisVector As Vector
Dim yAxisVector As Vector
Dim UCSName As String

""Set the origin and axes vectors.
Set originPt = Library.CreatePoint(0, 0, 0)
Set xAxisVector = Library.CreateVector(0, 0, 0, 1, 1, 0)
Set yAxisVector = Library.CreateVector(0, 2, 0, 1, 1, 0)


UCSName = InputBox("Type a name for the user coordinate system:")

Set ucsObj = ThisDocument.UserCoordinateSystems.Add(originPt, xAxisVector, yAxisVector, UCSName)
""Specify the active UCS of the drawing.
ThisDocument.ActiveUCS = ucsObj

""This specifies whether the UCS Icon is turned on.
""Set whether the UCS icon is turned on.
ThisDocument.ActiveViewport.UCSIconOn = True

""This specifies whether the UCS Icon is displayed at Origin point.
ThisDocument.ActiveViewport.UCSIconAtOrigin = True

MsgBox "Origin coordinates: " & ucsObj.origin.x & ", " & ucsObj.origin.y & ", " & ucsObj.origin.z

""Get the UCS transformation matrix
Dim TransMatrix As Matrix

Set TransMatrix = ucsObj.GetUCSMatrix()

MsgBox "First two values of matrix: "& TransMatrix.GetValue(0, 1) & " " & TransMatrix.GetValue(1, 2)

Added to cart.

VIEW CART

Please sign in first.

JOIN