Why should I move from AutoCAD LT to AutoCAD 2005
2350 Miles by Plane and Car in 4 Days Last Week

How to call acedGetPoint from VB.NET.

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

 

Comments