Creating a new component
Create a new component when you want to create a design that represents a feature or a component in a live system and want this design to be available for reuse. For example, the component can be a button or a representation of a fan.
For more information, see the Components Overview section.
To create a new component:
- In Graphics Editor, click File > New > Component.
- In the work area, design the appearance of the component.
- Click File > Save As > Component.
- In the Components tree, select the category where you want to save the component.
- Click OK.
- In the Properties pane, in the Name box, enter the name of the component.
- In the Description box, enter a description for the component.
- In the Height and Width boxes, enter the size the component gets when used in a drawing.
- Click OK.
The description is displayed as a tooltip for the component in the Components pane.
NOTE: When you create a new component, a work area opens and a ComponentContent root element appears in the Objects pane.
The name you give the component is also the file name the component gets when it is saved, with the suffix .tgmlcomponent
. The new component is now displayed in the selected category in the Components pane, and is ready to use in other graphics.
For more information on the definition structure, see Component graphics definition structure.
Tips for component and/or TGML creation
- Avoid combining reference and non-reference instances in the TGML or TGML component document. This can cause complexities in the component hierarchy.
- Use reference components while creating custom components as you can use the Reference Definition Updater to update the component and all of its instances in TGML and components at the same time. This Reference Definition Updater will not update non-reference components.
- Avoid creating cyclic component dependencies, which can make system behavior difficult to predict and maintain.
-
When working with components, avoid making changes at the component definition level directly in the Object Browser. If customization is required, it is best to duplicate the component and make changes to the duplicate.