Jump to content

Renaming Referenced Filenames (on your hard drive) Directly from AutoCAD


Recommended Posts

Posted (edited)

I insert multiple pictures into AutoCAD (all the pictures in a project folder from a site visit)

 

Then I use AutoCAD to organize the pictures (this works for me, moving pictures around in groups, in order, etc.).

 

Then I decide which photos I am going to keep and which ones I am deleting.  The ones I am keeping I need to rename (with descriptive filenames) on my hard drive.

 

Ideally -- I would love to be able to rename the picture files (the original file on my hard drive, not the one attached to the AutoCAD drawing) directly from AutoCAD.

 

Any ideas where to head from here?

 

Background/details:

 

I use the lisp code (shown below for your reference) with "GetFilesV1-6.lsp" to insert multiple pictures into AutoCAD.

 

I asked the author (www.lee-mac.com) if his code can be modified.  Hopefully I will hear from him in the near future, I just wrote this morning.

 

Here's the code I am referring to:

(defun c:img ( / ang dis ins lst spc )
    (if
        (and
            (setq lst (LM:getfiles "Select Image Files to Insert" img:dir nil))
            (setq ins (getpoint "\nSpecify insertion point: "))
        )
        (progn
            (initget 4)
            (setq dis (cond ((getdist "\nSpecify image spacing <1/16>: ")) (0.0625))
                  spc (vlax-get-property (vla-get-activedocument (vlax-get-acad-object))
                          (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace)
                      )
                  ang (angle '(0.0 0.0 0.0) (trans (getvar 'ucsxdir) 0 1))
                  img:dir (vl-filename-directory (car lst))
            )
            (foreach img lst
                (setq ins
                    (cons
                        (+ (car ins) dis
                           (vla-get-imagewidth (vlax-invoke spc 'addraster img ins 6.5 ang))
                        )
                        (cdr ins)
                    )
                )
            )
        )
    )
    (princ)
)
(vl-load-com) (princ)

 

Edited by SLW210
Add Code Tags
Posted

Ideally -- You would inspect and rename the photos before attaching them to a drawing. You cannot rename a file that's open in a drawing, viewer or any other software. If you did it with the drawing closed none of the files referenced would exist anymore when the drawing was reopened.

Posted

So is the Autocad use just a convenient way to arrange the photos?

 

You could create a temporary text file with the before and after names, close the drawing file, and in another drawing run a second LISP to rename according to the files, then go back to the first and using the list you made rename the links? It is possible but wouldn't it be easier to do the renaming in say, File Explorer which is designed to manipulate files and folders

Posted

You can run DOS type command using "shell" look at help or 

image.png.796fd659118f71c5c321463d987c0d76.png

 

Ok if the photos were taken with your mobile phone with geo locate turned on you can auto place the photo's in real world location, its not bad around 3m accuracy, it is achieved by using a external program called from lisp that pulls the world co-ordinates from the JPG. It worked but never really used it. Trying to remember the 3rd party program  it was written where I used to wrok.

 

 

Posted

Thanks everyone.


Apparently I'm asking the wrong question, sorry.


Windows Photo View works okay for seeing all the pictures at once (well, a few at a time), zooming in/out, renaming, and deleting -- that's what I do now.

 

But AutoCAD is a more convenient way for me to see and organize all the pictures at once.

 

And I also draw lines and text on some of the pictures then save those to a PDF file.

 

And the rest of the selected pictures I email the original pictures to the client - with descriptive filenames.

 

The problem is -- the LSP files insert the pictures in AutoCAD but when you click on them you get the reference name, not the name of the file from which the picture was inserted.


So I cannot tell which picture is which --- unless I run "ExternalReferences" which lists the external references -- but then I have to cross-reference.


I also work with 50-100 pictures for each site visit.  The LSP codes work nice for inserting all the pictures at once -- I just can't tell which image goes with what original picture.


So, I was hoping someone knew how to change the LSP code shown or "GetFilesV1-6.lsp" (by Lee mac) so that the filename of the picture shows when you hover or click on it in AutoCAD.


"Ideally -- I would love to be able to rename the picture files..."   well that was a pipe dream, for sure, again sorry.


Again, thanks
Tony

Posted

Thanks everyone.


Apparently I'm asking the wrong question, sorry.


Windows File Explorer works okay for seeing all the pictures at once (well, a few at a time), renaming, and deleting -- that's what I do NOW.

 

But these are very high resolution drone pictures. "Extra large icons" and "Preview pane" doesn't work for me. 

 

So I have to open each picture in Windows Photo View for zooming in/out. 

 

--- AutoCAD is a much more convenient way for me to zoom, organize, and see all the pictures at once.  And the LSP codes insert all the pictures at once, nice.  50-100 pictures for each site visit.

 

And I also draw lines and text on some of the pictures then save those to a PDF file.

 

And the rest of the selected pictures I email the original pictures to the client - with descriptive filenames.

 

The problem is -- the LSP files insert the pictures in AutoCAD but when you click on them you get the reference name, not the name of the file from which the picture was inserted.


So I cannot tell which picture is which --- unless I run "ExternalReferences" which lists the external references -- but then I have to cross-reference.

 

The LSP codes work nice for inserting all the pictures at once -- I just can't tell which image goes with what original picture.


SO, I was hoping someone knew how to change the LSP code shown or "GetFilesV1-6.lsp" (by Lee mac) so that the filename of the picture shows when you hover or click on it in AutoCAD.


"Ideally -- I would love to be able to rename the picture files..."   well that was a pipe dream, for sure, again sorry.


Again, thanks
Tony

Posted

PLEASE DISREGARD THE DUPLICATE MESSAGE

See the second message, not the first duplicate,

Sorry, new to this forum

Posted
1 hour ago, TonyBaloni said:

Thanks everyone.


And I also draw lines and text on some of the pictures then save those to a PDF file.

 

And the rest of the selected pictures I email the original pictures to the client - with descriptive filenames.

 

The problem is -- the LSP files insert the pictures in AutoCAD but when you click on them you get the reference name, not the name of the file from which the picture was inserted.


So I cannot tell which picture is which --- unless I run "ExternalReferences" which lists the external references -- but then I have to cross-reference.


Again, thanks
Tony

So what would work now is a lisp that labels Xrefs with the name of the referenced file without the path?

Posted

So in the xref manager, is it the reference name you want to set to be the image file name?

This might help, RLX 2nd code part way down the page: 

I think you should also be able to make text and insert it with the iname for the file name

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...