[code]
namespace Namespace1
{
public static class NestedPickSample
{
[CommandMethod( "NESTEDPICKTEST" )]
public static void acedNEntSelPExTest()
{
Int64 adsname = 0;
Point3d picked;
Matrix3d xform;
IntPtr resbuf = IntPtr.Zero;
int gsmarker = 0;
int result = acedNEntSelPEx( "Pick something:", out adsname,
out picked, 0, out xform, out resbuf, 0, out gsmarker );
if( result == 5100 )
{
Prompt( "Success: " );
// Dump contents of resultbuffer:
ResultBuffer buffer = (ResultBuffer) DisposableWrapper.Create(
typeof( ResultBuffer ), resbuf, true );
int i = 0;
foreach( TypedValue v in buffer )
Prompt( "element[{0}]: ({1} {2})",
i++, v.TypeCode, v.Value.ToString() );
buffer.Dispose();
}
Console.Write( 0 );
}
private static void Prompt( string msg, params object[] args )
{
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager
.MdiActiveDocument.Editor.WriteMessage( msg, args );
}
// This may get mangled by this crappy news server:
[DllImport("acad.exe",
EntryPoint = "?acedNEntSelPEx@@YAHPB_WQAJQANHQAY03NPAPAUresbuf@@IPAH@Z",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
extern static int acedNEntSelPEx( string prompt,
out Int64 adsname,
out Point3d picked,
int pickflag,
out Matrix3d transform,
out IntPtr resbuf,
uint transSpaceFlag,
out int gsMarker);
}
}
[/code]
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm