Topic
3 replies Latest Post - ‏2012-11-13T17:39:29Z by SystemAdmin
SystemAdmin
SystemAdmin
1061 Posts
ACCEPTED ANSWER

Pinned topic Getting workspaceID for a diagram

‏2012-11-09T14:45:04Z |
Anyone have experience using VBA to retrieve the WorkspaceID for a diagram or definition?

I am trying to write a macro to display the diagrams that have been either created or updated in the current workspace. I know there is a way to do this because the workspaceID is displayed when merging workspaces and I can display the WorkspaceID using the reporting system within SA.

It is not immediately obvious how to obtain this data using VBA - it is not a property on the diagram and I can't find anyting in the doc revealing how to obtain this data using VBA (not a metric, field, or relation as far as I can tell).
Updated on 2012-11-13T17:39:29Z at 2012-11-13T17:39:29Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1061 Posts
    ACCEPTED ANSWER

    Re: Getting workspaceID for a diagram

    ‏2012-11-12T21:45:48Z  in response to SystemAdmin
    I still can't find an obvious way to do this, but I did figure out an inglorious workaround. Involves using the ExecuteReport method (because I can retrieve the workspaceid through the report interface), then reading the generated XML file to select the current workspace items and load those into a scripting dictionary. Then the dictionary is available to compare objects (by ddid) to determine if they belong to the current workspace.

    This is a long way to go to get what I need, so if anyone figures out how to access the workspaceid for a diagram/definition more directly, please share.
  • ArifH
    ArifH
    30 Posts
    ACCEPTED ANSWER

    Re: Getting workspaceID for a diagram

    ‏2012-11-13T15:10:08Z  in response to SystemAdmin
    Try

    xxxx.Encyclopedia.GetWorkspaceID

    xxxx.Encyclopedia.GetWorkspaceName
    xxxx.GetWorkspace.GetWorkspaceTree
    xxxx.IsEncyWorkspaceEnabled
    • SystemAdmin
      SystemAdmin
      1061 Posts
      ACCEPTED ANSWER

      Re: Getting workspaceID for a diagram

      ‏2012-11-13T17:39:29Z  in response to ArifH
      I have that part down - this is the workspaceid that I am comparing to determine if the diagram 'belongs' to the current workspace.

      What I would like to see is a similar method for a diagram/definition that would return the workspaceid.