Rename image

Discussion in 'AutoCAD' started by gosnil, Oct 7, 2004.

  1. gosnil

    gosnil Guest

    Does any one know how to (in lisp or vba for ac2002):
    1. Check if there is an image with the same file name as the drawing.
    2. If it exists an image but with an other file name, rename it to the drawings file name.

    /Gösta
     
    gosnil, Oct 7, 2004
    #1
  2. gosnil

    coachball8 Guest

    Are you doing this with the drawing open or closed? I don't think you can rename an image that is attached to an open drawing. You could use (if (setq data (dictsearch (namedobjdict) "acad_image_dict")), then use vl-file-copy.
    Jason and Louis helped me with one in this NG that worked on a drawing close reactor, but that was quite some time ago. As I recall, it worked very well. You might search the NG for raster or image filename and find the same code posted. HTH
     
    coachball8, Oct 7, 2004
    #2
  3. gosnil

    gosnil Guest

    Hmm, NG what’s that?

    Some background...
    We have a document management system (IFS) who change the filename when a new version is created.
    Example, docno: 1, version: A, have 2 files 1-a.dwg and an image file 1-a.cal.
    Then I make a new version (B) of the document, the filename changes to: 1-b.dwg and 1-b.cal, but inside the dwg the image attached is 1-a.cal (the old version)!
    I am searching for a function that changes the name of the image file when the dwg is opened!
    /Gösta
     
    gosnil, Oct 7, 2004
    #3
  4. gosnil

    Anne Brown Guest

    NG = newsgroup or discussion group, various areas for discussion
    on this server
     
    Anne Brown, Oct 7, 2004
    #4
  5. gosnil

    coachball8 Guest

    If you're just AutoCad, I don't think you can make that happen. However, RasterDesign has an option called autoreplace that would work.
     
    coachball8, Oct 8, 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.