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

Hull and Outfitting

Point Request Functions

  • Last UpdatedNov 27, 2023
  • 2 minute read

point2D_req(Message, Point <Status>, <Buttons>))

The function presents a message to the user and lets him define a 2D point in the current drawing. The initial point definition mode is "cursor position".

U/V locking

U/V locking can easily be implemented in the 2D point selection. If the lock buttons are enabled (see documentation of KcsButtonState.ButtonState class at User Interface), the function will return one of the following response codes if the user has pressed any lock button:

  • kcs_util.u_lock()

  • kcs_util.v_lock()

  • kcs_util.unlock()

Handling these codes allows the user to take up special actions like draw help locking lines, change cursor type before next point2d_req call

By default 2D lock buttons are disabled so it is required to give the Buttons parameter if you want to enable them.

Use Point2DLockReq function defined in kcs_ex_ui1.py as example of handling u/v locking with point2D_req. It draws help locking lines and adjusts result point to locked coordinate.

Input parameters:

Message

string

The message to the user (max 512 characters)

Status

Stat_point2D_req

Point definition mode and cursor type. This parameter is optional.

Buttons

ButtonState

Controls visibility of buttons and u/v lock handling. This parameter is optional

Output parameters:

Point

Point2D

The resulting 2D point

Returned value:

[0]

integer

User response

[1]

Point2D

The resulting 2D point

Exceptions:

kcs_ValueError

Invalid parameter value

kcs_DrawingNotCurrent

No drawing was current

point3D_req(Message, InitStatus, Point)

The function presents a message to the user and lets him define a 3D point in the drawing. The optional InitStatus parameter guides some initial conditions for the point definition.

Input parameters:

Message

string

The message to the user (max 512 characters)

InitStatus

Stat_point3D_req

Initial conditions (optional)

Output parameters:

Point

Point3D

The resulting 3D point

InitStatus

Stat_point3

D_req

Resulting lock and initial point definition status (optional)

Returned value

[0]

integer

User response

[1]

Point3D

The resulting 3D point

Exceptions:

kcs_ValueError

Invalid parameter value

kcs_DrawingNotCurrent

No drawing was current

Example:

# Example: kcs_ex_ui1.py

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