Results 1 to 4 of 4

Thread: Export and Import drawing slow only need data SH changed

  1. #1
    Login to Give a bone
    0

    Default Export and Import drawing slow only need data SH changed

    I am having difficulty finding a faster method than export data to spreadsheet and importing with changes to file. Using this process over network takes 10 minutes for 20 dwgs in project. I have been unable to find any property that I can change using lisp for the Sheet in attachment.

    TESTFILE.xlsx

  2. #2
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Export and Import drawing slow only need data SH changed

    I would try a dxb module.

    It is a way to open and query a drawing file without opening it in AutoCAD.

    It comes from the old (really old) days when AutoCAD only had a single drawing interface.

    Code:
    ;___________________________________________________________________________________________________________|
    ;
    ; Written By: Peter Jamtgaard copyright 2024 All Rights Reserved
    ;___________________________________________________________________________________________________________|
    ;
    ; Any use by unauthorized person or business is strictly prohibited.
    ;___________________________________________________________________________________________________________|
    ;
    ; Abstract: This routine uses the DBX module (interface object) to read unopen drawing files.
    ;___________________________________________________________________________________________________________|
    ;
    ; Command Line Function Header List
    ;___________________________________________________________________________________________________________|
    
    ;* C:DBXModule	        
    ;* Command Line Function to call the DBX Module function for each member of list of drawings
    
    ;___________________________________________________________________________________________________________|
    ;
    ; General Function Header List
    ;___________________________________________________________________________________________________________|
    ;
    ;  Function List		Argument1	Argument2 	Arguement3
    
    ;* (DBXModule strFileName)
    ;* Function to read a drawing file (all layouts) and search for text and print the textstring to command line
    
    ;$ End Header
    
    ;___________________________________________________________________________________________________________|
    ;
    ; Command Line Function to call the DBX Module function for each member of list of drawings
    ;___________________________________________________________________________________________________________|
    
    (defun C:DBXModule (/ strFileName strInterfaceString strVersionNumber )
     (if (and (setq strVersionNumber   (substr (getvar "ACADVER") 1 2))
              (setq strInterfaceString (strcat "ObjectDBX.AxDbDocument." strVersionNumber))
         )
      (progn
       (setq objDBXInterface (vla-GetInterfaceObject
                              (vlax-get-acad-object)
                              strInterfaceString
                             )
       )
       (foreach strFileName (list "HelloWorld1.dwg" "HelloWorld2.dwg")
        (DBXModule objDBXInterface strFileName)
       )
       (vlax-release-object objDBXInterface)
      )
     )
    )
    
    ;___________________________________________________________________________________________________________|
    ;
    ; Function to read a drawing file (all layouts) and search for text and print the textstring to command line
    ;___________________________________________________________________________________________________________|
    
    (defun DBXModule (objDBXInterface strFileName /  DBXOBJ DBXFILE DWGNAME LOOBJ OBJ)
     (if (setq strFullName (findfile strFileName))
      (progn
       (vla-open objDBXInterface strFullName)
       (vlax-for objLayout (vla-get-layouts objDBXInterface)
        (vlax-for objItem  (vla-get-block objLayout)
         (if (wcmatch (vla-get-objectname objItem) "AcDbText")
          (print (vla-get-textstring objItem))
         )
        )
       )
       ; (vla-saveas objDBXInterface strFullName); <- Can also make changes to a drawing file
      )
      (princ (strcat "\nError finding: " strFileName))  
     )   
    )
    
    (princ "!")
    (vl-load-com)
    Attached Files Attached Files
    AutomateCAD

  3. #3
    Login to Give a bone
    0

    Default Re: Export and Import drawing slow only need data SH changed

    Only problem I am unable to identify property which would make proces super fast and didn't see if I was able to adapt your routine for my situation.

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: Export and Import drawing slow only need data SH changed

    Quote Originally Posted by larry.kiener810609 View Post
    Only problem I am unable to identify property which would make proces super fast and didn't see if I was able to adapt your routine for my situation.
    This routine will iterate through multiple drawings in a matter of seconds.

    So if you need to query a drawing, you write the code to create the data.

    What data are you reading from each drawing?

    Can you describe it?
    AutomateCAD

Similar Threads

  1. 2013: Import shapes and attached data (shapefile, object data etc) to Revit
    By cooperch663326 in forum Revit Architecture - General
    Replies: 4
    Last Post: 2014-06-02, 10:53 AM
  2. Slow.. slow..very slow..Gallery
    By engwaiphyo in forum AutoCAD Gallery
    Replies: 6
    Last Post: 2009-04-09, 07:32 PM
  3. Replies: 10
    Last Post: 2008-02-21, 07:44 PM
  4. Limit Regens to only changed layers
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-11-28, 12:54 PM
  5. Export/Import Text, Attribute data, tags etc from drawings and Excel
    By Subramanyam.Perivenkata in forum AutoLISP
    Replies: 3
    Last Post: 2006-03-23, 06:06 PM

Tags for this Thread

Posting Permissions

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