Removing VDS Enable/Disable Buttons - VDS 2019

Removing VDS Enable/Disable Buttons - VDS 2019

Leon.VASSE
Advocate Advocate
1,474 Views
11 Replies
Message 1 of 12

Removing VDS Enable/Disable Buttons - VDS 2019

Leon.VASSE
Advocate
Advocate

 

Hi there!

 

(edited by moderator) - In reference to >>this post<< in Vault forum.

 

My concern is the opposite: how to remove the "Enable/Disable" DataStandard buttons, to force User going through the VDS workflow .

 

We are using VDS 2019. 

"Enable/Disable" DataStandard buttons appear in Inventor "Part" environment, whileas they don't in appear in Inventor "Assembly" environment. I would like they don't appear in both "Part" and "Assembly" environments.

 

According to the Autodesk online support:

https://knowledge.autodesk.com/support/vault-products/learn-explore/caas/CloudHelp/cloudhelp/2021/EN...

 

I understand "Enable/Disable" DataStandard buttons appearance can be set in the setting "DisableVdsForCmds" of the configuration file:

INV: C:\ProgramData\Autodesk\Inventor 2020\Addins\Data Standard\dataStandard.InvAddIn.dll.config

ACAD: C:\ProgramData\Autodesk\ApplicationPlugins\Autodesk DataStandard 2020.bundle\Contents\dataStandard.ACadAddIn.dll.config

 

1) When deleting "AssemblyBonusTools_AddPartCmd" or " AssemblyBonusTools_AddAssemblyCmd" in "DisableVdsForCmds", the "Enable/Disable" DataStandard buttons do not appear in "Assembly" environment. What am I missing?

 

2) Out of the "list of Inventor Commands" retrieved from the macro suggested in the Inventor API Help, which one should be added in "DisableVdsForCmds"?

 

Hoping the things are as simple as I understand, thank you for your lights!

Best regards!

 

 

0 Likes
Accepted solutions (2)
1,475 Views
11 Replies
Replies (11)
Message 2 of 12

Markus.Koechl
Autodesk
Autodesk
Removing buttons from the UI and disabling/enabling VDS for commands are different: to drive the UI an override using Inventor API is required. To understand "DisableVdsForCmds" you need to think about the principle of VDS: VDS subscribes to the Inventor's "Save" event; this event knows which command initiated the event. The config file allows to register or unregister Inventor commands that cause a save event, like the assembly bonus tool commands.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 3 of 12

Leon.VASSE
Advocate
Advocate

Thank you Markus!

 

So is there any way to remove the "Enable/Disable" buttons from the Data Standard ribbon? Only modifying the existing API or creating an additional API? Cannot be handled "just" by modifying the setting of an xml?

 

Best regards!

 

0 Likes
Message 4 of 12

Markus.Koechl
Autodesk
Autodesk
Unfortunately, there is no configuration option to remove the enable/disable button from the ribbon in 2019.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 5 of 12

Leon.VASSE
Advocate
Advocate

Hallo Markus!

 

Thank you for your explanation. One more question: in VDS 2019, for which reason the "Enable/Disable" buttons appears only in "Part" and "Drawing" environment whileas they do not appear in "Assembly" environment?

 

Best regards!

0 Likes
Message 6 of 12

Markus.Koechl
Autodesk
Autodesk
I don't believe that hiding the command in an assembly environment is intended behavior.


Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 7 of 12

Leon.VASSE
Advocate
Advocate
EDIT: above question was missing a big piece:

Through iLogic, I can delete the "Enable/Disable" buttons so that they don't appear in "Assembly" environment, but I am not able yet to reproduce it in "Part" and "Drawing" environments:

iLogic code:
Try
Dim curEnviron = ThisApplication.UserInterfaceManager.ActiveEnvironment
curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabAssembly").RibbonPanels("AD:dataStandardAddIn:PanelAssemblySettings").Delete()
Catch
End Try
0 Likes
Message 8 of 12

Leon.VASSE
Advocate
Advocate

For a reason I cannot yet figure out, in the below code, only the first button deletion request is performed. For example, the button deletion is required firstly in the Part environment, so it will be done in Part environment, but then it is not performed neither in Drawing nor in Assembly environments. I tried by placing, one after another, the 3 button deletion requests at first position, I can delete the "Enable/Disable" Data Standard buttons in either Part, or Assembly or Drawing environment, but only in one environment at a time:

 

