Hi Ronny (and anyone interested),
attached is the latest update of the FREE BDSwapImage macro. The latest version has built upon the QuickSwap module (select 2 images and then swap them with one click) by adding a QuickSwapSize module which not only swaps 2 images, but also swaps their sizes.The macro also has the original module SwapImage module which pops up a userform and allows the user to choose how the 2 images are swapped (e.g. swap the position of their top left corners, bottom right corners, etc). Here is a screen capture of how the modules appear in the Macro Manager docker, assign shortcut buttons/keystrokes to make them one click away:
Refer to the video below to see the intented use of this macro:
Thanks Brian. Will have a look at it.I use your quick swap macro a lot. Much appreciated.
Hi Ronny,
you are welcome. You provided so much help in the Corel Newsgroups that I learnt a great deal from you. I owe you big time!
Best regards,Brian.
I like the new version but have one small suggestion for an improvement:How about also swapping the stacking order? I mean, if a 'rectangle' is stacked as number three and a 'circle' as number five and we swap places, the circle should then be number three and the 'rectangle' number five.This would mean that the objects truly swap places, stacking order and if desired also size.Is it possible?
H Ronny,
I have made the changes you requested, but only where shapes/images are on the same layer. If they are on the same layer then they will swap position, size and position in the stacking order.
John has sent me some code to try - to perform swapping of stacking orders and layer positions, but i have not had a chance to test this yet, as I have been working on other macros. I will test John's code ASAP and post a further revised macro here if it works ok.
I have amended the macro form in case you ever need that and removed the superfluous Reset button. I also added a swapStackingOrder sub so you can run ANY of the swap functions and then swap stacking position after that. Please note that this feature only works on 2 selected images you have just swapped with the macro, because as they swap values are placed in variables which the swapStackingOrder module needs to run.
Hm, not working as I expected. Sometimes I cannot get it to work at all, possibly because 'swap values are placed in variables which the swapStackingOrder module needs to run'. Thanks for trying though.My idea was that the stacking order should swap when the objects changed place. All in one operation.This should, IMO, be the default mode, since it is the most logical way to swap places.
the macro has been revamped now...thanks to assistance from John and Sancho. I didn't even ask for help and those guys are so great they just helped me! Sancho sent me some code which gives one of the modules dual functionality.
The macro now works as follows:
Really great!. You will probably only ever use the QuickSwap module. Just remember to hold Shift as you run it to swap shape sizes.
Thank you very much John and Sancho, you guys are totally awesome.
p.s. on the previous version it did work, by the way. The QuickSwapSize macro did all 3 swaps, but only worked if both shapes were on the same layer. The code now also works if shapes on are different layers. You may have misunderstood me and thought you had to run the extra sub to swap the stacking order (which would have already been done).
Here is the macro in action....please note the 2 smaller images are on layer 1, one below the yellow rectangle, one above it. The large image is on layer 3
Wow! This is really cool and exactly what I wanted.
May I suggest that you (if possible) add the stacking order option to the SwapImage window too. Not that I need it but it would make the dialog more complete.
Many thanks to all John and Sancho as well!
...your wish is my command....you must think I am the genie in the magic lantern...LOL. Just kidding Ronny. OK, attached is the fully rewritten macro in all aspects. The QuickSwap is what you just saw, the SwapImage lets you choose a reference point (alignment point) and then calls the QuickSwap code to do its thing. This means you get the Shift (to swap sizes) functionality with the buttons on the form too! There is a message on the form to let you know that holding Shift while clicking a button swaps shape sizes. Hopefully this one is a done deal now
I could not have pulled it off so well without the help from the guys. Sancho and John are the nicest guys and so generous in sharing their hard-earned knowledge. Thanks so much guys!