How to put a macro into a button

Started by PW User, January 19, 2009, 10:14:02 AM

Previous topic - Next topic

PW User

A little howto from InnovMetric.

Admin

bmunger, can you confirm for us that when you do add a macro to a button, the macro is copied and saved to the current visual layout.  So if you update the macro from the original source, you must reattach the new macro version to the button again and save your visual layout.  That was the only thing was not crystal clear.

Also, prehistory shared this tip with me that I wanted to pass along: Customizing an icon



When you have the customize window open (steps were shown in the how-to doc attached on bmunger's post), you can simply right click on the icon after you dragged it onto a toolbar and the menus give you a lot more options.  You can even draw your own icon by selecting Edit Button Image...

PW User

Hello,

Indeed, when you import a macro, a copy is made inside the visual layout, so the file you imported from is no longer the one used when you press on the button and further update on either copy make the other one obsolete. So if you update the external file, the one in the visual layout becomes outdated and vice-versa.

The recommended approach is to import it if it comes from an internal soucre and then mark the external file as rev0. Then update only the one in the visual layout by right-clicking on the button to which you assigned the macro and choosing "Edit script". whent he updates is complete, you can save the macro to an external file from the Script Editor and mark it as rev1 (for archiving or distribution purposes, for example). But the up to date macro should always be the one in the Visual Layout.

Updating macros externally from Polyworks is both tedious and confusing. the Script Editor is a very good programmign interface. It's not perfect, but it's certainly well above average. Use it, it's preferable to any other external editor.

Bernard