Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Hull and Outfitting

Functions for Creation of Basic Geometric Entities

  • Last UpdatedNov 27, 2023
  • 2 minute read

This section describes functions to create geometric entities (elements) in the current drawing. These functions take an instance of a "geometric" class as input. For further information about such geometric classes, see the documentation of Geometry.

Each function returns a handle to the created entity, used for identification in subsequent processing of the entity (for example, the delete function).

arc_new(Arc)

The function creates a circular arc.

Input Parameters:

Arc

Arc2D

The arc definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

kcs_AmplitudeTooBig

The amplitude was too big

circle_new(Circle)

The function creates a circle.

Input Parameters:

Circle

Circle2D

The circle definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

conic_new(Conic)

The function creates a conic segment.

Input Parameters:

Conic

Conic2D

The conic segment definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

contour_new(Contour)

The function creates a contour.

Input Parameters:

Contour

Contour2D

The contour definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

kcs_AmplitudeTooBig

The amplitude in at least one segment was too big

ellipse_new(Ellipse)

The function creates an ellipse.

Input Parameters:

Ellipse

Ellipse2D

The ellipse definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

line_new(Line)

The function creates a restricted line.

Input Parameters:

Line

Rline2D

The line definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

point_new(Point)

The function creates a point.

Input Parameters:

Point

Point2D

The point definition

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

rectangle_new(rectangle, <radius>)

The function creates regular or with rounded-corners rectangle.

Input Parameters:

Rectangle

Rectangle2D

Description of rectangle.

radius

real

It is used for rounded corners rectangle and specifies radius for corners arcs. Valid values are from 0.0 to half length of minimal rectangle side. This parameter is optional.

Returned value:

[0]

ElementHandle

Handle to new element.

Exceptions:

kcs_ValueError

Invalid parameter value. (for example, radius not valid)

kcs_DrawingNotCurrent

No drawing was current

kcs_Error

General error. Can't create element.

spline_new(Spline)

The function creates a spline, defined by a number of points. The spline is created with no tangent conditions.

Input Parameters:

Polygon

Polygon2D

The points defining the spline

Returned value:

[0]

integer

Handle to the created entity

Exceptions:

kcs_DrawingNotCurrent

No drawing was current

kcs_ValueError

Invalid parameter value

Example:

# Example: kcs_ex_draft7.py

Related Links
TitleResults for “How to create a CRG?”Also Available in