The latest CC3+ update is 28 (version 3.98, released June 1st 2022). Download it from your Registration page.

Can I Change A File Path After Insertion?

I have inserted some images to my map, and they were gone when I did a desktop cleanup. Realizing what I did, I put them back on the desktop and the images re-appeared in my map. Is there a way I can change the path to the image without doing a complete removal and replacement of the image?

Best Answer

  • jslaytonjslayton Mapmaker Moderator, ProFantasy
    Accepted Answer

    Type the EDIT command directly on the command line. It will let you pick an entity and get a dialog to change its values. For inserted images, one of those values is the file name.

    REPLACEIMAGENAMESDWG is the same as find-and-replace in your favorite editor, but without any wildcard things.

    The @ part of a file name is the default data path set during CC3 installation. The default location is "C:\ProgramData\Profantasy\CC3Plus", but some folks will use a different path when installing the product. A file name showing in the list from LISTIMAGENAMESDWG as "@Bitmaps\Transparencies\solid 10.png" will be expanded internally to "C:\ProgramData\Profantasy\CC3Plus\Bitmaps\Transparencies\solid 10.png" when it's time to load the file.

    If you have some external files, the simplest way is to put them into the same directory as the .FCW drawing itself, and then use the $ path shortcut. You should only do this with files that you yourself have provided for your drawing. A good way to organize such things with custom images is to make a directory for the drawing and put the drawing .FCW file and any custom images (*.jpg, *.bmp, or *.png) into that directory with the drawing. If you insert your files from that directory, CC3 can use the $ shortcut path to keep everything relative to your drawing and move along with the drawing as you move the directory.

    Let's say that you have inserted a lot of images named things like "C:\Images\name.png" into your drawing (located at "C:\Drawings\map.fcw") and want to keep the images from being detached from your drawing. One way is to put all of those images into the same directory as your drawing and use "REPLACEIMAGENAMESDWG C:\Images\ $" (no quotes) to replace all instances of "C:\Images\" with "$". What you don't want to do is to replace the first part ("C:\Images\" in this case) with something that's longer than the the things you're replacing. You also want to make sure that it's unique in the file name, because a double substitution would be Bad.

    DaishoChikarachoppinltLoopysueWeathermanSweden

Answers

  • jslaytonjslayton Mapmaker Moderator, ProFantasy
    edited June 2021

    If your image is visible, try using EDIT on the image and changing the file name from there.

    If you use LISTIMAGENAMESDWG, it will give you a list of all images in your drawing.

    { make drawing backup here before reading farther} REPLACEIMAGENAMESDWG will replace all instances of the specified file name with a new one (for example, you could replace "C:\images\test.jpg" with "@test.jpg"). A critical point of bug-observation is that if the file name created in REPLACEIMAGENAMESDWG is longer than the name that used to be there, it can corrupt your drawing and/or crash CC3+. Undo also doesn't work properly with this command. It's more of an emergency tool for dealing with old drawings than anything else.

    I recommend making a backup of your drawing before making large changes like REPLACEIMAGENAMESDWG.

    LoopysueDaishoChikara
  • choppinltchoppinlt Traveler

    Thanks, so this leads me to some follow-on questions. The only EDIT I am aware of is the EDIT tab, which then shows a follow-on list of commands. None of them seemed to fit based on my understanding. So is there another way to execute the EDIT you suggested?

    I typed LISTIMAGENAMESDWG and got the list. The REPLACE... command seems promising, but what does using the "@" do to where I need to place the drawing file?

    Thanks!

  • jslaytonjslayton Mapmaker Moderator, ProFantasy
    Accepted Answer

    Type the EDIT command directly on the command line. It will let you pick an entity and get a dialog to change its values. For inserted images, one of those values is the file name.

    REPLACEIMAGENAMESDWG is the same as find-and-replace in your favorite editor, but without any wildcard things.

    The @ part of a file name is the default data path set during CC3 installation. The default location is "C:\ProgramData\Profantasy\CC3Plus", but some folks will use a different path when installing the product. A file name showing in the list from LISTIMAGENAMESDWG as "@Bitmaps\Transparencies\solid 10.png" will be expanded internally to "C:\ProgramData\Profantasy\CC3Plus\Bitmaps\Transparencies\solid 10.png" when it's time to load the file.

    If you have some external files, the simplest way is to put them into the same directory as the .FCW drawing itself, and then use the $ path shortcut. You should only do this with files that you yourself have provided for your drawing. A good way to organize such things with custom images is to make a directory for the drawing and put the drawing .FCW file and any custom images (*.jpg, *.bmp, or *.png) into that directory with the drawing. If you insert your files from that directory, CC3 can use the $ shortcut path to keep everything relative to your drawing and move along with the drawing as you move the directory.

    Let's say that you have inserted a lot of images named things like "C:\Images\name.png" into your drawing (located at "C:\Drawings\map.fcw") and want to keep the images from being detached from your drawing. One way is to put all of those images into the same directory as your drawing and use "REPLACEIMAGENAMESDWG C:\Images\ $" (no quotes) to replace all instances of "C:\Images\" with "$". What you don't want to do is to replace the first part ("C:\Images\" in this case) with something that's longer than the the things you're replacing. You also want to make sure that it's unique in the file name, because a double substitution would be Bad.

    DaishoChikarachoppinltLoopysueWeathermanSweden
  • choppinltchoppinlt Traveler

    Great thank you, I will check this out!

  • choppinltchoppinlt Traveler

    AWESOME, thank you! All I needed to do was use the EDIT command.

Sign In or Register to comment.