Hi @Saikiran_arakeri
Try this example. This code lets you pick the two coordinatesystems you want and then we use the transient geometry of the centerpoints of these coordinate systems to measure the distance and the differences in x, y, z.
I'm also using units of measure to convert to the units your'e using in Inventor.
Dim ucs1 As UserCoordinateSystem = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Select UCS 1")
Dim ucs2 As UserCoordinateSystem = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kUserCoordinateSystemFilter, "Select UCS 2")
Dim centerPoint1 As Point = ucs1.Origin.Point
Dim centerPoint2 As Point = ucs2.Origin.Point
Dim UoM As UnitsOfMeasure = ThisDoc.Document.UnitsOfMeasure
Dim retString As String = "Distance: " & UoM.ConvertUnits(centerPoint1.DistanceTo(centerPoint2), UnitsTypeEnum.kDatabaseLengthUnits, _
UnitsTypeEnum.kDefaultDisplayLengthUnits) & UoM.GetStringFromType(UnitsTypeEnum.kDefaultDisplayLengthUnits) & vbCrLf
Dim deltaX As Double = centerPoint1.X - centerPoint2.X
Dim deltaY As Double = centerPoint1.Y - centerPoint2.Y
Dim deltaZ As Double = centerPoint1.Z - centerPoint2.Z
retString += vbCrLf & "Delta X: " & UoM.ConvertUnits(deltaX, UnitsTypeEnum.kDatabaseLengthUnits, _
UnitsTypeEnum.kDefaultDisplayLengthUnits) & UoM.GetStringFromType(UnitsTypeEnum.kDefaultDisplayLengthUnits)
retString += vbCrLf & "Delta Y: " & UoM.ConvertUnits(deltaY, UnitsTypeEnum.kDatabaseLengthUnits, _
UnitsTypeEnum.kDefaultDisplayLengthUnits) & UoM.GetStringFromType(UnitsTypeEnum.kDefaultDisplayLengthUnits)
retString += vbCrLf & "Delta Z: " & UoM.ConvertUnits(deltaZ, UnitsTypeEnum.kDatabaseLengthUnits, _
UnitsTypeEnum.kDefaultDisplayLengthUnits) & UoM.GetStringFromType(UnitsTypeEnum.kDefaultDisplayLengthUnits)
MsgBox(retString)