Skip to content

pytha.create_section

fabian-flassig edited this page Jul 31, 2026 · 3 revisions

Creates a section from a selection of parts and groups.

pytha.create_section(elements [, options])
Parameter Type Description
elements element_handle or { element_handle* } Parts and groups that define the section scope
options table (optional) Section plane and naming options

Return value

Type Description
element_handle or nil A handle to the created section. nil if operation failed

options table

The options table can contain one or more of the following keys:

Property Type Description
plane string Section plane: "xy", "xz", "yz", "-xy", "-xz" or "-yz"
position {number, number, number} A point through which the section plane passes
angle number Additional section angle to rotate the plane around.
rotation number Rotation of the section representation in 90° steps
name string Section name
target string "plot" (default): the section is only shown on the plot sheet. "model_plot": the section is also shown in the model area. (Requires PYTHA V27 or later.)

Example:

local section = pytha.create_section(parts, {
    plane = "xz",
    position = {0, 0, 500},
    name = "Section A"
})

Remarks:

The function creates a section that can be inserted on a plot page.

If elements resolves to an empty part selection, all model parts are used.

If position is given, the section plane is positioned through that point. Otherwise a default position is used.

If name is omitted, an automatic section name is generated.

By default (target = "plot") the section geometry is only visible once inserted on a plot sheet. With target = "model_plot" the section is also shown directly in the model area.

The function returns a section handle.

Version Support:

Minimum PYTHA Version: V26

See also:

pytha.delete_section, pytha.update_section, pyplot.insert_section

Clone this wiki locally