Try
	Dim curEnviron  = ThisApplication.UserInterfaceManager.ActiveEnvironment
	Dim disabledCmdList = ThisApplication.UserInterfaceManager.ActiveEnvironment.DisabledCommandList
	Dim cmdMgr = ThisApplication.CommandManager
	
	'delete Enable/Disable Data Standard buttons in PART environment:
	curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabPart").RibbonPanels("AD:dataStandardAddIn:PanelPartSettings").CommandControls("AD:dataStandardAddIn:BtnTurnOff").Delete()
        curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabPart").RibbonPanels("AD:dataStandardAddIn:PanelPartSettings").CommandControls("AD:dataStandardAddIn:BtnTurnOn").Delete()

	'delete Enable/Disable Data Standard buttons in DRAWING environment:
	curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabDrawing").RibbonPanels("AD:dataStandardAddIn:PanelDrawingSettings").CommandControls("AD:dataStandardAddIn:BtnTurnOff").Delete()
        curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabDrawing").RibbonPanels("AD:dataStandardAddIn:PanelDrawingSettings").CommandControls("AD:dataStandardAddIn:BtnTurnOn").Delete()
	
	'delete Enable/Disable Data Standard buttons in ASSEMBLY environment:
        curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabAssembly").RibbonPanels("AD:dataStandardAddIn:PanelAssemblySettings").CommandControls("AD:dataStandardAddIn:BtnTurnOff").Delete()
        curEnviron.Ribbon.RibbonTabs("AD:dataStandardAddIn:TabAssembly").RibbonPanels("AD:dataStandardAddIn:PanelAssemblySettings").CommandControls("AD:dataStandardAddIn:BtnTurnOn").Delete()
	
	disabledCmdList.Add(cmdMgr.ControlDefinitions("AD:dataStandardAddIn:BtnTurnOff"))
	disabledCmdList.Add(cmdMgr.ControlDefinitions("AD:dataStandardAddIn:BtnTurnOn"))
Catch
End Try  

 

0 Likes
Message 9 of 12

Markus.Koechl
Autodesk
Autodesk

This is rather an Inventor API question than Vault. AFAIK, you need to create overrides for each environment and place the commands that you liked. Not sure that this effort pays off. Reach out to the MFG Dev Blog for more details and samples on how to do this: https://adndevblog.typepad.com/manufacturing/2014/01/modify-ribbon-and-menu-items.html and Inventor API Help - Sample section: https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-A2FBD407-736B-4A43-A971-A00A1BF459DF 



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
0 Likes
Message 10 of 12

Leon.VASSE
Advocate
Advocate
Accepted solution

Thank you Markus.

 

Our Autodesk Retailer helped to complete the above code, so that it is possible to effectively delete the "Enable/Disable" Data Standard, through iLogic, whether User opens an IPT, an IAM or an IDW file. So I will not enter API learning this time!

 

Best regards.

0 Likes
Message 11 of 12

GeorgK
Advisor
Advisor

@Leon.VASSE  Please could you post the code? Thank you

Georg

0 Likes
Message 12 of 12

Leon.VASSE
Advocate
Advocate
Accepted solution

Hello Georg!

 

Here it is:

Dim ribbonName = curEnviron.Ribbon.InternalName
Dim tabName = "AD:dataStandardAddIn:Tab" + ribbonName
Dim panelName = "AD:dataStandardAddIn:Panel" + ribbonName + "Settings"

'delete Enable/Disable buttons in Part/Assembly/Drawing Data Standard tabs
Try
	curEnviron.Ribbon.RibbonTabs(tabName).RibbonPanels(panelName).CommandControls("AD:dataStandardAddIn:BtnTurnOff").Delete()
	curEnviron.Ribbon.RibbonTabs(tabName).RibbonPanels(panelName).CommandControls("AD:dataStandardAddIn:BtnTurnOn").Delete()
	curEnviron.Ribbon.RibbonTabs(tabName).RibbonPanels(panelName).Delete()
	disabledCmdList.Add(cmdMgr.ControlDefinitions("AD:dataStandardAddIn:BtnTurnOff"))
	disabledCmdList.Add(cmdMgr.ControlDefinitions("AD:dataStandardAddIn:BtnTurnOn"))
Catch
	' Error ignored in case it's already deleted
End Try

Thanks @smilinger

 

Best regards