+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Senior Member DNK's Avatar
    Computer Details
    DNK's Computer Details
    Operating System:
    Win 7 Ent
    Discipline
    See details...
    DNK's Discipline Details
    Occupation
    Contractor
    Discipline
    See details below.
    Details
    Broadcast Engineering
    Using
    AutoCAD 2011
    Join Date
    Feb 2010
    Location
    ATL
    Posts
    160

    Default Extracting handles?

    Registered forum members do not see this ad.

    Is there a clean way of extracting block handles based upon block names? How about the handles of the attributes nested in the blocks?

    Will Data Extraction do it and I just can't find the right settings?
    Last edited by DNK; 18th Feb 2010 at 09:05 pm.

  2. #2
    Senior Member DNK's Avatar
    Computer Details
    DNK's Computer Details
    Operating System:
    Win 7 Ent
    Discipline
    See details...
    DNK's Discipline Details
    Occupation
    Contractor
    Discipline
    See details below.
    Details
    Broadcast Engineering
    Using
    AutoCAD 2011
    Join Date
    Feb 2010
    Location
    ATL
    Posts
    160

    Default

    Tap, tap, tap....Is this thing on?

  3. #3
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro 4000, 2GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2013
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    33,023

    Default

    Yes it is. Thanks for checking.

    Have you done an Internet search?
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

  4. #4
    Senior Member DNK's Avatar
    Computer Details
    DNK's Computer Details
    Operating System:
    Win 7 Ent
    Discipline
    See details...
    DNK's Discipline Details
    Occupation
    Contractor
    Discipline
    See details below.
    Details
    Broadcast Engineering
    Using
    AutoCAD 2011
    Join Date
    Feb 2010
    Location
    ATL
    Posts
    160

    Default

    Quote Originally Posted by ReMark View Post
    Yes it is. Thanks for checking.

    Have you done an Internet search?

    Of course. And I've gotten a mixture of ATTOUT, Data Extraction, a lot of stuff concerning Tables, but it's not quite what I'm looking for.

    I was more looking along the lines of getting the information in a drawing by drawing manner, of the data that is defined using the LIST command, but isolated to only blocks, based upon block name with a wildcard. It'd also be nice to be able to select only the data I need.

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Hey DNK, nice to see you in these parts

    Perhaps a custom LISP may accomplish this task - what would you extract to?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  6. #6
    Senior Member DNK's Avatar
    Computer Details
    DNK's Computer Details
    Operating System:
    Win 7 Ent
    Discipline
    See details...
    DNK's Discipline Details
    Occupation
    Contractor
    Discipline
    See details below.
    Details
    Broadcast Engineering
    Using
    AutoCAD 2011
    Join Date
    Feb 2010
    Location
    ATL
    Posts
    160

    Default

    Quote Originally Posted by Lee Mac View Post
    Hey DNK, nice to see you in these parts

    Perhaps a custom LISP may accomplish this task - what would you extract to?

    CSV maybe. Ideally, anything that I can manipulate in excel.

    Oooh. Maybe using ATTEXT?

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Is it just the attribute tags and relevant handles you want extracted, or block (insert) handles as well?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  8. #8
    Senior Member DNK's Avatar
    Computer Details
    DNK's Computer Details
    Operating System:
    Win 7 Ent
    Discipline
    See details...
    DNK's Discipline Details
    Occupation
    Contractor
    Discipline
    See details below.
    Details
    Broadcast Engineering
    Using
    AutoCAD 2011
    Join Date
    Feb 2010
    Location
    ATL
    Posts
    160

    Default

    Quote Originally Posted by Lee Mac View Post
    Is it just the attribute tags and relevant handles you want extracted, or block (insert) handles as well?

    Both actually. I'd like to list the block and the block handle (with some other basic properties like layer, name etc), then list out each attribute and it's respective handle. For the attributes, I'd like to list the tag (as the header) and then the value.

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Try this mate:

    Code:
    (defun c:BlockOut (/ *error* lst2str FILE IATT IBLK INFO OFILE SS)
      (vl-load-com)
    
      (defun *error* (msg)
        (and ofile (close ofile))
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n** Error: " msg " **")))
        (princ))    
    
      (defun lst2str (lst del)
        (if (cdr lst)
          (strcat (car lst) del (lst2str (cdr lst) del))
          (car lst)))
    
      (if (and (ssget '((0 . "INSERT")))
               (setq file (getfiled "Output File" "" "csv" 1)))
        (progn
          (vlax-for obj (setq ss (vla-get-ActiveSelectionSet
                                   (vla-get-ActiveDocument (vlax-get-acad-object))))
    
            (setq iBlk
              (list
                (if (vlax-property-available-p obj 'EffectiveName)
                  (vla-get-EffectiveName obj)
                  (vla-get-Name obj))
    
                (vla-get-Handle obj)))
    
            (if (eq :vlax-true (vla-get-HasAttributes obj))
    
              (foreach att (vlax-invoke obj 'GetAttributes)
    
                (setq iAtt (cons (list (vla-get-TagString att)
                                       (vla-get-Handle att)
                                       (vla-get-TextString att)) iAtt))))
    
            (setq Info (cons (cons iBlk iAtt) Info) iBlk nil iAtt nil))
    
          (vla-delete ss)
    
          (setq ofile (open file "w"))
    
          (foreach b Info
    
            (write-line (lst2str (car b) ",") ofile)
    
            (foreach a (cdr b)
    
              (write-line (lst2str a ",") ofile))
    
            (write-line "" ofile))        
    
          (setq ofile (close ofile))))
    
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  10. #10
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,707

    Default

    Registered forum members do not see this ad.

    Did my code work for you DNK?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. Extracting Attributes 2
    By jamesconti in forum AutoCAD General
    Replies: 1
    Last Post: 27th Oct 2009, 10:58 am
  2. Extracting Text?
    By BenE in forum AutoCAD Beginners' Area
    Replies: 11
    Last Post: 31st Dec 2008, 12:09 am
  3. Extracting Xdata
    By JLG in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 6th Dec 2008, 07:45 pm
  4. Extracting Data
    By LSR in forum AutoLISP, Visual LISP & DCL
    Replies: 12
    Last Post: 15th Jun 2005, 08:41 pm
  5. Extracting XClipframes
    By Barry Clark in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 8th May 2004, 12:48 pm

Bookmarks

Posting Permissions

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