Results 1 to 4 of 4

Thread: Find Block by Attribute

  1. #1
    Member
    Join Date
    2014-08
    Posts
    2
    Login to Give a bone
    0

    Default Find Block by Attribute

    I'm new to programming for Autocad, using VB from Visual Studio 2013 Express and Autocad 2012. My question: Is there a way to Find (zoom to) a block according to text value of two of its attributes? For my situation the block is a circle and would like to find by its House Number and Street Name attributes.

    Thanks in advance for any help given.

    Tim Harris

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Find Block by Attribute

    Quote Originally Posted by timharris677625 View Post
    I'm new to programming for Autocad, using VB from Visual Studio 2013 Express and Autocad 2012. My question: Is there a way to Find (zoom to) a block according to text value of two of its attributes? For my situation the block is a circle and would like to find by its House Number and Street Name attributes.

    Thanks in advance for any help given.

    Tim Harris
    Welcome to AUGI.

    You can get the ObjectIds of the applicable BlockReference Objects, and iterate their Attribute's values to determine which (if any) match the supplied (GetString()?) criteria, and conditionally allow the ability to zoom to based on said BlockReference's InsertionPoint.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2014-08
    Posts
    2
    Login to Give a bone
    0

    Default Re: Find Block by Attribute

    BlackBox,

    Thank you very much! I have it working per your suggestion. I finally waded through the muddy water that is clear to you veterans.

    This site is so helpful and much appreciated!!!


    Tim Harris

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Find Block by Attribute

    Quote Originally Posted by timharris677625 View Post
    BlackBox,

    Thank you very much! I have it working per your suggestion. I finally waded through the muddy water that is clear to you veterans.

    This site is so helpful and much appreciated!!!
    While I still consider myself to be very much a student of .NET, I could not have asked for a better response... Thanks for your kind words, Tim.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 13
    Last Post: 2012-09-18, 07:51 PM
  2. Find block by attribute value
    By lshivers in forum AutoLISP
    Replies: 2
    Last Post: 2009-04-12, 01:39 PM
  3. Copy previous Block Attribute Value to next Block Attribute
    By CADfunk MC in forum VBA/COM Interop
    Replies: 8
    Last Post: 2009-02-27, 09:46 PM
  4. Find a block attribute by Tag and replace Value
    By montana.fox in forum VBA/COM Interop
    Replies: 14
    Last Post: 2006-09-14, 03:07 PM
  5. Block Attribute Manager Vs. Enhanced Attribute Editor
    By zoomharis in forum AutoCAD General
    Replies: 0
    Last Post: 2006-04-15, 11:53 AM

Posting Permissions

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