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

Hull and Outfitting

Common Sample

  • Last UpdatedJan 07, 2026
  • 2 minute read

This module contains some useful Python functions used by samples. These functions can be used by users as well.

Functions in the CommonSample.py module are the following:

  • ReportTribonError(module, output=0)

    Displays module error on selected output:

    • 0 - console and command window,

    • 1 - only console window,

    • 2 - only command window.

  • SelectView(prompt)

    Allows the user to select a view in current drawing. Returns tuple: (status, viewhandle) where status is equal to:

    • 1 - view selected

    • 0 - selection cancelled

  • SelectSubview(prompt)

    Allows the user to select a subview in current drawing. Returns tuple: (status, subviewhandle) where status is equal to:

    • 1 - subview selected or

    • 0 - selection cancelled

  • SelectComponent(prompt)

    Allows the user to select a component in current drawing. Returns tuple: (status, comphandle) where status is equal to:

    • 1 - component selected or

    • 0 - selection cancelled

  • SelectSubpicture(prompt, level=3)

    Select subpicture function. It displays "user choice" dialog box to select subpicture type and then allows the user to select chosen subpicture type in current drawing.

    Level specifies what kind of subpicture is allowed:

    • 1 - view

    • 2 - view and subview

    • 3 - view, subview and component

      Function returns tuple: (status, subpicture handle) where status can be:

    • 0 - subpicture not selected

    • 1 - view selected

    • 2 - subview selected

    • 3 - component selected

  • SelectGeometry(prompt)

    This function is used for interactive selection of geometry. It returns tuple: (status, geometry handle) where status can be:

    • 0 - geometry not selected,

    • 1 - geometry selected.

  • SubpictureInsert(name, parenthandle=None)

    This function is an extension of Vitesse subpicture_insert function from kcs_draft module. Since kcs_draft.subpicture_insert requires parent subpicture to be on correct level the CommonSample.SubpictureInsert function will find/create correct subpicture based on given handle. If no handle is given function will create new subpictures path.

    Tip: Let's suppose that the subpicture given by name is a component and parenthandle points to any view. The function will then create the missing subview and it will be used as parent for inserted component.

    The function returns:

    • 1 - if subpicture was inserted successfully or,

    • 0 - otherwise.

  • Point2DLockReq(prompt, point, status, buttons)

    This function is an extension of the Vitesse point2d_req function from kcs_ui. It has the same input and results as point2d_req. Its main purpose is handling locking buttons. It draws help lines and modifies result point corresponding to selected locking direction.

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