In EPLAN there is a settings database created to store user preferences such as used fonts, colors , etc.
In GUI it is visible under ribbon item “File” -> "Settings..."
Using API, we can modify the database and also create custom values for usage in API applications.
We can distinguish following settings categories :
For more details, please refer to "Settings: Operation" chapter of EPLAN Help.
The settings database is organized in a tree tree structure : particular branches refer to similar setting and leafs stores relevant values.
Using export functionality we can access their values, also these which are not visible in Options->Settings dialog. The format of the file is XML and here is its XML Schema Definition :
Copy Code
|
|
---|---|
<?xml version="1.0" encoding="utf-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:group name="levlSettingGroup"> <xs:sequence> <xs:element name="Setting"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="Val" type="xs:anyType" /> </xs:sequence> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-ZäöüÄÖÜ0-9_\s\+\-#\[\]]*"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="bool"/> <xs:enumeration value="int"/> <xs:enumeration value="unsigned int"/> <xs:enumeration value="long"/> <xs:enumeration value="unsigned long"/> <xs:enumeration value="double"/> <xs:enumeration value="string"/> <xs:enumeration value="mlstring"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="info" type="xs:string" use="optional" /> <xs:attribute name="desc" type="xs:string" use="optional" /> <xs:attribute name="range" type="xs:string" use="optional" /> </xs:complexType> </xs:element> </xs:sequence> </xs:group> <xs:attributeGroup name="levlAttrGroup"> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="[a-zA-ZäöüÄÖÜß0-9_\s\+\-#\[\](),\/@:;\*&]*"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="info" type="xs:string" use="optional" /> <xs:attribute name="nodekind" type="xs:string" use="optional" /> </xs:attributeGroup> <xs:element name="Settings"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="5" name="CAT"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" name="MOD"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV1"> <xs:complexType mixed="true"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV2"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV3"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV4"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV5"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV6"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV7"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV8"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV9"> <xs:complexType> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="LEV10"> <xs:complexType> <xs:group ref="levlSettingGroup"/> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> <xs:group ref="levlSettingGroup"/> </xs:choice> </xs:sequence> <xs:attributeGroup ref="levlAttrGroup"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="COMPANY"/> <xs:enumeration value="INSTALL"/> <xs:enumeration value="PROJECT"/> <xs:enumeration value="STATION"/> <xs:enumeration value="USER"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="format" type="xs:unsignedByte" use="required" /> </xs:complexType> </xs:element> </xs:schema> |
Here is a simplified description of the setting file :
Here is an example of simple user setting from User->Display->Identifier branch
Copy Code
|
|
---|---|
<?xml version="1.0" encoding="utf-8" ?> <Settings ver="2.4.1" format="2"> <CAT name="USER"> <MOD name="PLEditorGui"> <Setting name="SortMode" type="int"> <Val>1</Val> </Setting> </MOD> </CAT> </Settings> |
Bellow is another example of workstation settings (Workstation->Graphical editing->Print)
Copy Code
|
|
---|---|
<?xml version="1.0" encoding="utf-8" ?> <Settings ver="2.4.1" format="2"> <CAT name="STATION"> <MOD name="Print"> <Setting name="BlackWhite" type="bool"> <Val>1</Val> </Setting> <Setting name="BottomMargin" type="double" range="0/1000"> <Val>0</Val> </Setting> <Setting name="ConsiderPageScale" type="bool"> <Val>1</Val> </Setting> <Setting name="FitToPage" type="bool"> <Val>1</Val> </Setting> <Setting name="KeepAspectRatio" type="bool"> <Val>1</Val> </Setting> <Setting name="LeftMargin" type="double" range="0/1000"> <Val>0</Val> </Setting> <Setting name="Position" type="unsigned long" range="0/8"> <Val>0</Val> </Setting> <Setting name="RightMargin" type="double" range="0/1000"> <Val>0</Val> </Setting> <Setting name="ScaleHorizontal" type="double" range="0.001/1000"> <Val>1.0</Val> </Setting> <Setting name="ScaleVertical" type="double" range="0.001/1000"> <Val>1.0</Val> </Setting> <Setting name="TopMargin" type="double" range="0/1000"> <Val>0</Val> </Setting> </MOD> </CAT> </Settings> |
Here is example of indexed settings from Company->Graphical editing->Fonts.
Copy Code
|
|
---|---|
<?xml version="1.0" encoding="utf-8" ?> <Settings ver="2.4.3" format="2"> <CAT name="COMPANY"> <MOD name="GedViewer"> <Setting name="Fonts" type="mlstring"> <Val>??_??@Arial;</Val> <Val>??_??@Verdana;</Val> <Val>??_??@Georgia;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> <Val>??_??@Tahoma;zh_CN@??;</Val> </Setting> </MOD> </CAT> </Settings> |
Settings - functions for reading, writing and creating User, Company or Workstation settings
ProjectSettings - functions for reading, writing and creating project dependant settings. Refer to the "See Also" section.
SettingNode - functions for managing the settings hierarchy (only User, Company or Workstation)
SchemeSetting - functions for managing a settings group (scheme). Only for User, Company or Workstation setting.
ProjectSchemeSetting - the same as SchemeSetting but for project settings
ProjectSettingNode - the same as SettingNode but for project settings
Adding, setting and getting settings:
Example of merging nodes by SettingNode:
You can also combine settings to a group under a certain name - it is called "schema" . It is possible to have multiple groups under different names but with the same settings structure. One of the groups is an active scheme.
As mentioned above, each setting has its default value. In order to set a setting back to default, you have to get the setting's default value and set it on the setting:
In order to make it easier for the API user to find a certain settings key, the settings dialog provides a hidden feature. If you set the Boolean setting "USER.EnfMVC.ContextMenuSetting.ShowExtended" to true, you will get an additional context menu point in the settings dialog, which shows you the path of the selected setting.
Due to changes in EPLAN, it may happen that settings will change their type or name or that some settings will be completely removed. We cannot guarantee the long-term compatibility of settings. When updating to a newer version, please check your source code, whether the settings you use are still working.
Indexed settings always have continuous indexes. If a value is removed, the following values move up to fill the gap. This means, if you want to get all values of an indexed property, you just need to loop from index 0 to the number returned by GetCountOfValues(...) minus one. If you try to get the value from an index where no value exists, a BaseException is thrown.