Share

Custom Connector Classes

You can create your own connector classes for new asset types that need special connection behavior. These custom classes help control how parameters are shared among assets in the same class.

A Connector Class is defined by an XML file with the extension .connectorclass. This file includes elements that define how parameters are mapped and any conditions for these mappings.

You can create a new connector class file in one of the following ways:

  • Automatically, using the Connector Class dialog. You can use it to create a new connector class or edit an existing one. These classes are stored in the C:\username\Documents\FactoryLibrary\ConnectorClasses folder.

  • Manually, using a text editor or XML editor. You can look at files in C:\ProgramData\Autodesk\Factory Design(version)\FactoryLibrary\ConnectorClasses. These files can help you understand what a connector class file should have. You can use one of these files as a starting point for your own connector class.

Example of a Connector Class File

The structure of a connector class XML file is simple. Here is an example of a basic connector class file. The element descriptions follow.

<connector>

<ConveyorWidth value_source="parameter">Width</ConveyorWidth>

<ConveyorHeight family_type="normal" value_source="parameter">Height</ConveyorHeight> <ConveyorHeight family_type="inclined" connector_name="Connector1"

value_source="Parameter">UpperHeight</ConveyorHeight> <ConveyorHeight family_type="inclined" connector_name="Connector2"

value_source="Parameter">LowerHeight</ConveyorHeight> <ConveyorHeight family_type="spiral" connector_name="UpperConnector"

value_source="Parameter">UpperHeight</ConveyorHeight> <ConveyorHeight family_type="spiral" connector_name="LowerConnector"

value_source="Parameter">LowerHeight</ConveyorHeight>

</connector>

Connector Class File Elements

Connector class files always start with a root element named connector. This element contains child elements that identify the parameters to be shared between assets when they are connected and belong to the same connector class.

The child elements define mapping groups. They can have any name you want and follow these rules:

  • Each mapping group, which represents a certain parameter, should have a unique element name. For example, "ConveyorWidth" and "ConveyorHeight" are two mapping groups.
  • In an asset, once a match is found for a parameter that meets the matching rules, testing of the current mapping group ends, and the next mapping group is processed. So, mapping group elements should be listed from most specific to least specific.

The value of these elements usually identifies the parameter name to be mapped (e.g., "Width"). Both assets must have a parameter with this name, or no mapping happens.

Also, reserved attributes and more attributes can be specified to define matching conditions. The attribute names identify connector class properties. The values for these properties must be specified within the asset (using the Connector Class Properties dialog) to help with matching. If the asset does not have a matching connector class property, the mapping is ignored.

Was this information helpful?