Simple scripts can also be used to read and change a setting from the Settings dialog.
Note:
This does not apply for project settings!
Before you can read out a setting, you first have to find the name of the setting. To do this, switch on a hidden menu with the following C# script:
public class SetSettingScript
{
[Start]
public void SetSetting()
{
Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
oSettings.SetBoolSetting("USER.EnfMVC.ContextMenuSetting.ShowExtended", true, 0);
return;
}
}
After you have executed the script, you first have to restart Eplan. The Copy path for setting to Clipboard popup menu item is then available in the Settings dialog. Run the popup menu item for a setting and copy the name to the Clipboard. This is the name for the Display identifying numbers setting, for example: USER.SYSTEM.GUI.SHOW_PROPERTY_NR. You can then use this name in a script in order to change or read out the corresponding setting.
The following example shows a script in C# that you can use to activate the Display identifying numbers setting:
public class SetSettingScript
{
[Start]
public void SetSetting()
{
Eplan.EplApi.Base.Settings oSettings = new Eplan.EplApi.Base.Settings();
oSettings.SetBoolSetting("USER.SYSTEM.GUI.SHOW_PROPERTY_NR", true, 0);
return;
}
}
In this example, the class SetBoolSetting helps you to switch the USER.SYSTEM.GUI.SHOW_PROPERTY_NR (= Display identifying numbers) setting to "true", i.e., it is enabled. "False" would deactivate the corresponding check box again.
The same example in Visual Basic.Net looks like this:
Public Class SetSettingScript
<Start> _
Public Sub SetSetting()
Dim oSettings As New Eplan.EplApi.Base.Settings()
oSettings.SetBoolSetting("USER.SYSTEM.GUI.SHOW_PROPERTY_NR", True, 0)
Return
End Sub 'SetSetting
End Class 'SetSettingScript
To read out this setting or change / read out settings with other properties, you have to use an analog script from similar classes (e.g. GetBoolSetting, SetStringSetting, etc.).
See also
