We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

Turning off 3D Editing plane from API

LaszloHatvani
Participant

How can I turn off/on the 3D editing plane from API like in Archicad?

 

LaszloHatvani_1-1724412675101.png

 

 

1 REPLY 1
LChen
Graphisoft
Graphisoft

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.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!