This section describes how macros are stored.
Macros are stored as PLM objects.
In editing mode, the PLM object is seen as modifiable. All dialog commands
that modify it are enabled. This mode doesn't imply that the modifications
done on the object will be saved successfully. An object can be modifiable
and not savable in database.
In read only mode, the PLM object is seen as non modifiable. All dialog
commands that can modify it are disabled.
The end user will have the possibility to manage the editability of macros.
End users are informed when they risk to loose their modifications on a
macro library because this library is modified or locked by someone else.
Macro Editability
The ability to edit macros is the same as for all other PLM entities:
you can either edit entities or access them in read only mode.
If you create a new library of macros, this new PLM entity is in editing
mode.
If you open an existing library, the mode depends on a PLM access setting
common to all PLM entities.
To set the default behavior, select Tools>Options... then
the PLM Access category, then the Open Options tab.
Checking the option Display a warning if read-only data are edited
will start your macro session in read only mode; otherwise, your macro session
will start in editing mode.
This setting also manages the lock strategy for macro libraries.
Two buttons available in the dialog Tools>Macro>Macros...>Macro
libraries ... will allow you to switch the mode of the selected library.
In editing mode, these two buttons are disabled because all libraries are
opened in editing mode and this mode cannot be switched.
This will allow other PLM users to be aware that the macro is being edited.
When a user interaction involves a modification of the current library
(for example Tools>Macro>Macros...>Delete of the current macro,
or after pushing the save button in the VBA editor) and if saving in the
database of the modified library has failed, a pop-up window informs the
user of this failure.
The in-session library has taken into account the modifications but the
database library hasn't been updated. This scenario can occur, for example,
if the library has been locked by another user or if the library has been
modified in the database since the last time it was opened.
User Interface
In Tools>Macro>Macros..., if the current library is in read
only mode, access to certain commands is modified as follows:
- all commands involving a modification of the library are disabled
(Create ..., Rename ..., Delete, Obfuscate...)
and the command for editing the current macro is named "Browse..."
- a small "do not enter" sign is displayed at the bottom left of the
library icon (the small icon just on the left of the library name):
- if the current library is in editing mode, all modification commands
are enabled, the editing command is named Edit... and no "do
not enter" sign is displayed:
You can switch from one mode to the other by clicking the Macro
libraries... button then by clicking either the Switch to Read
Only button or the Switch to Edition button.
You will only be able to switch between the two modes if you check the
option Display a warning if read-only data are edited.
For example, click the Switch to Edition button:
to switch to editing mode, and the Switch to Read Only button:
to switch to read only mode.