Message 1 of 4
Programmatically create Custom Toolbar to hold Custom Extensions - VB.NET
Not applicable
09-10-2018
09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am attempting to create a toolbar programmatically that will store command items to launch functions in our custom extensions through vb.net. I've read through the SDK and found the "CommandSiteLocationConstructor", but when using it I've run into an error I can't find a solution for. I've attempted the following code:
Dim testToolbarCmdSiteLoc As CommandSiteLocation = New CommandSiteLocation("test", CommandSiteLocationType.Toolbar)
Dim toolbarCmdSite As New CommandSite("TestCommand.Toolbar", "Add New TestCommand Menu")
toolbarCmdSite.DeployAsPulldownMenu = False
toolbarCmdSite.Location = testToolbarCmdSiteLoc
toolbarCmdSite.AddCommand(AddNewTestitem)
But on the first line where "CommandSiteLocationType.Toolbar" is the following error occurs:
Autodesk.Connectivity.Extensibility.Framework.ExtensionException: 'Invalid CommandSiteLocationType' at
Autodesk.Connectivity.Explorer.Extensibility.CommandSiteLocation..ctor(String customEntityName, CommandSiteLocationType type) at
.....
ErrorCodeEnum: IllegalInputParam
I haven't been able to find anyone who has run into this error and the "CommandSiteLocationType" is a valid enum in the SDK, so I'm not sure what's invalid about it. I've also tried putting the number equivalent, but the same error occurs. Any help would be appreciated. Thanks!
