Had a little free time, the Resultbuffer was still being a pain in the arse, so I nixed it.
Anyway here is the C++ code, followed by C# code, then a little picky, then attached is the solution
and compiled dll (in the release folder) let me know if it works
bool Utilities::NEntSelPEx
(
String^ prompt,
[Out]ObjectId %objectid,
Point3d %point,
int pickflag,
[Out]Matrix3d %matrix,
[Out]ResultBuffer ^%buffer,
unsigned int transSpaceFlag,
int %gsmarker
)
{
CString _prompt(prompt);
ads_name _name;
ads_point _point = {point.X,point.Y,point.Z};
ads_matrix _matrix;
resbuf *_buffer = NULL;
int *_gsmarker;
if(acedNEntSelPEx(_prompt,_name,_point,pickflag,_matrix,&_buffer,transSpaceFlag,_gsmarker) == RTNORM)
{
objectid = ObjectId(_name[0]);
point = Point3d(_point[0],_point[1],_point[2]);
array<double> ^_tmparray = gcnew array<double>(16)
{
_matrix[0][0],_matrix[0][1],_matrix[0][2],_matrix[0][3],
_matrix[1][0],_matrix[1][1],_matrix[1][2],_matrix[1][3],
_matrix[2][0],_matrix[2][1],_matrix[2][2],_matrix[2][3],
_matrix[3][0],_matrix[3][1],_matrix[3][2],_matrix[3][3]
};
matrix = Matrix3d(_tmparray);
if(_buffer != NULL)
{
{
//stupid prick resbuf !@#@!#$%!#%
//IntPtr ptr(_buffer);
//buffer = (ResultBuffer^)DisposableWrapper::Create(ResultBuffer::typeid, ptr, true);
}
acutRelRb(_buffer);
}
gsmarker = *_gsmarker;
return true;
}
else
{
return false;
}
}
.
[CommandMethod("doit")]
public void doit()
{
Editor ed = AcAp.Application.DocumentManager.MdiActiveDocument.Editor;
string prompt = "select object";
ObjectId id;
Point3d point;
int pickflag = 0;
Matrix3d matrix;
ResultBuffer buff;
uint transSpaceFlag = Convert.ToUInt32(AcAp.Application.GetSystemVariable("CVPORT"));
int marker = -1;
try
{
AcMgdWrprs.Utilities.NEntSelPEx(prompt,
out id,
ref point,
pickflag,
out matrix,
out buff,
transSpaceFlag,
ref marker);
//
ed.WriteMessage("\nObjectId: " + id.ToString());
ed.WriteMessage("\nPoint3d: " + point.ToString());
ed.WriteMessage("\nMatrix3d: " + matrix.ToString());
ed.WriteMessage("\nmarker: " + marker.ToString());
}
catch (System.Exception ex)
{
ed.WriteMessage(ex.Message);
ed.WriteMessage(ex.StackTrace);
}
}