Load(Element: IXMLDOMElement);
Element. XML element, to which styles table is saved.
The Load method loads styles table from XML code.
To save styles table into XML code, use the IStyleSheet.Save method.
Executing the example requires that the repository contains an empty styles table with the STYLE_TB_NEW identifier. The file system should contain the C:\StyleSheet.xml file containing a styles table as XML code.
Add links to the Drawing, Metabase system assemblies.
Sub UserProc;
Var
mb: IMetabase;
styleSheet: IStyleSheet;
Doc: FreeThreadedDOMDocument60;
Element: IXmlDomElement;
Begin
// Get current repository
mb := MetabaseClass.Active;
// Get styles table
styleSheet := mb.ItemById("STYLE_TB_NEW").Edit As IStyleSheet;
// Load styles table into XML file
Doc := New FreeThreadedDOMDocument60.Create;
Doc.load("C:\StyleSheet.xml");
Element := Doc.documentElement;
styleSheet.Load(Element);
(styleSheet As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the STYLE_TB_NEW styles table is loaded from the C:\StyleSheet.xml file.
See also: