Part Tube

From FreeCAD Documentation
Revision as of 20:09, 1 March 2022 by Roy 043 (talk | contribs)

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

Part Tube

Menu location
Part → Primitives → Create tube
Workbenches
Part
Default shortcut
None
Introduced in version
0.19
See also
Part CreatePrimitives

Description

The Part Tube command creates a parametric tube solid. In the coordinate system defined by its DataPlacement property, the bottom face of the tube lies on the XY plane with its center at the origin.

Usage

  1. There are several ways to invoke the command:
    • Press the Part Tube button.
    • Select the Part → Primitives → Create tube option from the menu.
  2. The Tube task panel opens and a preview of the tube is displayed in the 3D view.
  3. Specify the Outer radius, the Inner radius and the Height.
  4. The preview is dynamically updated.
  5. Press the OK button.
  6. The tube is created.
  7. Optionally change the dimensions and DataPlacement of the tube by doing one of the following:
    • Change the dimensions by double-click the object in the Tree view to reopen the Tube task panel. See above.
    • Change the properties in the Property editor.
    • Change the DataPlacement with the Std TransformManip command.

Example

Part Tube from the scripting example

A Part Tube object created with the scripting example below is shown here.

Properties

See also: Property editor.

A Part Tube object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:

Data

Attachment

The object has the same attachment properties as a Part Part2DObject.

Tube

  • DataHeight (Length): The height of the tube. The default is 10mm.
  • DataInner Radius (Length): The inner radius of the tube. Must be smaller than DataOuter Radius. Can be 0. The default is 2mm.
  • DataOuter Radius (Length): The outer radius of the tube. Must be larger than DataInner Radius. The default is 5mm.

Scripting

See also: Autogenerated API documentation, Part scripting and FreeCAD Scripting Basics.

A Part Tube can be created with the addTube() method (introduced in version 0.20) of the Shapes module:

tube = Shapes.addTube(FreeCAD.ActiveDocument, "myTube")
  • Where "myTube" is the name for the object.
  • The function returns the newly created object.

Example:

import FreeCAD as App
from BasicShapes import Shapes

doc = App.activeDocument()

tube = Shapes.addTube(FreeCAD.ActiveDocument, "myTube")
tube.Height = 20
tube.InnerRadius = 2
tube.OuterRadius = 3
tube.Placement = App.Placement(App.Vector(2, 4, 5), App.Rotation(60, 60, 30))

doc.recompute()