Part Tube: Difference between revisions

From FreeCAD Documentation
(Removed the Notes paragraph.)
(Properties)
Line 46: Line 46:
==Properties== <!--T:9-->
==Properties== <!--T:9-->


<!--T:10-->
See also: [[Property_editor|Property editor]].
See also: [[Property_editor|Property editor]].


Line 52: Line 51:


=== Data ===
=== Data ===

{{TitleProperty|Attachment}}

The object has the same attachment properties as a [[Part_Part2DObject#Data|Part Part2DObject]].


{{TitleProperty|Tube}}
{{TitleProperty|Tube}}

* {{PropertyData|Height|Length}}: Sets the height (default is 10 mm).
<!--T:10-->
* {{PropertyData|Inner Radius|Length}}: Set the inner radius (default is 2 mm).
* {{PropertyData|Outer Radius|Length}}: Set the outer radius (default is 5 mm).
* {{PropertyData|Height|Length}}: The height of the tube. The default is {{Value|10mm}}.
* {{PropertyData|Inner Radius|Length}}: The inner radius of the tube. Must be smaller than {{PropertyData|Outer Radius}}. Can be {{Value|0}}. The default is {{Value|2mm}}.
* {{PropertyData|Outer Radius|Length}}: The outer radius of the tube. Must be larger than {{PropertyData|Inner Radius}}. The default is {{Value|4mm}}.


== Scripting == <!--T:12-->
== Scripting == <!--T:12-->

Revision as of 10:33, 1 March 2022

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 Tube button.
    • Select the Part → Primitives → Tube option from the menu.

Example

Part Tube scripting example.

A Part Tube object with the values of the bottom scripting example are 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 4mm.

Scripting

A Part Tube can be created with the following code from the CommandShapes.py file:

from BasicShapes import Shapes
from BasicShapes import ViewProviderShapes

tube = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "myTube")

Shapes.TubeFeature(tube)
ViewProviderShapes.ViewProviderTube(tube.ViewObject)
  • Where myTube is the name for the object. The name must be unique for the entire document.
  • The function returns the newly created object.

You have to recompute the current document with

App.activeDocument().recompute(None,True,True)

to see the tube.

The Label is the user editable name for the object. It can be easily changed by

tube.Label = "new myTubeName"

You can access and modify attributes of the tube object. For example, you may wish to modify the length, width and height parameters.

tube.Height = 20
tube.InnerRadius = 2
tube.OuterRadius = 3

You can change its placement with:

tube.Placement = FreeCAD.Placement(FreeCAD.Vector(1, 2, 3), FreeCAD.Rotation(60, 60, 30))