Why does the function `acedIsMenuGroupLoaded` always return `false`?

Why does the function `acedIsMenuGroupLoaded` always return `false`?

zhengyunyang2019
Advocate Advocate
395 Views
1 Reply
Message 1 of 2

Why does the function `acedIsMenuGroupLoaded` always return `false`?

zhengyunyang2019
Advocate
Advocate

 

 

 

 

	virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) 
	{
		AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg(pkt);
		if (Adesk::kTrue == acedIsMenuGroupLoaded(TEXT("nwheleccoordinationsys")))
		{
			acutPrintf(TEXT("exist\n"));
		}
		return (retCode) ;
	}

	virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) 
	{
		AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg(pkt);
		if (Adesk::kTrue == acedIsMenuGroupLoaded(TEXT("nwheleccoordinationsys")))
		{
			acutPrintf(TEXT("exist\n"));
		}
		return (retCode) ;
	}

 

 

 

 

        I am testing the "acedIsMenuGroupLoaded" method, and I have already loaded "nwheleccoordinationsys.cuix". However, I have noticed that in the "On_kInitAppMsg" function, using "acedIsMenuGroupLoaded" always returns true, while in the "On_kUnloadAppMsg" function, using "acedIsMenuGroupLoaded" always returns false.

        Calling acedIsMenuGroupLoaded(TEXT("nwheleccoordinationsys")) anywhere else in the code always returns true,only in On_kUnloadAppMsg does it return false.

        The trigger method for On_kUnloadAppMsg is to directly close CAD.

        I think it would be normal for the call in On_kUnloadAppMsg to also return true, so I’m quite puzzled.

        Can you explain what might be causing this?

0 Likes
Accepted solutions (1)
396 Views
1 Reply
Reply (1)
Message 2 of 2

zhengyunyang2019
Advocate
Advocate
Accepted solution

I found the key reason for the problem myself.

If I unload the plugin using APPLOAD, then acedIsMenuGroupLoaded works normally in On_kUnloadAppMsg.

However, if I directly close CAD by clicking the X, it still triggers On_kUnloadAppMsg, but acedIsMenuGroupLoaded fails, possibly because some data has already been cleared.

0 Likes