VBA equivalent of provided Lisp for -attext

Discussion in 'AutoCAD' started by Dan, Dec 2, 2004.

  1. Dan

    Dan Guest

    How can I convert this to straight VB? I currently end up with a .csv file
    in a sub-folder \Data.

    I hate to use ThisDrawing.SendCommand, but currently I am using it to call
    and run the following lisp:

    '=============Lisp================

    (defun c:SMEXPORT ()
    (command "filedia" "0")
    (setq EXPORTFILE (strcat (getvar "dwgprefix")"data\\SMEXPORT"))
    (command "-attext" "cdf" "smtemplate" EXPORTFILE /013)
    (command "filedia" "1")
    (princ)
    )

    '=============Lisp================



    '===========SMTEMPLATE=========

    NO XREF/NESTED Blocks in template

    Consists of a blockname: SMARK

    Count: (Obviously number of blocks)

    SLENGTH (Att0 of block)

    '===========SMTEMPLATE=========

    Thanks for any leads,

    Dan
     
    Dan, Dec 2, 2004
    #1
  2. Dan

    Jeff Mishler Guest

    Did you look at the Sample for Extracting Attributes? In 2002 it was located
    in this folder:
    c:\\<AcadainstallFolder>\Sample\ActiveX\ExtAttr

    The VBA macro is embedded in the sample Excel workbook.
     
    Jeff Mishler, Dec 2, 2004
    #2
  3. Dan

    Dan Guest

    Thanks for the lead! So simple and available I missed it, forgot about that
    sample. That will get me started!
    Dan
     
    Dan, Dec 2, 2004
    #3
  4. Dan

    Dan Guest

    ~fyi~
    I modified the code to push the attributes from AutoCAD to Excel, and it ran
    much faster, than having Excel grab the attributes from AutoCAD.
    Thanks again for the lead.

    Dan
     
    Dan, Dec 3, 2004
    #4
  5. Dan

    Jeff Mishler Guest

    You're welcome! I'm glad it worked for you. :)
     
    Jeff Mishler, Dec 3, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.