Inside AcEditorReactor doesnot work acedCommand

Inside AcEditorReactor doesnot work acedCommand

majklha
Advocate Advocate
329 Views
2 Replies
Message 1 of 3

Inside AcEditorReactor doesnot work acedCommand

majklha
Advocate
Advocate

I try to redefine action for double click to entity, but only for some entity types. Eg. for attribute I want to run standard Autodesk dialog. But I am not able to run th acedCommand function inside beginDoubleClick reactor function.

This code doesnot work, and error is -5001 (other error).

class CMajAcEditorReactor : public  AcEditorReactor
{......}

void CMajAcEditorReactor::beginDoubleClick(const AcGePoint3d &clickPoint)
{
	CMajAc::SetVarInt(L"DBLCLKEDIT", 0);
	acutPrintf(L"\nBegin Double click");
	ads_name vybrEntity;
	double *ptPick = asDblArray(clickPoint);

	if(acedSSGet(L"_:n", ptPick, NULL, NULL, vybrEntity) == RTNORM) //:n - umožní výběr subentity
	{
		ads_name entita;
		acedSSName(vybrEntity, 0, entita);
		acedSSFree(vybrEntity);
		int err = acedCommandS(RTSTR, _T("EATTEDIT"), RTENAME, entita, RTNONE);
		return;
	}
}

If I normally select the attribut (or block) it work properly (almost identical code):

void Pokus()
{
	ads_name vybrEntity;

	if(acedSSGet(L"_:n", NULL, NULL, NULL, vybrEntity) != RTNORM) //:n - umožní výběr subentity
	{
		acedSSFree(vybrEntity);
		return;
	}

	ads_name entita;
	acedSSName(vybrEntity, 0, entita);
	acedSSFree(vybrEntity);
	acedCommandS(RTSTR, _T("EATTEDIT"), RTENAME, entita, RTNONE);
}

 

 

0 Likes
Accepted solutions (2)
330 Views
2 Replies
Replies (2)
Message 2 of 3

tbrammer
Advisor
Advisor
Accepted solution

I don't think that it is possible to use acedCommandS() from within a reactor.

You could try to register a command and call it using acDocManager->sendStringToExecute(..).


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 3

daniel_cadext
Advisor
Advisor
Accepted solution

or beginExecuteInCommandContext 

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx