How to call acedGetPoint from VB.NET.
18 August 2004
Tip By Autodesk AutoCAD Developer - Albert Szilvasy
The code:
<StructLayout(LayoutKind.Sequential)> _
Public Structure ads_point
Public x As Double
Public y As Double
Public z As Double
End Structure
<DllImport("acad.exe", CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl)> _
Public Shared Function acedGetPoint(<InAttribute(), MarshalAs(UnmanagedType.AsAny)> ByVal start As Object, ByVal prompt As String, ByRef result As ads_point) As Int32
End Function
<CommandMethod("acedGetPoint")> _
Public Sub test()
Dim pt As New ads_point()
acedGetPoint(Nothing, "gimme a point:", pt)
acedGetPoint(pt, "gimme another one:", pt)
End Sub