2024-08-23
	
		
		01:33 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		2024-08-26
	
		
		12:47 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		
		
			Laszlo Nagy 
		
		
		
		
		
		
		
		
	
			
		
How can I turn off/on the 3D editing plane from API like in Archicad?
2024-08-30 08:15 AM
Hi,
I think you can the menu off/on by sending the message to in menu item, here is the short code for your reference:
#include "DGApplication.hpp"
static void ForceEditingPlaneOnOff()
{
	// pushing all commands to one list
	DG::CommandArray sortedList(DG::CommandDescriptor::GetCommandTable().ConvertValues());
	DG::CommandArray::ConstIterator	iter = sortedList.Begin();
	GS::UniString searchStr("Editing Plane Display");
	while (iter != nullptr)
	{
		DG::Command cmd = (*iter)->GetCommand();
		DG::CommandDescriptor* des = (*iter);
		
		bool ret = true;
		if ( des->IsVisible())
		{
			if (searchStr != "")
			{
				GS::UniString targetText = des->GetCleanText();
				if (searchStr == targetText) ret = true;
				else ret = false;
			}
			if (ret) {
				DG::Application& app = static_cast <DG::Application&> (*GS::Application::GetInstance ());
				ret = app.PostCommandMessage(cmd, GS::Message::Top);
				
				break;
			}
		}
		++iter;
	}
}
HTH.