.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the Command line Results through API?

1 REPLY 1
Reply
Message 1 of 2
gadurai
560 Views, 1 Reply

How to get the Command line Results through API?

Hi, 

 

I am executing Autocad command through API using "Send Command" method through API.

Here I need to get the results of my Command Execution from the Command line.

Is it possible to get the result of Command line or read theCommand line values as we are doing "Sendcommand"/

 

Thanks in Advance.

 

Regards,

Appadurai.G

1 REPLY 1
Message 2 of 2
philippe.leefsma
in reply to: gadurai

You can't retrieve easily the text from the commandline, one solution is to use the approach described in that blog post, you need to use ARX for that:

 

http://adndevblog.typepad.com/autocad/2012/09/trapping-the-output-from-the-autocad-text-screen-comma...

 

Here is another suggestion, also ARX-based, but I'm not sure if this still works:

 

void GetCmdWinText() 
{   
	CWnd* pDock = (CEdit*)acedGetAcadTextCmdLine();  

	CWnd* pChild = pDock->GetWindow(GW_CHILD);    
		
	int index = 0;

	while (pChild!=NULL)
	{        
		CString str;        
		pChild->GetWindowText(str);        
		pChild = pChild->GetNextWindow(); 

		acutPrintf(L"\n****** Window [%d] ****** : %s", ++index, str);
	}   
}

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost