Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 2
Anonymous
567 Views, 1 Reply

AcedGrRead

I'm develop a run-time routine in arx using acedGrRead to get user
coordinate.

If the user want to zoom or use another autocad command, I get the code 11,
but I don't know what I must do to let Autocad execute the new command and
then resume my command.
This is the code:

void test()
{

int retType;
int pippo;
int track;
AcDbObjectId IdLine;
AcDbObjectId IdPrecLine;
resbuf *result = new resbuf();
MSG mes;
AcDbEntity *MyLine;

Acad::ErrorStatus
es=acDocManager->lockDocument(curDoc(),AcAp::kWrite,NULL,NULL,true);

IdPrecLine=AcDbObjectId();

do {

pippo=acedGrRead(3,&retType,result);

switch (retType)
{
case 5:
// Arrivata una cordinata
// faccio disegnare una linea da (0,0) al cursore

IdLine=DrawLine(0,0,0,result->resval.rpoint[0],result->resval.rpoint[1],0);

if(::PeekMessage(&mes, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&mes);
::DispatchMessage(&mes);
}

if (IdPrecLine!=0) {
acdbOpenObject(MyLine,IdPrecLine,AcDb::kForWrite);

MyLine->erase(true);
MyLine->close();

break;
}
case 11:
// what I must do here????

break;
}
IdPrecLine=IdLine;


if(::PeekMessage(&mes, NULL, 0, 0, PM_REMOVE))
{
::TranslateMessage(&mes);
::DispatchMessage(&mes);
}
} while (retType!=3);

es=acDocManager->unlockDocument(curDoc());

}

Thanks in advance!!!!
Pivanti Marco
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

"Maverck" wrote

> I'm develop a run-time routine in arx using acedGrRead to get user
> coordinate.
>
> If the user want to zoom or use another autocad command, I get the code
11,
> but I don't know what I must do to let Autocad execute the new command and
> then resume my command.
> This is the code:



Marco: This is not going to work. Long ago I tried this and found it
virtually impossible to figure out what the codes mean for menu picks and
also deal with keyboard input. To make matters worse, object snap is
disabled while using acedGrRead().

I would strongly consider abandoning this and using AcEdJig or the
AcEdInputPointMonitor class (the latter is also complicated when transparent
commands are used).

I had been using the InputManager from AcadX.arx, but found that it would
get confused when transparent commands were invoked. That forced me to
resort to ObjectARX and the AcEdJig.

Dynamic graphics in AutoCAD is no day at the beach, even in ObjectARX.

Regards,
Bill

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report