
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning all, I'm trying to learn the AIP. Going through some of the example in the API help section, there are several samples (about every other one) that fail when I run them. I have tried running them in a ZeroDocument/part/assembly environment and with no changes to the code or outcome.
For example, when I try to run the "Add commands to the application menu API Sample" (shown at the end), here is what I see:
Placing a watch on oFileBrowserControls agrees with the error that the .AddButton command isn't found.
However, when I check with Intelisense, it does show up as an available method:
The API samples inside the API help documentation are meant to be stand-alone subs, right?
What am I missing?
Sub AddCommandsToFileBrowser() ' Get the application menu controls collection Dim oFileBrowserControls As CommandControls Set oFileBrowserControls = ThisApplication.UserInterfaceManager.FileBrowserControls ' Get the "Zoom All" and "Home View" commands Dim oDef1 As ButtonDefinition Set oDef1 = ThisApplication.CommandManager.ControlDefinitions.Item("AppZoomAllCmd") Dim oDef2 As ButtonDefinition Set oDef2 = ThisApplication.CommandManager.ControlDefinitions.Item("AppIsometricViewCmd") ' Create button controls, positioned before the "Manage" control Call oFileBrowserControls.AddButton(oDef1, True, True, "Manage", True) Call oFileBrowserControls.AddButton(oDef2, True, True, "Manage", True) Call oFileBrowserControls.AddSeparator("Manage", True) End Sub
Solved! Go to Solution.