Page 2 of 6 FirstFirst 123456 LastLast
Results 11 to 20 of 54

Thread: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

  1. #11
    Member
    Join Date
    2007-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Sorry about the delay in reply; Rob I could loop through the layouts successfully however when I use the Set attributes function nothing changes. I looked into the code and its because of the row count for the dwg name and the rowcount for the attribs are different any ideas to work around. I hope you understand what I mean. If you want I can attach the modified excel spreadsheet

  2. #12
    Member
    Join Date
    2007-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    I have to thank Katrina for the spreadsheet it helped me to discover the power of ObjectDBX .

  3. #13
    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: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Quote Originally Posted by sujit.subramaniam View Post
    Sorry about the delay in reply; Rob I could loop through the layouts successfully however when I use the Set attributes function nothing changes. I looked into the code and its because of the row count for the dwg name and the rowcount for the attribs are different any ideas to work around. I hope you understand what I mean. If you want I can attach the modified excel spreadsheet
    I don't think posting the spreadsheet will help. You need to post your code. Please use the code tags in the advanced editor (the # button).
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  4. #14
    Member
    Join Date
    2009-04
    Posts
    9
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    I know this thread is several months old.. but I'm trying to do the exact same thing.. except I'm doing it through stand-alone VB.NET app instead of through excel. I've been trying to use ObjectDBX, but I can't figure out how to do it. I was using selectionsets, but those don't work with odbx.

    How do you iterate through the layouts collection? I know how to do a For... next loop.. that's not what I'm having trouble with. This is my first time automating AutoCAD and I'm not sure what the layouts collection, or how you access it to loop through it.

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

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Any collection object can be iterated using:

    For Each CollectionObjectType In Collection
    'perform tasks

    Next

    Where CollectionObjectType is a variable of the type the collection holds and Collection is an instance of the collection being iterated.

    In the case of layouts, the Layout object is a special object that acts as a wrapper for a block of the pattern *PAPER_SPACE#, where # is the number of the block. Blocks starting with an asterisk are called anonymous blocks. Layout blocks store the entities in the layout. You access them using the Layout object's Block property. The block items can be accessed using it's Items collection.
    C:> ED WORKING....


    LinkedIn

  6. #16
    Member
    Join Date
    2009-04
    Posts
    9
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Ok think that I understand what you're saying... I tried this code.. and it works... sort of... but it's only returning one block when there are two in the file... any idea why?

    Dim Block As AXAUTO15Lib.AcadBlock
    For Each Block In V_AutoCadInterfaceObject.Blocks
    If Block.Name.ToString = "START" Then
    MsgBox(Block.Name.ToString)
    End If
    Next Block

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

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    You are searching the Blocks table for the definition. You need to search paperspace for AcadBlockRef objects, the block insertions.
    C:> ED WORKING....


    LinkedIn

  8. #18
    Member
    Join Date
    2009-04
    Posts
    9
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Wow... that went right over my head! I'm sorry.. this is my first time ever trying to work with AutoCAD with a program other than very simple AutoLisp programming, and I still haven't quite wrapped my head around it yet.

    Any chance you could give some more detail about how you search paperspace for AcadBlockRef objects?

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

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    In case I don't get a chance to get you some code quickly, search this forum for "acadblockref".
    C:> ED WORKING....


    LinkedIn

  10. #20
    Member
    Join Date
    2009-04
    Posts
    9
    Login to Give a bone
    0

    Default Re: VBA and ObjectDbx - AutoCAD to Excel Attribute Extraction Tool

    Ok.. I'll try a search and see what I come up with... I'll post back if I find something... thank-you!

Page 2 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. CP214-3: All Things Extraction: From AutoCAD to Databases, Excel, and XML Using .NET
    By Autodesk University in forum Customization and Programming
    Replies: 0
    Last Post: 2014-12-01, 02:08 AM
  2. Help needed with Attribute extraction and import into MS Excel
    By Lee Buckmaster in forum Productstream - General
    Replies: 0
    Last Post: 2012-04-30, 08:23 PM
  3. Attribute extraction to Word or Excel
    By KristiS in forum CAD Management - General
    Replies: 6
    Last Post: 2009-01-06, 09:16 PM
  4. attribute extraction to excel
    By jbortoli in forum VBA/COM Interop
    Replies: 5
    Last Post: 2008-02-07, 01:58 PM
  5. Block attribute extraction to an AutoCAD Table
    By DFlynn in forum AutoCAD Tables
    Replies: 2
    Last Post: 2006-02-13, 01:41 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
  •