Creating style sheets
You can create custom rule-based symbol styles by creating a style sheet. However, there are two ways you can do that:
- Reuse an existing style sheet
This option allows you to create your own custom rules as well as reuse and customize all the rules already available in the reused style sheet. The reused style sheet can be either a predefined one (e.g., DefaultStyleSheet) or a custom-created one. For example, you can reuse the DefaultStyleSheet style sheet, then customize its rules by changing their names, attributes, and their values, etc. Additionally, if you create rules only for selected symbols, overwriting the DefaultStyleSheet's rules, all the other symbols you do not overwrite will continue to be represented according to the DefaultStyleSheet. - Create a custom style sheet from scratch
This option allows you to create your own custom rules only without reusing any predefined or custom style sheets and their rules. Choose this option if you prefer creating your own rules without the need to reuse or customize the existing ones.
Creating a style sheet
Reusing an existing style sheet
To reuse an existing style sheet
- In the Containment tree, create a new root namespace.
- Open the Textual Editor for the new namespace.
- In the Textual Editor, create a package and name it.
- Within the body of the package, import the DS_Styles, CoreStylesComponents, Predicates, ColorDefinitions, CompartmentVisibilityDefinitions, KerMLStyles, and SysMLStyles packages.
To learn more about each package, see the 3DS SysML Customization library structure section on the Custom style sheets page.
- Declare a part definition, specify the name for the new style sheet, subclassify the part definition of the existing style sheet you want to reuse (e.g., DefaultStyleSheet).
You can now specify custom components or customize those in existing style sheets within the body of the new part definition.
package NewStylesPackage {
private import DS_Styles::**;
private import CoreStylesComponents::*;
private import Predicates::*;
private import ColorDefinitions::*;
private import CompartmentVisibilityDefinitions::*;
private import KerMLStyles::*;
private import SysMLStyles::*;
part def NewStyleSheet :> DefaultStyleSheet {
// specify custom rules or customize those in the DefaultStyleSheet style sheet here
}
}
Creating a custom style sheet from scratch
To create a custom style sheet from scratch
- In the Containment tree, create a new root namespace.
- Open the Textual Editor for the new namespace.
- In the Textual Editor, create a package and name it.
- Within the body of the package, import the DS_Styles, CoreStylesComponents, Predicates, ColorDefinitions, CompartmentVisibilityDefinitions, KerMLStyles, and SysMLStyles packages.
To learn more about each package, see the 3DS SysML Customization library structure section on the Custom style sheets page.
- Declare a part definition with the part def keyword, specify the name for the new style sheet, subclassify the StyleSheet part definition.
You can now specify custom components within the body of the new part definition.
package NewStylesPackage {
private import DS_Styles::**;
private import CoreStylesComponents::*;
private import Predicates::*;
private import ColorDefinitions::*;
private import CompartmentVisibilityDefinitions::*;
private import KerMLStyles::*;
private import SysMLStyles::*;
part def NewStyleSheet :> StyleSheet {
// specify custom rules here
}
}