Page 5 of 6 FirstFirst 123456 LastLast
Results 41 to 50 of 54

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

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

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

    Take a look at post 35 above.
    C:> ED WORKING....

  2. #42
    Active Member
    Join Date
    2013-06
    Posts
    72
    Login to Give a bone
    0

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

    Anyone that use this macro have any idea why it seems to massacre memory with AutoCAD (2010, in my case)? I am running it on a folder with about 20,000 drawings in it. For the first, say, 100 drawings ... AutoCAD is in the 141MB of RAM range; climbing and dropping about 3MB for every file "opened" then "closed". Then it jumps up about 75MB at a time until it hits another plateau around 1,6GB ... then again at 2.4GB ... then again at 3.1GB ... and probably again even further on, but I don't generally like watching task manager.

    It seems like the "connection" to AutoCAD needs to be severed once in a while to wipe memory. I ran a test on a folder; took 1 minute 5 seconds to acquire the blocks. I then ran the macro again but where it ran about 1,000 drawings BEFORE that folder; same files took 3 minutes 12 seconds. I figured the "AcadDBX = nothing" part disconnected from AutoCAD, but it seems only to kindof close that file.

    I was thinking I could code it to re-establish the AutoCAD DBX connection every, say, 200 drawings, to clean memory. I've gone over the code extensively, and it's quite simple, but I don't see any place where anything is being left open. I am using the one without the year indicated, and I see the more recent one has a few changes, so maybe I'll compare them.
    Last edited by e_casagrande394681; 2013-08-07 at 05:48 PM.

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

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

    The first thing that comes to my mind is that xl has an object model where objects are not automatically disposed of when they go out of scope. You need to explicitly set them to Nothing in the reverse order that they were created. e.g. if you use a sheet obj to create a range, you need to set the range to nothing, then set the sheet to nothing. If you don't you will end up with multiple instances of xl running. You can look at the Processes tab of Task Manager to see how many instances of xl are running.
    C:> ED WORKING....

  4. #44
    Active Member
    Join Date
    2013-06
    Posts
    72
    Login to Give a bone
    0

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

    Hmmm, this is a possibility; I am definitely not doing them in reverse order, and they're definitely nested. I would expect that it would ALWAYS work badly, but I suppose some unique combination for certain files makes my code run in a different order. Last night I ran a long list of files and found that, when Excel stops, the 3.2GB that AutoCAD was using remained. It stayed like that, despite AutoCAD and Excel not actually running (as applications), for at least 1/2 hr. Went to sleep, woke up, AutoCAD had closed at some point.

    A friend told me about some troubleshooting techniques for monitoring how much memory something is using; I will look into that.

    Normally I wouldn't care, but I have a large project coming (maybe 750,000 documents) and I expect to need this macro extensively; fixes for 1% speed increase matter to me ... as would memory "leaks".

  5. #45
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

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

    AutoCAD saves some time by loading a lot of things into memory as it goes e.g. MTEXT editor when MTEXT is edited, object enablers, materials... as the drawings are processed, more of these are found and loaded. They are only unloaded when the application is closed. Not *exactly* a memory leak, as AutoCAD is performing as designed. That design never considered a scenario when 100k+ drawings are sequentially opened in a single session.

    I would suggest taking the elephant approach: break the massive stack of drawings into workable chunks, and have AutoCAD chew the chunks separately to avoid needing a digital Heimlich.

  6. #46
    Active Member
    Join Date
    2013-06
    Posts
    72
    Login to Give a bone
    0

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

    Oddly enough, I have found the "problem", though I have zero idea why it's happening. There are specific files which, when opened, basically don't close properly. I have no idea why, but it's ALWAYS these files. They don't have a ton of entities, or some common goofy block that's crashing the script, or anything. Everything goes EXACTLY as planned, but AutoCAD just never "closes" the file ... for some reason.

    Initially thought it was older AutoCAD files, but they are all saved as 2010. Annoying.

    Edit: Turns out, this "problem" is when drawings have an image embedded.
    Last edited by e_casagrande394681; 2013-08-08 at 04:28 AM.

  7. #47
    Login to Give a bone
    0

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

    Hello,

    This release _2011 always return only one block record (have 3 into my test drawing). Do you have another release of this useful tool? Thanks for sharing!

  8. #48
    Login to Give a bone
    0

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

    I've tried several times but it always sent back one block (and there's three). File have been saved as xlsm btw. Can you help me?

  9. #49
    Member
    Join Date
    2013-02
    Posts
    13
    Login to Give a bone
    0

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

    Dynamic Blocks?

    It's a long shot, but has anyone adapted the VBA code, from this most awesome spreadsheet, to be able to access dynamic blocks?

    If not I'll continue to stumble my way through the required modifications.

  10. #50
    Member
    Join Date
    2013-02
    Posts
    13
    Login to Give a bone
    0

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

    Quote Originally Posted by Michel.Levesque.ST522691 View Post
    I've tried several times but it always sent back one block (and there's three). File have been saved as xlsm btw. Can you help me?
    Are any of the blocks "dynamic blocks"? If so, that may be your problem.

Page 5 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
  •