+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Apr 2012
    Posts
    6

    Default Attaching Multiple tif's to separate drawings?

    Registered forum members do not see this ad.

    Hello all,

    I have about 1500 .tif files that I need to attach to drawings. Is it possible to write a script or macro of some sort that will automate this process?

    I know how to insert them manually in raster design, but the number of files would be very time consuming. I am using AutoCAD 2009.

    Any help would be appreciated.

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,993

    Default

    For sure you can use a script to automate this task. Create a BAT file in the same folder with those TIFF files and paste there the code below - run that file to get the list of the files to insert.
    Code:
    DIR /b *.TIF > fileslst.txt
    After I suggest you to use Excel to create the script lines.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,993

    Default

    Your script file should look like:
    Code:
    _NEW  _IMAGE _A C:\\TiffFiles\\TiffFile1st.TIF 0,0 1 0 _ZOOM _E _SAVE C:\\DWGFiles\\DWGFile1st.DWG _CLOSE
    _NEW  _IMAGE _A C:\\TiffFiles\\TiffFile2nd.TIF 0,0 1 0 _ZOOM _E _SAVE C:\\DWGFiles\\DWGFile2nd.DWG _CLOSE
    _NEW  _IMAGE _A C:\\TiffFiles\\TiffFile3rd.TIF 0,0 1 0 _ZOOM _E _SAVE C:\\DWGFiles\\DWGFile3rd.DWG _CLOSE
    Adjust the colored parts to match your requirements - path of TIFF file, insertion point, scale factor, rotation angle and target DWG file's path.
    Please take care that after _NEW you should let 2 spaces; also the script should end with an empty line. Save this file with SCR extension.
    It is very important to don't have spaces in TIFF or DWG paths, since those will be treated as <ENTER>.

    Call the SCRIPT command, you will be asked to point to the said script file.
    Last edited by MSasu; 12th Apr 2012 at 08:34 pm. Reason: Extra comments
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  4. #4
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Apr 2012
    Posts
    6

    Default

    Thanks, I got it working...... sort of.

    I created a test file on my desktop and the script works perfectly.

    The files I need to work with are on our server and the file path has spaces in it. The script gives an error on the first space every time. Is there a way to ignore the space in the file path?

  5. #5
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,993

    Default

    Try to contain that path with quotation marks (").
    Code:
    _NEW  _IMAGE _A "C:\\TiffFiles\\TiffFile1st.TIF" 0,0 1 0 _ZOOM _E _SAVE "C:\\DWGFiles\\DWGFile1st.DWG _CLOSE"
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  6. #6
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Apr 2012
    Posts
    6

    Default

    I tried that. It just says enter file name on the command bar at that point.

  7. #7
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Apr 2012
    Posts
    6

    Default

    I am just trying to insert it at this point. This is what my script looks like:

    _NEW _IINSERT "G:\Engineering\CURRENT JOBS\PLANT\11153 DCS Migration Execute Phase\DRAWINGS\WORKING SET\LOOPS\HEATH1.TIF"

    This is what shows up in the AutoCAD text window:

    Command: _IINSERT
    Command:
    Enter image file name: "G:\Engineering\CURRENT JOBS\PLANT\11153
    DCS Migration Execute Phase\DRAWINGS\WORKING SET\LOOPS\HEATH1.TIF"
    "G:\Engineering\CURRENT JOBS\PLANT\11153 DCS Migration Execute
    Phase\DRAWINGS\WORKING SET\LOOPS\HEATH1.TIF" was not found or is not valid.

  8. #8
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,993

    Default

    Seems that the path you used isn'y valid of the file is not available.
    Please past the line below on AutoCAD's command prompt - if the result will be "nil" then you should re-check the path.
    Code:
    (findfile "G:\\Engineering\\CURRENT JOBS\\PLANT\\11153 DCS Migration Execute Phase\\DRAWINGS\\WORKING SET\\LOOPS\\HEATH1.TIF")
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  9. #9
    Forum Newbie
    Using
    AutoCAD 2009
    Join Date
    Apr 2012
    Posts
    6

    Default

    Registered forum members do not see this ad.

    Well, if I copied the path and entered it manually, it worked. Just wouldnt work when the script ran. I got it to work though, I think I was missing a space or blank line. Thanks for all your help.

Similar Threads

  1. Attaching Objects, Attaching Vertex, Cutting holes
    By evanesp26 in forum 3D Modelling
    Replies: 1
    Last Post: 8th Feb 2010, 07:50 am
  2. Separate Drawings on Taskbar How to
    By voltron in forum AutoCAD Beginners' Area
    Replies: 3
    Last Post: 22nd Sep 2009, 10:37 pm
  3. Drawings form Multiple sources (multiple xrefs)
    By Gila in forum CAD Management
    Replies: 2
    Last Post: 28th May 2008, 03:17 pm
  4. Attaching drawings and preserving ps viewports
    By philco in forum AutoCAD General
    Replies: 14
    Last Post: 14th Oct 2007, 04:02 pm
  5. Exporting individual layouts to separate drawings?
    By Gideon in forum AutoCAD General
    Replies: 3
    Last Post: 5th May 2005, 03:53 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