Results 1 to 4 of 4

Thread: Workspaces

  1. #1
    Member
    Join Date
    2008-02
    Location
    New York
    Posts
    29
    Login to Give a bone
    0

    Default Workspaces

    Does anyone know if there an object in VBA to manipulate workspaces?

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Workspaces

    No. There is a .NET API for the CUI. All VBA can do is make a workspace active, via the WSCurrent system variable.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    Member
    Join Date
    2008-02
    Location
    New York
    Posts
    29
    Login to Give a bone
    0

    Default Re: Workspaces

    Thanks, Was I was looking for was the ability to list the workspaces available. I guess you can’t do that via VBA?

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Workspaces

    Quote Originally Posted by jason.bell View Post
    Thanks, Was I was looking for was the ability to list the workspaces available. I guess you can’t do that via VBA?
    Yes, you can do that, using the XML API. This code is from my AU classes.
    Code:
    Private Function GetWorkspaces(CUIFilename As String) As Variant
      Dim myXML As DOMDocument
      Set myXML = New MSXML2.DOMDocument
      myXML.Load CUIFilename
      
      Dim myList As MSXML2.IXMLDOMNodeList
      Set myList = myXML.getElementsByTagName("WorkspaceConfig")
      
      Dim myCount As Long
      myCount = myList.Length - 1
      
      Dim resList As Variant
      ReDim resList(0 To myCount) As String
      
      Dim i As Long
      For i = 0 To myCount
        resList(i) = myList.Item(i).text
      Next i
      GetWorkspaces = resList
    End Function
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

Similar Threads

  1. 2011: Workspaces
    By Spenner in forum AutoCAD General
    Replies: 6
    Last Post: 2010-10-05, 02:13 PM
  2. workspaces
    By jenniferchavez in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2010-04-28, 09:38 PM
  3. CAD & MEP Workspaces
    By gfreddog in forum AutoCAD General
    Replies: 10
    Last Post: 2008-04-14, 08:05 PM
  4. Workspaces
    By rhayes.99001 in forum ACA General
    Replies: 1
    Last Post: 2007-12-15, 11:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •