Page 1 of 4 1234 LastLast
Results 1 to 10 of 40

Thread: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

  1. #1
    100 Club
    Join Date
    2006-11
    Location
    Martinsburg, WV USA
    Posts
    192
    Login to Give a bone
    0

    Default EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    I am drawing assemblies and have many parts that are labeled on the views. Some of the parts are used multiple times on the assembly drawing, so I need to create a table for each drawing to show an overall bill of materials. Could someone help me with a LISP that I can just select all of my blocks in that drawing, and it will create a simple table with the attribute data and combined quantities?

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

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    Have you looked into using the DATAEXTRACTION Command?
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    100 Club
    Join Date
    2006-11
    Location
    Martinsburg, WV USA
    Posts
    192
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    I have used dataextraction but I have so many tables to make that a LISP makes much more sense. It would cut out all of the data extraction creation steps.

  4. #4
    Member
    Join Date
    2009-10
    Posts
    10
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    Hi James,

    Your request is very similar to a request I made not so long ago.
    See this thread: - http://forums.augi.com/showthread.ph...isp-table-help

    I got an excellent response.

  5. #5
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    Ignored as unanswered

    ~'J'~
    Last edited by fixo; 2012-06-27 at 10:31 AM.
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  6. #6
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    I made a LISP to do a data extraction. But because the command line version of the DATAEXTRACTION command lacks in any options, what I ended up doing was making a workaround.

    Because I only wanted certain attributed blocks, I set up a dxe template file with all the options I wanted, including all the blocks I want to extract, then saved this as dext.dxe in my C:\Temp folder. This command performs a SAVEAS to save the drawing as dext.dwg in the temp folder, performs the data extraction, then saveas it back to its original filename. It's not elegant, but it's the only way I could figure out how to automate the extraction with all the options I want.

    Hope this helps!

    Code:
    (vl-load-com)
    (dos_demandload)
    
    (defun c:dext ( / *error* vars old dn dp dwg)
    
      
    (princ "\nPlease wait while DEXT processes the BOM Table...")
    
      (defun *error* ( msg );error handler
        (and old (mapcar 'setvar vars old))
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n** Error: " msg " **")))
        (princ)
      )
    
      (setq vars '("CMDECHO" "FILEDIA") old (mapcar 'getvar vars))
      (mapcar 'setvar vars '(0 0));set variables
    
      (setq dn (getvar "dwgname"));get filename
      (setq dp (getvar "dwgprefix"));get file path
    
    (setq xls (vl-string-subst ".xls" ".dwg" dn))
    
    (dos_copy "X:\\CONTROLLED_DOCUMENTS\\SYSTEMS\\ENGINEERING_DOCUMENTS\\AUTOCAD_STANDARDS\\Templates\\dext.dxe" "c:\\temp\\dext.dxe");copy dext.dxe from server to local to keep local copy up to date
    (dos_copy "X:\\CONTROLLED_DOCUMENTS\\SYSTEMS\\ENGINEERING_DOCUMENTS\\AUTOCAD_STANDARDS\\Templates\\dext.xls" "c:\\temp\\dext.xls")
    (dos_copy "X:\\CONTROLLED_DOCUMENTS\\SYSTEMS\\ENGINEERING_DOCUMENTS\\AUTOCAD_STANDARDS\\Templates\\dext.dwg" "c:\\temp\\dext.dwg")
      
    (command "SAVEAS" "2010" (strcat "C:\\Temp" "\\" "dext.dwg") "YES");temporary directory for dummy dxe
      
    (command "-dataextraction" "c:\\temp\\dext.dxe" "YES" "-75,75,0");perform the data extraction, place the table at a specific location in drawing
    
    (command "_.DELAY" 7000);allows time for acad to write the xls file
    	
    (dos_copy "c:\\temp\\dext.xls" (strcat dp "..\\misc\\" xls));copy excel sheet to misc folder in project directory
      
    (command "SAVEAS" "2010" (strcat dp dn) "YES");restore dwg to original directory
    
      (mapcar 'setvar vars old);return variables
      (princ "\nDEXT has successfully created the Item List")
      (princ);exit quietly
      )
    Phillip Bradshaw
    Lead Pixel Pusher, Lucid Design Studio
    CAD Detailer, Proctor Productions

    A doctor can bury his mistakes but an architect can only advise his clients to plant vines. - Frank Lloyd Wright

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

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    For those that do not already have DOSLib:

    http://www.en.na.mcneel.com/doslib.htm
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  8. #8
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    Quote Originally Posted by RenderMan View Post
    For those that do not already have DOSLib:

    http://www.en.na.mcneel.com/doslib.htm
    Yes, forgot to mention that. Thanks.
    Phillip Bradshaw
    Lead Pixel Pusher, Lucid Design Studio
    CAD Detailer, Proctor Productions

    A doctor can bury his mistakes but an architect can only advise his clients to plant vines. - Frank Lloyd Wright

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

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    No worries, stusic.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  10. #10
    100 Club
    Join Date
    2006-11
    Location
    Martinsburg, WV USA
    Posts
    192
    Login to Give a bone
    0

    Default Re: EXTRACT ATTRIBUTE DATA FROM SELECTED OBJECTS & CREATE TABLE IN MODEL SPACE

    This would probably work for what I need, but I have no idea how to use it lol. I saved and loaded the LISP, but DEXT does not do anything. I also downloaded and installed the DOSLib, but have no idea what that is for either...

Page 1 of 4 1234 LastLast

Similar Threads

  1. Replies: 7
    Last Post: 2011-11-18, 12:08 PM
  2. Replies: 2
    Last Post: 2010-03-23, 07:22 PM
  3. Extract Attribute Data into a Table
    By KansasCAD in forum AutoCAD Tables
    Replies: 1
    Last Post: 2006-04-21, 02:59 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
  •