Using Library Components
A library component is a user-defined object that can be used multiple times in a project. The process of using a library component is called instancing a library component definition. A library component definition is created from a geometry and material slots.
In this section, an example is used to build an SMA library component. The following figure illustrates an SMA library component, where the geometry consists of four geometry elements:
In the SMA library component, three geometry elements share the same material slot called MetallicSlot while the filling of the coax of the SMA has a different material slot called DielectricsSlot. Material slots are used to define a component without fixing the material of it. While instancing a library component, you can decide the material to assign into the slot.
In this example, the predefined surface mounted SMA of the toolkit is used. To insert this into the project, execute the following code in the Script Editor:
SMA is included in the geometry window, as shown in the following figure:
Creating a Library Component
To create a library component from SMA, select Surface Mounted SMA Connector > Create Definition. The definition is added to the list of Library Component Definitions, as shown in the following figure:
An alternative way to create a library component is to drag the assembly on the Library Component Definitions tree item.
During the creation of the definition, two slots are identified as CuSlot and PTFESlot. These slots are derived from the fact that the original SMA has two materials assigned to it.
Instancing a Library Component
To use the library component definition, select the SMA component definition that was created earlier and drag it to the Parts item in the project tree. In the project tree, a new item is created called Instance, which consists of a link to the instance definition. The lines below that represent the assignments in the material slots, as shown in the following figure:
Assigning a new material into a slot is done by dragging a material to the slot. When an instance is first created, a default fill-in of the slots is made. This instance searches for materials that have the same name of the slot without the Slot suffix and use them. If they are not available, the assignments will be left empty. Unassigned slots will invalidate the instance.
To move an instance around, use the Specify Orientation context menu on an instance. You can use multiple number of instances of a definition in a project.
Library Components also serve as the basis for 3D Components. A 3D Component is a library component where the original materials defining the material slot are used. For more information about 3D components, refer to Creating Parametrized 3D Components.