Results 1 to 4 of 4

Thread: Selecting objects

  1. #1
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Selecting objects

    ok, since there was not any replys on my Selection Set Error question, I am trying another way to select the objects in the drawing? any Ideas?

    I know this does not work but something like this.
    AcadEntities or Objects...
    Dim entity As AcadEntity
    Dim testBlock As AcadBlock

    For Each entity In ThisDrawing.Database.Entities
    If entity.ObjectName = "AcDbBlockReference" Then
    Set testBlock = ThisDrawing.ObjectIdToObject(entity.OwnerID)
    Debug.Print testBlock.Name
    End If
    Next entity

    thanks,
    Jason

  2. #2
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: Selecting objects

    you work long enough.. you will figure it out. I thought that I had already tried this but I got it. I am looking at blocks so the following worked

    Dim allBlocks As AcadBlocks
    Dim myBlock As AcadBlock
    Dim BlockName as String

    BlockName = "hello"

    Set allBlocks = ThisDrawing.Blocks

    For Each myBlock In allBlocks
    If myBlock.Name = BlockName Then
    Debug.Print myBlock.Name & " -- " & myBlock.ObjectID
    End If
    Next myBlock

  3. #3
    100 Club
    Join Date
    2002-10
    Posts
    154
    Login to Give a bone
    0

    Default Re: Selecting objects

    I spoke too soon. that only pulled one. it did not look in all of the layouts

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Selecting objects

    It didn't look in ANY of the layouts. It looked in the block collection (ThisDrawing.Blocks), where block definitions are stored. Remember, blocks are made up of 2 parts, definitions and insertions. To find insertions, you can create a selection set, filtering for block insertions of a specific name.
    C:> ED WORKING....


    LinkedIn

Similar Threads

  1. Selecting objects
    By dmris300 in forum ACA General
    Replies: 3
    Last Post: 2006-10-27, 08:21 AM
  2. I need help selecting objects
    By BARRY.FERGUSON in forum AutoCAD General
    Replies: 1
    Last Post: 2004-10-12, 12:37 PM
  3. Selecting all similar objects
    By SCShell in forum Revit Architecture - General
    Replies: 4
    Last Post: 2004-01-12, 03:04 PM
  4. Selecting multiple objects
    By Kroke in forum Revit Architecture - General
    Replies: 3
    Last Post: 2004-01-11, 04:43 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
  •