Server

Introduction

Server is a tool, that can facilitate interprocess communication (IPC) for you. IPC consists of a transmission control protocol (TCP) server running in FreeCAD and a client outside. The TCP server can be connected to localhost or any other other IP address. Server's port can be selected arbitrarily in range from 1 to 65535, but ports that are not

are recommended. You can send command strings from external python script, C++ or Matlab using Qt5, PySide or python bindings respectively. Python command strings must compy with the FreeCAD/FreeCADGui application programming interface (API).

Usage

Server tool's position inside
an example Animate tool tree.
  1. Install Animate workbench if you haven't done so already.
  2. Open a file in FreeCAD.
  3. Select Animate workbench on the workbench toolbar.
  4. Click on server's icon on Animate toolbar or select server in Animate menu.
  5. Open a Combo View ( View > Panels > Combo View ).
  6. Select server tool in a tree view on a Model Tab inside the Combo View.
  7. Go to Server Settings on a Data Tab inside the Combo View.
  8. Select an IP Address and a TCP Port you want to connect the server to.
  9. To start/stop the server tool double-click it in the tree view on a Model Tab inside the Combo View.
  10. Send python command strings from other programs to be executed.

Properties

Property / Property Group Description
Base FreeCAD properties necessary for correct display in the tree view.
Label Name of this server tool shown in the tree view.
Server Settings Properties setting up server's parameters.
Address An IPv4 or IPv6 internet protocol (IP) address or "localhost" string. String "localhost" is equal to IPv4 address 124.0.0.1.
Port A TCP port number from 1 to 65535. Check with IANA to select an unassigned TCP port number. Each server tool has to have an unique port number.
Running A boolean specifying if the server is currently running or not.