Getting object AcadSelectionSet to select entire drawing

Discussion in 'AutoCAD' started by stephenlecompte, Feb 10, 2005.

  1. I'm trying to get AcadSelectionSet to select an entire drawing pulled up as an AcadDocument! The following is what I have:

    Dim acadApp As AutoCAD.AcadApplication
    Dim acadDoc As AutoCAD.AcadDocument
    Dim objSelection As AutoCAD.AcadSelectionSet

    Set acadDoc = GetObject(strPath)
    'strPath is a text box with the entire filename path of a .dwg file
    Set acadApp = acadDoc.Application
    Set objSelection = ????

    Not sure how to properly show Set objSelection without putting add in there to do so? I know eventually I will have to do a acSelectionSetAll to pull up everything in a window but not sure on the correct format?

    Is there also a way to define objSelection even more with just selecting all blocks that happen to be labeled as door_TAG?
     
    stephenlecompte, Feb 10, 2005
    #1
  2. stephenlecompte

    Norman Yuan Guest

    as an AcadDocument! The following is what I have:
    Set objSelection=acadDoc.SelectionSets.Add("MySet")
    objSelection.Select acSelectionSetAll

    In above code, if the current opened drawing has already had a SelectionSet
    called "MySet" in it, you will got runtime error. When programmatically
    adding a SelectionSet, I always loop through the Document.SelectionSets
    collection to make sure there is no SelectionSet with the same name.
    there to do so? I know eventually I will have to do a acSelectionSetAll to
    pull up everything in a window but not sure on the correct format?
    all blocks that happen to be labeled as door_TAG?
     
    Norman Yuan, Feb 11, 2005
    #2
  3. An alternative method is to use error trapping and unconditionally add
    the set followed by clearing it.
     
    Frank Oquendo, Feb 11, 2005
    #3
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.