Cancel
Showing results for 
Search instead for 
Did you mean: 

Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Valued Contributor
Valued Contributor

When we switch to drafting; can we restrict the users to use the assembly functionality, mostly add and create new component. These could be blocked in the menus, but they could still be visible in the ribbon bar. Is there any way to block them in drafting module, using NX open API. Have anyone tried these existing APIs

CreateRibbon() and setribbonvis() ? Any suggestions are welcome?

8 REPLIES

Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Esteemed Contributor
Esteemed Contributor

I don't know how  to hide the icons, or prevent users from adding them, but (I think) you can prevent users from actually doing anything via Menuscript & a short API program

 

Menuscript "xxxx.men"

MODIFY
  BUTTON YOUR_BUTTON_NAME_HERE
  ACTIONS/PRE your_api_program_here.dll
END_OF_MODIFY

 

API (.dll file, code stripped down to bare essentials)

static UF_MB_cb_status_t admin_only_cb(UF_MB_widget_t widget,
    UF_MB_data_t client_data, UF_MB_activated_button_p_t call_button )
{
    bool AllowAccess = false;

    if (UF_CALL(UF_initialize())) 
		return UF_MB_CB_ERROR;

    // your logic here

    UF_terminate();

    if (AllowAccess)
        return UF_MB_CB_CONTINUE;
    else
        return UF_MB_CB_CANCEL;
}

 

NOTE:

Since I was disallowing a "drafting only" button, I needed a "main" menuscript (main.men) file like this:

 

MODIFY
  APPLICATION_BUTTON UG_APP_DRAFTING
  MENU_FILES xxxx.men  
END_OF_MODIFY

 

Implementation:

1) Create "site" folder (e.g. S:\MY_STUFF\NX10.0\)

2) Create ENV variable UGII_SITE_DIR, point to "S:\MY_STUFF\NX10.0"

3) Create folders "S:\MY_STUFF\NX10.0\startup"

    and "S:\MY_STUFF\NX10.0\application"

4) Put main.men in \startup\

5) Put other files (xxxx.men and .dll) in \application\

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Esteemed Contributor
Esteemed Contributor

Sorry, it looks like the .DLL must also be in the \startup\ folder

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Valued Contributor
Valued Contributor

Thanks Ken,

I could hide the add component button in drafting but the ribbon tolbar is still showing the add component button. The intension is to block the user completely to add any component in drafting

Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Legend
Legend

To prevent user from adding component in drafting you could do it another way.  'Add Component' has a user exit.  So create a small program as a Pre-Action for Add Component.  You can control what happens when the Add Component is clicked, by querying the current application module.

Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Valued Contributor
Valued Contributor

Thanks,

Infact currently I am doing it, but what we need is to remove these functionalities completely from appreaing in ribbon toolbar in drafting module

Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Esteemed Contributor
Esteemed Contributor

You could create a custom role with the icons removed, and have users use that role as a starting point.

The problem is they can go back and customize those icons back into the ribbon, so (I think) there is no way to prevent the users from doing their own customization.

 

I suppose you could set UGII_USER_DIR to a folder they do NOT have write access to, so they would have to do it every time they open NX, but they could still do it (and then they would not be able to sae any other customizations you might wnat to allow them to do).

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Esteemed Contributor
Esteemed Contributor

Have you tried adding a menu file for the drafting application, changing the sensitivity of the menu entries in question, which should disable them.

To totally remove them from the ribbon tool bar, you might need to do this through NXOpen API, but I have never had a need to change things in such a drastic way.

Another way would be to create a custom DLL displaying only a NX-message-box containing "Action not allowed in this context" and create a menu file the replaces the actions of the menu items in question with your custom DLL.

I have done similar with entering the modeling application for the users without modeling license.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Hello Everyone; Is there any way to disable assembly ribbon bar in Drafting module

Valued Contributor
Valued Contributor

Thanks Stefan,

 

There is one api, but it is not working.

If we create our own menu dynamically we could control it, but for existing one, ther does not seems to be any way.