Cables ElectricalDevice
|
|
| Menu location |
|---|
| Cables → Electrical Device |
| Workbenches |
| Cables |
| Default shortcut |
| C E |
| Introduced in version |
| 0.3.0 |
| See also |
| Cables Cable, Cables CableBox, Cables CableTerminal, Cables SuppLines |
Description
The Electrical Device represents a model of any electrical device that has the possibility of direct cable connection. Its shape can be selected from DataPreset list upon creation. There is only non parametric shape type available. It is called 'Fixed'.
The 'Fixed' shape type creates non parametric device object with a shape taken from external STEP file. There are a few predefined STEP device models shipped together with Cables Workbench. Moreover, the user can create their own device library, this is described in Electrical Device presets. In addition to the shape the certain number of CableTerminals are created with predefined size and position corresponding to connection points. Additionally one or more SuppLines objects can be created forming the basis for the cable entering the device.
The Electrical Device belongs to the Arch Component class and inherits all of its properties.
Electrical Device object can be colored by attaching desired Material to the Material property. MultiMaterial is also supported. It can be used to change the original device 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 device.
Example of the Electrical Device (Miniature Circuit Breaker 1-Pole):
There are two red CableTerminals positioned on both sides of a device body.
Usage
- Select the vertex, point on surface or object in the 3D View or select nothing.
- Create Electrical Device by one of these methods:
- Press the
Electrical Device button.
- Select the Cables →
Electrical Device option from the menu.
- Right-click in the Tree View or the 3D View and select the Cables →
Electrical Device option from the context menu.
- Use the keyboard shortcut: C then E.
- Press the
- The Electrical Device task panel opens. See Options for more information.
Once created the Electrical Device 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 Electrical Device preset available in the task panel can be changed. The currently selected preset is immediately visible in the 3D View.
Currently the task panel doesn't show any additional options when the special 'Customized' preset is selected.
Electrical Device presets
Cables Workbench comes with several predefined shapes. However, the user is not limited to using the default set.
An additional CSV file can be created by the user, containing custom Electrical Device Preset definitions. It must be named devicepresets.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 devicepresets.csv file must be modeled upon the same rules as the devicepresets.csv in the Cables Workbench source code. The file is self descriptive and can be used as a template to create custom Presets.
The custom devicepresets.csv file can be modified without restarting FreeCAD. Any changes made there are immediately visible in the list of Presets when making a new Electrical Device from the GUI.
Currently the devicepresets.csv can contain only one preset type: Fixed PresetType.
Fixed PresetType
The definition of this type needs two additional files. The line in the devicepresets.csv file among other parameters defines names of these two additional preset files:
- STEP file with the shape and colors of the device. The name of this file has to be put directly (file example: Dummy_Dummy.step)[1].
- CSV file with placements of the device body, parameters for all attached CableTerminals and SuppLines. The name of this file is made from concatenation of DeviceClass and Name fields (file example: Device_Dummy.csv).
This two additional files (STEP and CSV) have to be placed in the:
$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 devices with the same STEP definition but different number of Terminals or their placement if needed.
More details about fixed PresetType in devicepresets.csv file
The single preset line of devicepresets.csv contains several information for the software analyzing this file. For precise description, see CableConnector More details about Fixed PresetType in connectorpresets.csv file, where the same rules as here are applied.
Example of fixed PresetType
As a template and example the Device_Dummy preset can be taken:
The preset definition line is in the file devicepresets.csv:
Dummy,Fixed,Device,Dummy_Dummy.step,2,2
Where the fields represent the following:
Name,Fixed,DeviceClass,StepFileName,NrOfTerminals,NrOfSuppLines
From the above definition it follows that the file Dummy_Dummy.step and Device_Dummy.csv (filename built from DeviceClass_Name.csv) have to be present in one of the folders mentioned above.
After checking, the Dummy_Dummy.step and Device_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 Electrical Device with two CableTerminals and two 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.
In case of problems see CableConnector STEP File for which the same rules apply as here.
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 devices.
Notes
- The CableTerminal and SuppLines objects have reversed relation with their Electrical Device 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 Electrical Device 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 Electrical Device.
Properties
An Electrical Device 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
- DataBase (
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.
Electrical Device
- DataClaim Children (
Bool): If set totrueit will claim the linked Terminals and SuppLines as children in the Tree View (introduced in version 0.3.3). - DataNumber Of Supp Lines (
Integer): (hidden by default) Specifies the number of a SuppLines child objects. The default value is 0. - DataNumber Of Terminals (
Integer): (hidden by default) Specifies the number of a CableTerminal child objects. The default value is 1. - DataPreset (
Enumeration): Specifies the predefined set of parameters for Electrical Device. The default preset isMCB_1-Pole.
Tutorials
- Cables Create Custom Connector describes the creation of a connector with a Fixed PresetType. The creation of a custom ElectricalDevice is very similar.
- In the step Main presets file instead of connectorpresets.csv the devicepresets.csv should be used.
- In the step CSV description file for STEP file instead of Connector_Dummy.csv the Device_Dummy.csv should be used.
Typical workflow
The way of building a Electrical Device is very similar to the Cable Box Typical workflow or Cable Connector Typical workflow
