Cables CableConnector/pl

Cables CableConnector

Menu location
Cables → Cable Connector
Workbenches
Cables
Default shortcut
C N
Introduced in version
0.1.0
See also
Cables Cable, Cables CableBox, Cables CableTerminal, Cables SuppLines

Description

New concept of Cable Connector Preset with CableTerminal and SuppLines as child objects: introduced in version 0.3.0

The Cable Connector represents a model of an electrical connector. Its shape can be selected from DANEPreset list upon creation. There are two shape types available: first one fully parametric called 'ParametricTerminal' and second one called 'Fixed'.

The 'ParametricTerminal' type creates a parametric connector object. The connector is a model of electrically conductive metal block (for simplicity without external insulation). From an electrical point of view, all wires connected to a connector form one electrical node. The connector has default size upon creation, but some parameters, like Height, Hole Size, Hole Diameter or Number of Holes can be changed during creation after selection 'Customized' preset or later by changing properties. In this mode the single CableTerminal is created, split to segments passing through each connector hole.

The 'Fixed' type creates non parametric connector object with a shape taken from external STEP file. There are a few predefined STEP connector models shipped together with Cables Workbench. In addition, the user can create their own connector library, this is described in Cable Connector Presets. In this mode the certain number of CableTerminals are created with predefined size and position corresponding to connector pins. Additionally one or more SuppLines objects can be created forming the basis for the cable entering the connector.

The Cable Connector belongs to the Arch Component class and inherits all of its properties.

Cable Connector object can be colored by attaching desired Material to the Material property. MultiMaterial is also supported. It can be used to change the original connector colors to those defined in the multimaterial composition. Important: the number of colors in the multimaterial must match the number of original colors of the connector.

Example of the Cable Connector of 'ParametricTerminal' type (TerminalStrip x3):
There is a multisegment CableTerminal visible inside connector body (transparent for better explanation)

Example of the Cable Connector of 'Fixed' type (back side of D-Sub DE-9):
There are nine red CableTerminals visible above connector body. There is also orange cross of SuppLines for cable base attachment

Usage

  1. Select the vertex, point on surface or object in the 3D View or select nothing.
  2. Create Cable Connector by one of these methods:
    • Press the Cable Connector button.
    • Select the Cables → Cable Connector option from the menu.
    • Right-click in the Tree View or the 3D View and select the Cables → Cable Connector option from the context menu.
    • Use the keyboard shortcut: C then N.
  3. The Cable Connector task panel opens. See Options for more information.

Once created the Cable Connector is placed at the position of selected vertex, point or object in the 3D space (or at the point (0,0,0) if nothing was selected).

Options

The Cable Connector preset available in the task panel can be changed. The currently selected preset is immediately visible in the 3D View.

When the special 'Customized' preset is selected, the task panel shows additional options allowing to change all the properties of a custom parametric Cable Connector.

Cable Connector Presets

Cables Workbench comes with several predefined shapes. However, the user is not limited to using the default set (the Cables Create Custom Connector tutorial explains the creation of a custom connector in detail).

An additional CSV file can be created by the user, containing custom Cable Connector Preset definitions. It must be named connectorpresets.csv, and placed in:

$FREECAD_USER_DIR/Cables/

The $FREECAD_USER_DIR can be obtained from the Python Console:

FreeCAD.getUserAppDataDir()

The contents of the custom connectorpresets.csv file must be modeled upon the same rules as the connectorpresets.csv in the Cables Workbench source code. The file is self descriptive and can be used as a template for own Presets creation.

The custom connectorpresets.csv file can be modified without restarting FreeCAD. Any changes made there are immediately visible in the list of Presets when making a new Cable Connector from the GUI.

The connectorpresets.csv can contain two preset types: ParametricTerminal PresetType and Fixed PresetType.

ParametricTerminal PresetType

This preset type needs only single line in the connectorpresets.csv file to fully describe all the parameters of the given connector. No additional files are needed. There are some details about this type in the Description.

Fixed PresetType

The definition of this type is more complex than the previous one. The preset line in the connectorpresets.csv file among other parameters defines names of two additional preset files:

  • STEP file with the shape and colors of the connector. The name of this file has to be put directly (file example: Dummy_Dummy.step)[1].
  • CSV file with placements of the connector body, parameters for all attached CableTerminals and SuppLines. The name of this file is made from concatenation of ConnectorClass and Name fields (file example: Connector_Dummy.csv).

This two additional files (STEP and CSV) have to be placed in:

$FREECAD_USER_DIR/Cables/lib

In fact the software will look for these files in one more place (which should be treated as read only):

$FREECAD_USER_DIR/Mod/Cables/freecad/cables/resources/presets/lib/

So it is possible to define similar connectors with the same STEP definition but different number of Terminals or their placement if needed.

More details about Fixed PresetType in connectorpresets.csv file

