Cables PartsLibrary


Cables PartsLibrary

Menu location
Cables → Parts Library
Workbenches
Cables
Default shortcut
None
Introduced in version
0.4.0
See also
Cables CableBox, Cables CableConnector, Cables ElectricalDevice

Description

The Parts Library command is designed to perform operations on items in the local library.

The local library concerns elements: CableBox, CableConnector, ElectricalDevice. The Parts Library command allows for the creation of custom definitions for them. The local library is always stored on the user's computer and is independent of the document being edited. This means that the elements contained in a document sent to another computer are not automatically transferred to the local library at the new location. They exist only in the sent document.

The Parts Library command enables the creation of new items in the local library or deletion of existing items from local library depending on the context in which the command is invoked (see the Usage and Options sections). Editing an item from a library is done by inserting the item into the current document, modifying it within that document, and then re-inserting it into the library under the same name.

The local library is automatically created in the $FREECAD_USER_DIR/Cables/ folder. The exact location of the $FREECAD_USER_DIR can be checked in the Python Console by invoking the command: FreeCAD.getUserAppDataDir().

Usage

Creating a new item in the local library

Prerequisite: all the necessary components required to create an element in the library already exist within the current document and they are already correctly positioned relative to one another and to the main coordinate system. Refer to Typical workflow or Tutorials for more details.

  1. Select the solid object, or compound of solids. This could be, for example, a previously created object of type: Std Part, PartDesign Body, Part Compound etc., an object imported from STEP file or existing object from Cables Workbench. It will be the main shape of the new item in the library.
  2. If needed, select all necessary CableTerminal objects holding the CTRL key. The order of selection is important. The CableTerminal objects will be numbered according to the order in which they are selected.
  3. If needed, select all necessary SnapLines objects holding the CTRL key. The order of selection is important. The SnapLines objects will be numbered according to the order in which they are selected.
  4. Run Parts Library command by one of these methods:
  5. The creation dialog box opens. See Options for more information. Select needed options and finally press the Add to local library button. If the element with Preset Full Name already exists in the library it will be overwritten upon further confirmation via the Force overwrite button.

Removing items from the local library

  1. Clear the selection of any objects (e.g. by clicking empty space in the 3D View).
  2. Run the Parts Library command as desribed in the step 4 above.
  3. The deletion dialog box opens. Select all items intended for removal and press the Delete button.

Options

Notes

Tutorials

todo

Typical workflow

Scenario 1: Making a new connector or device library part from a STEP file

  1. Obtain the STEP file
    • Make your own shape of a connector/device and export it to the STEP file (example: D-Sub_DE-9_M)
    • or download a ready-made STEP file from the internet. Recommended format: AP242. VERY IMPORTANT: Some STEP files may subsequently fail to load correctly from the library when creating new objects. Some STEP files might not load correctly from the library later on when creating new objects. The CableConnector STEP File describes how to deal with this problem.
  2. Create a new document
  3. Import the STEP file (command from menu: File/Import).
  4. Position the imported shape at the center of the coordinate system, in the orientation in which it is intended to be retrieved from the library later.
  5. Create a new "Connector_Dummy" and move it to the side so that it doesn't conflict with the imported shape (command CableConnector). This is needed to get CableTerminal and SnapLines objects which can't be created directly.
  6. Delete the "CableConnector" object and answer "Yes" to the pop-up notification. There should remain three CabeTerminal objects and one SnapLines object. They will be used to build a new library part.
  7. Move and rotate all needed Terminal objects into their target positions.
    • If there is an insufficient number of Terminal objects, they can be duplicated by copying and pasting.
    • Redundant Terminal objects can be deleted.
    • it is important that the #1 vertices of the Terminal objects are oriented outwards. This is needed when connecting the cables later on.
    • If necessary, the length of any Terminal object can be adjusted via its Length property.
  8. Set the Pin Name property for each Terminal object if needed.
  9. Move and rotate all needed SnapLines objects into their target positions. Follow the same rules as for the Terminal objects.
  10. Set the Snap Name property for each SnapLines object if needed.
  11. Follow the next steps according to Creating a new item in the local library.

Scenario 2: Making a new parametric cable box library part

  1. Create a new document
  2. Create a new "Customized" CableBox by selecting "Customized" preset upon creation and set all needed box parameters.
  3. Select created CableBox object and follow the Creating a new item in the local library without selecting any additional Terminal or SnapLines objects.
    • The dialog box will automatically propose the Class and Name. They can be changed if needed.

Scenario 3: Making a new parametric terminal strip connector library part

  1. Create a new document
  2. Create a new "Customized" CableConnector by selecting "Customized" preset upon creation and set all needed connector parameters.
  3. Select created CableConnector object and follow the Creating a new item in the local library without selecting any additional Terminal or SnapLines objects.
    • The dialog box will automatically propose the Class and Name. They can be changed if needed.