+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Newbie
    Using
    AutoCAD LT 2008
    Join Date
    Jun 2008
    Posts
    3

    Default Attribute Extraction for 2008 LT

    Registered forum members do not see this ad.

    Hi Guys,

    Is it possible to have the Attribute Extraction routine automated with a script
    (I get confused between Script, Diesel or Lisp) I think scripts are applicable as my 2008 LT version does not have VBA.

    Currently, I have a drawing template and it’s the only one I use, The template has a drawing title block, into which I have placed all the title block text that is needed for the completed drawing. I then extract it to a text file from which I import it to Excel as a drawing register. Some of the attributes are hidden from view and are used for more detail information about the drawing and also aid the searching within Excel.

    I would like to automate the following manual routine:-
    Tools – “Attribute Extraction”
    Choose – Coma Delimited (cdf)
    Template File (I only use one template file)
    Output File (I only use one output file)
    Click OK

    Then from within excel, I can use VBA to import the data from the text file.

    At the moment my knowledge of AutoCAD scripts is zero, but it sound like the sort of thing I need to learn (with a little help from you guys J)

    If anyone can help with a script or point me in the right direction, I would be very grateful.

  2. #2
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    AutoCAD scripts are purely a file with the commands that you would type if you were to do it manually.
    When getting used to using scripts, run through the command in autocad, and write down what you type at the command line and when you press enter.

    For your specific question, you will need to set FILEDIA to 0 at the start of the script to ensure that when dialogs would normally show you will get the command line option, then use the -attext command (again, for command line rather than dialog), and then set FILEDIA back to 1 at the end of your script.

    It will be something along the lines of
    Code:
    FILEDIA
    0
    -attext
    C
    etc
    etc
    etc
    FILEDIA
    1
    Each line represents 1 entry to the command line, so using the FILEDIA as an example, in AutoCAD, you would type FILEDIA, then press enter (right-click, space bar, etc) and then type 1, and then press enter again. To represent this in the scr file, type FILEDIA, press enter to start a new line, type 1, then press enter to start a new line again.

    If you use command where you would press enter without typing something, then do the same, just press enter in your script to leave a blank line.

    Remember, the file format for scripts is SCR, so when you have completed the script in your text editor, remember to save with the correct file format.

    Hope this gives you a bit of an insight into how they work.

  3. #3
    Forum Newbie
    Using
    AutoCAD LT 2008
    Join Date
    Jun 2008
    Posts
    3

    Default

    Hi LCE,

    Thanks for the reply. I have been doing a bit of reading since posting the original question and it appears that AutoCAD LT 2008 does not support Autolisp!, am I right in thinking that Autolisp and script files are the same ?

    I tried the code you suggested, using the path for the template and output files but it just returned an error, is this because I have written the script incorrectly or is it because it's an LT installation ?

    Script:-

    FILEDIA
    0
    -attext
    C:\drawings\DATA-TEMPLATE.txt
    C:\drawings\OUTPUT-FILE.txt
    FILEDIA
    1


    file saved as paul2.scr

    error note:-
    Command: '_script
    Command:
    {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl {\f0\fmodern\fprq1\fcharset0
    Unknown command
    "{\RTF1\ANSI\ANSICPG1252\DEFF0\DEFLANG2057{\FONTTB L{\F0\FMODERN\FPRQ1\FCHARSET0"
    . Press F1 for help.

  4. #4
    Super Member
    Computer Details
    Dipali's Computer Details
    Operating System:
    windows vista
    Computer:
    IBM Thinkpad lenovo
    CPU:
    Intel Centrino vPro
    Monitor:
    viewsonicVA1916w
    Using
    AutoCAD LT 2008
    Join Date
    Dec 2007
    Location
    INDIA
    Posts
    989

    Default

    LT can run script. i am also novice about script so can't say what is wrong in your script but
    i do have few scripts & i run it with LT & it works fine.
    "An architect's most useful tools are an eraser at the drawing board & a wrecking bar at the site."
    Frank Lloyd Wright

  5. #5
    Super Member
    Using
    Architecture 2009
    Join Date
    Apr 2008
    Location
    London, (sunny UK)
    Posts
    686

    Default

    Script and Lisp are different Paul.
    Imagine a script a rebuilding the wheel, giving you different ways to do something and automating, whereas script are just like having a monkey sat at your desk typing whilst you make a cuppa, there is no way to do anything differently with autocad or without using autocad commands in scripts. hope that makes sense.

    Replace the code in your .scr with the code below.
    On the lines that are
    Code:
    "file path (include "" )"
    put the file path, so if it is C:\Test.txt then you will put "C:\Test.txt" on that line.

    Code:
    FILEDIA
    0
    -attext
    C
    "file path (include "" )"
    "file path (include "" )"
    FILEDIA
    1
    Let us know if you have any more trouble.

    Cheers

  6. #6
    Forum Newbie
    Using
    AutoCAD LT 2008
    Join Date
    Jun 2008
    Posts
    3

    Default

    Thank you for all your help.

    I did have a few problems getting it to work but eventually, I realised that notepad works better than wordpad in producing .scr files

    Ok, everything I have read so far says, the file must be in ANSII format but it took a while for the penny to drop.

Similar Threads

  1. Attribute Extraction Program?
    By tkwon in forum AutoLISP, Visual LISP & DCL
    Replies: 36
    Last Post: 12th May 2009, 02:25 pm
  2. AutoCAD 2008 Publisher & Attribute extraction
    By Kevwith in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 11th Apr 2008, 09:56 pm
  3. AutoCAD 2008 Lite - Attribute Extraction
    By Steve_Bedford in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 17th Feb 2008, 02:01 pm
  4. Attribute extraction
    By ace9633s in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 22nd Jan 2008, 09:54 pm
  5. Attribute extraction and Fields question
    By MRSWOLF in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 11th Nov 2005, 04:39 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