The single preset line of connectorpresets.csv contains the following information for the software analyzing this file:

  • Name and Connector Class fields are used by the software to look for a valid CSV description file name. It is constructed as Connector Class_Name.csv (for example Connector_Dummy.csv if Connector Class=Connector and Name=Dummy). This file should exist in a $FREECAD_USER_DIR/Cables/lib/ or $FREECAD_USER_DIR/Mod/Cables/freecad/cables/resources/presets/lib/. If not, an error message will be generated.
  • The PresetType (second field) has to have value = Fixed. It informs that the shape will be created from an external STEP file.
  • The StepFileName field contains file name (with extension) of a STEP file used to create a shape. This file should exist in a $FREECAD_USER_DIR/Cables/lib/ or $FREECAD_USER_DIR/Mod/Cables/freecad/cables/resources/presets/lib/. If not, an error message will be generated.
  • NrOfTerminals, NrOfSuppLines define the number of CableTerminal and SuppLines objects to create. Details for these objects have to be defined in CSV description file mentioned above. If the numbers defined here do not match the number of definitions in the CSV description file, an error message will be generated.

The above approach to creating presets allows to use the same STEP file for different versions of presets with different CSV description files. It can be useful e.g. for creating connector variants with different pin descriptions, different number of used terminals, supplines etc.

Example of fixed PresetType

As a template and example the Connector_Dummy preset can be taken:

The preset definition line is in the file connectorpresets.csv:

Dummy,Fixed,Connector,Dummy_Dummy.step,3,1

Where the fields represent the following:

Name,Fixed,ConnectorClass,StepFileName,NrOfTerminals,NrOfSuppLines

From the above definition it follows that the file Dummy_Dummy.step and Connector_Dummy.csv (filename built from ConnectorClass_Name.csv) have to be present in one of the folders mentioned above.

After checking, the Dummy_Dummy.step and Connector_Dummy.csv files can be found in $FREECAD_USER_DIR/Mod/Cables/freecad/cables/resources/presets/lib/.

As a result of definitions from these three files the new Cable Connector with three CableTerminals and single SuppLines can be created.

STEP file

Since Cables Workbench version 0.3.2 any of properly made STEP file should load into connector without errors. This includes multishape STEP files and STEP files without color defined.

Probably still some STEP files will not load properly into the connector. To prevent this, import downloaded step file into FreeCAD directly (via File/Import menu) and export it back to STEP file. This will rebuild entire structure of the downloaded file. Reducing the number of shapes in a single STEP file can also help. FreeCAD supports STEP AP242, but in case of problems an older version (e.g AP203) can be tried.

If everything fails, such a problematic STEP files can be reported to the workbench author: SargoDevel for further analysis.

STEP source

Each STEP file from predefined preset has also its source file attached (example: Dummy_Dummy.FCStd). Inside each source file there is information on how to correctly generate a STEP file with colors from the source shape. These source files can be used as a base for creating shapes for new connectors.

Notes

  • The CableTerminal and SuppLines objects have reversed relation with their Cable Connector parent to avoid cyclic dependencies. They are shown as a children in the Tree View only for visual organization of objects. Undesirable consequence: when the Cable Connector is copied, all its child CableTerminal and SuppLines objects must always be manually copied with it.
  • SuppLines or CableTerminal child objects are created automatically depending on Preset, their shape and placement are controlled by Cable Connector.

Properties

A Cable Connector object shares the common properties and behaviors of all Arch Components.

Data

Component

Some most frequently used properties from the group are described here. The rest is available at Arch Component

  • DANEBase (Link): An external shape of any Shape-based base object can be used here. This will replace the default method of shape creaction and an external shape will be used. Number Of Terminals and Number Of Supp Lines parameters become visible and can be changed if Base property is not None.

Cable Connector

  • DANEClaim Children (Bool): If set to true it will claim the linked Terminals and SuppLines as children in the Tree View (introduced in version 0.3.3).
  • DANEHeight (Length): Specifies the height of the connector. The default height is 5 mm.
  • DANEHole Size (Length): Specifies the size of holes in mm2. The default hole size is 2 mm2.
  • DANENumber of Holes (Integer): Specifies the number of holes. The default value is 3.
  • DANENumber Of Supp Lines (Integer): (hidden by default) Specifies the number of a SuppLines child objects. The default value is 0.
  • DANENumber Of Terminals (Integer): (hidden by default) Specifies the number of a CableTerminal child objects. The default value is 1.
  • DANEPreset (Enumeration): Specifies the predefined set of parameters for Cable Connector. The default preset is TerminalStrip_2.5mm2_x3.
  • DANEThickness (Length): Specifies the thickness of the wall between the hole and external surface of connector. The default thickness is 1 mm.

Tutorials

Typical workflow

This workflow shows how to build a connector, a cable box, a cable and how one subwire of cable can be passed through the one of connector holes.

  1. Create a Cable Box and a Cable attached to it as described in Cable Box Typical workflow.
  2. Select the Cable Box in a Tree View and create a Cable Connector as described in Usage.
  3. Move the Cable Connector to the desired position using e.g. TransformManip tool.
  4. Attach the Cable Connector to the Cable Box using Attach In Place tool.
  5. Hide the Cable Box and Cable shapes in a Tree View e.g. by pressing SPACE key. The cable subwires should be still visible.
  6. Attach the end point of longest subwire created in step 1 to the first CableTerminal segment by using Attach Wire To Terminal tool (CableTerminal is a child object of the Cable Connector).
  7. Unhide Cable and Cable Box shapes in a Tree View e.g. by pressing SPACE key.

Example of cable subwire passed through the hole of Cable Connector.

Here is the animated image showing the steps described above.