程序代码: |
Dim wcs2ucs As Matrix3d = doc.Editor.CurrentUserCoordinateSystem.Inverse()
Dim ucsPoint As Point3d = worldPoint.TransformBy(wcs2ucs)
程序代码: |
'需要UCS->DCS的转换
<DllImport("accore.dll", CallingConvention := CallingConvention.Cdecl, EntryPoint := "acedTrans")> _
Private Shared Function acedTrans(point As Double(), fromRb As IntPtr, toRb As IntPtr, disp As Integer, result As Double()) As Integer
End Function
Dim resultBuffer As ResultBuffer = New ResultBuffer(New TypedValue() {New TypedValue(5003, 1)})
Dim array2 As Double() = New Double(3 - 1) {}
acedTrans(first.ToArray(), resultBuffer.UnmanagedObject, resultBuffer2.UnmanagedObject, 0, array2)
resultBuffer.Dispose()
Dim rbFrom As Object = New ResultBuffer(New TypedValue(5003, 1))
Dim rbTo As Object = New ResultBuffer(New TypedValue(5003, 2))
Dim firres As Object = New Double() {0, 0, 0}
Dim secres As Object = New Double() {0, 0, 0}
' Transform the first point...
acedTrans(startPoint.ToArray(), rbFrom.UnmanagedObject, rbTo.UnmanagedObject, 0, firres)
[本日志由 tiancao1001 于 2022-05-25 05:57 PM 编辑]
|
tiancao1001 于 2022-05-25 06:04 PM 发表评论:
发表评论 - 不要忘了输入验证码哦! |