How to know if a drawing has ADT or ABS objects

Discussion in 'AutoCAD' started by adiaz, Jan 7, 2005.

  1. adiaz

    adiaz Guest

    Hi everyone. I would like to run a batch process on a random set of drawings from my Project's Drive to find and write to a file or count if the drawing has object(s) from Architectural Desktop or Building System. Does anybody has a code to do this? The reason I want to do this is to find out if the user(s) are using the full capabilities from this packages. Look like the users are using this software like simple AutoCAD and does not make sense to upgrade it to 2005. Any help would be greatly appreciate. TIA.
     
    adiaz, Jan 7, 2005
    #1
  2. adiaz

    Matt W Guest

    You could do something like this (to get you started).

    For Architectural Desktop
    Code:
    Sub ADT_Object_Search()
    Dim objEnt As AcadEntity
    
    For Each objEnt In ThisDrawing.ModelSpace
    If TypeOf objEnt Is AecWall Then
    MsgBox "Found a wall!"
    End If
    Next objEnt
    End Sub
    
    For Building Systems
    Code:
    Sub ABS_Object_Search()
    Dim objEnt As AcadEntity
    
    For Each objEnt In ThisDrawing.ModelSpace
    If TypeOf objEnt Is AecbDevice Then
    MsgBox "Found a device!"
    End If
    Next objEnt
    End Sub
    
    You'll have to add a reference to the AEC Architectural 4.5 Object Library
    and the AEC Building Systems 4.5 Object Library.
    I'm not sure how you would go about doing a search for ALL AEC (ADT) or AECB
    (ABS) objects without adding each type into your code.
    In otherwords, I didn't see a global way to test if an object is an AEC
    object (whether it's a wall, door, window, etc...).
     
    Matt W, Jan 7, 2005
    #2
  3. adiaz

    Matt W Guest

    Yes... I know I posted VB code in a LSP NG.

    Oops!

    I'm not sure how you would go about doing this in LSP or VLISP.

    --
    I support two teams: The Red Sox and whoever beats the Yankees.

     
    Matt W, Jan 7, 2005
    #3
  4. adiaz

    adiaz Guest

    Thank you Matt. I am not familiar with VBA but if a piece of VBA code appears I'll be very happy.
     
    adiaz, Jan 7, 2005
    #4
  5. adiaz

    adiaz Guest

    My idea is to look for AEC objects in the drawing. I think an easy way to do this is setting the demandload =2 and reading what module aec was/were loaded when the drawing was opened. Any light?
     
    adiaz, Jan 7, 2005
    #5
  6. Hi Matt,

    I haven't tried this, but maybe you could use something like:

    For Each objEnt In ThisDrawing.ModelSpace
    If NOT TypeOf objEnt Is AcadObject Then
    MsgBox "Found a non-standard AutoCAD object!"
    End If
    Next objEnt

    It would depend on how the API defines AcadObject.

    Another approach would be to create an collection of each of the types, then
    look at the collection data.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au


     
    Laurie Comerford, Jan 8, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.