• Not Answered

Copying animations in Bitmaps

I have a bitmap that has a visibility animation configured for it. I'd like to change the bitmap out with a different bitmap. Is there anyway to swap out the bitmap? Or maybe to copy the animation from object to object without having to copy/paste through each of the animation dialogues?

I'm looking to create a standard dynamo that I can then use for many different pieces of equipment where I only have to swap out the bitmaps.

5 Replies

  • You can load different images (Load Image via right click menu on bitmap object) into a single bitmap and then have an animation for CurrentImage to select which image to been seen. This works well as long as the images are the same size and you only have 2 images. If they are different sizes or you need more then you would need to use VB logic to set the size and which image to be seen.

    Here is sample VB logic to load an image:

    bmpBypass25.Height = 0.677083333333329
    bmpBypass25.Width = 0.677083333333336
    bmpBypass25.LoadImage True, #, System.PicturePath & "\DynamoBitmaps\bmpBypass.bmp"

    Where bmpBypass25 is the bitmap object name on a graphic, DynamoBitmaps directory exists under the directory being used for graphics (typically this is DVData\Graphics-iFix\Pic). The "#" shown in the LoadImage logic is the image number (if 4 images you would have 1, 2, 3, 4 to load the different images but I'm not sure what you are trying to do, you may only need 1 and then have the logic load the different images needed for what is selected). The Height and Width of the object is set to show in case you have bitmaps of different sizes, if you don't do this the bitmap will get distorted.

    You can change to where ever you need to have the bitmaps but they need to be on all the machines if you want to be able to configure from those other machines.
  • In reply to Matt Stoner:

    whoa! this isn't what i was asking, but you've intrigued me enough to think about it the way you describe. Let me ask a few follow on questions:

    Let's take the case where I have 1 pump and I have 4 different bitmaps of the pump in 4 different colors:
    1.) Do I need to use the bitmap wizard to load each image before using your sample script? -OR- can the "loadimage" vb function point to a specific <filename.bmp> such that I can just swap the VB object bmpBypass25 to different bitmaps that only exist in a directory? This latter way of doing it would be incredibly useful in keeping the .grf file size low.

    2.) Would this sample VB logic live in the dynamo? What type of "Sub" do i run it under? How would I link this to a datasource expression to drive this display.

    I tried answering my own questions looking at the alarm icon on the emerson HP dynamo, but couldn't figure it out :(
  • In reply to Alex Lutz:

    You would need to write a temporary edit script script to load the Bitmap image, but then you wouldn't need the loading image script anymore. Just animate the CurrentImage to get 1,2,3,etc number to show the appropriate image. For example draw a rectangle, select rectangle, right click rectangle, select Edit Script and then you change change this to be RectName_Edit instead of RectName_Click with the similar logic above to load your bitmaps (you will have # number of LoadImage lines with the appropriate # as described, just make sure you load them in an order than will make your animation to select the proper image easy. Then you can double click this Rect and it will run the logic and load your bitmap in Edit environment and you wouldn't need the Rect/Script anymore (You will have to save/close the graphic after writing the code and then reopen for it to work).

    What I talking about is to dynamically changing as part of a dynamo as I assumed you were picking different type of pump images and not the same pump with different colors.

    Why didn't you draw pump with localized circles or polygons and just animate those objects?
  • In reply to Matt Stoner:

    ahh, i understand now. The example VB script is just a temporary script. I think this temporary script would do the same thing as the "Bitmap Wizard" button on the DeltaV_Advanced toolbar. Except with that, you don't get to choose which image is associated with which number, it just populates the image to the next image number everytime you run it.

    the only disadvantage with this is that you can't "unload" bitmaps or swap out new bitmaps for old. This is related to the original problem. I currently have 1 bitmap with a visibility animation on one dynamo and i want to create a new dynamo from it where the only difference is the bitmap image. I wanted to see if there was any way to swap out the bitmap IMAGE, without changing the bitmap OBJECT (so that the visibility animation was preserved). I found a workaround for this: right click the bitmap and load image > PRIMARY image. You HAVE to select PRIMARY. If you select secondary, it makes it into a click button.

    You've really got me dreaming now with your answers: Do you think it is possible to use that "LoadImage" function and attach it to a datalink expression? If I need 4 images, but only one of them is visible at a time, it would be great (and much less resource-intensive) to just call the one image that you need from the DynamoBitmapDirectory folder. What do you think?
  • In reply to Alex Lutz:

    No I wouldn't change images at runtime based on a datalink, I would configure with a dynamo to load the appropriate images with datalink animations to select which image to show at runtime if you are going this route.

    My script will work to unload the image as it is resetting the bitmap object. I'm not sure the loading of images thru the bitmap wizard or the right click context menu and selecting Secondary will load more than 2 images just haven't done it that way as we were needing to do this based on dynamo configuration at runtime (i.e. dynamo size). I just didn't know exactly what you were doing originally when I suggested the script.