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

Hull and Outfitting

Drawing Element Functions

  • Last UpdatedNov 27, 2023
  • 3 minute read

element_transform(elementHandle, <transf2d>)

The function transform element by given transformation data.

Input Parameters:

elementHandle

KcsElementHandle

Handle to the element.

<transf2d>

Transformation2D

Transformation data. If not given then transformation toolbar will be displayed and the user will be prompted to transform given element manually.

Returned value:

None

Exceptions:

kcs_ArgumentError

Invalid parameter type.

kcs_HandleInvalid

Invalid handle.

kcs_ValueError

Invalid parameter value.

kcs_DrawingNotCurrent

No drawing was current.

element_transformation_get (ElemHandle, Transf2D)

The function retrieves the defined transformation for a given element.

Input Parameters:

ElemHandle

ElementHandle

Handle to element

Transf2D

Transformation2D

Instance of KcsTransformation2D.Transformation2D class

Returned value:

[0]

Transf2D

Instance of KcsTransformation2D.Transformation2D class

Exceptions:

kcs_ArgumentError

Invalid parameter type.

kcs_DrawingNotCurrent

No drawing was current.

kcs_HandleInvalid

Given handle is invalid. (for example, doesn't point to view)

kcs_Error

General error

kcs_PythonMethodNotFound

Method in Transformation2D python class not found.

element_copy(elementHandle, <targetSubpictureHandle>)

The function copies an element and places it under the given target subpicture. If no target subpicture is given, the new element will belong to the same subpicture as the source element. If the element is subpicture and the target parent subpicture already has a subpicture with this name, the name will be blanked. Space that when copying and subsequently transforming an element, the original element will be temporarily erased from the display. Please call the dwg_repaint() function to repaint the display so that the original element will appear again.

Input Parameters:

ElementHandle

ElementHandle

Handle to source element.

targetSubpictureHandle

ElementHandle

Handle to target parent subpicture.

Returned value:

[0]

ElementHandle

Handle to new element.

Exceptions:

kcs_ArgumentError

Invalid parameter value.

kcs_HandleInvalid

Given handles are not valid. There are no elements in current drawing with these handles.

kcs_OwnerNotFound

Owner subpicture not found. (for example, view handle for component copy)

kcs_DrawingNotCurrent

No drawing was current.

kcs_Error

General error. Can't copy elements.

element_extent_get(<ElementHandle>)

This function returns the current extent (occupied area) of an element in the current drawing. For subpictures method IsEmpty of returned Rectangle2D instance should be use to determine if subpicture has elements and it is possible to obtain its extent. If ElementHandle is not specified extension of whole drawing will be returned.

Input Parameters:

ElementHandle

ElementHandle

Handle to the element. This parameter is optional.

Returned value:

[0]

KcsRectangle2D

Current extent area.

Exceptions:

kcs_ArgumentError

Invalid parameter value.

kcs_HandleInvalid

Given handle is not valid.

kcs_DrawingNotCurrent

No drawing was current.

kcs_PythonLibraryNotFound

Python library KcsRectangle2D not found.

kcs_PythonMethodNotFound

Error in python definition of KcsRectangle class.

Example:

# Example: kcs_ex_draft30.py

# Example: kcs_ex_draft31.py

# Example: kcs_ex_draft35.py

element_transformation_redefine (Handle, Transf2d)

This function redefines transformation for given element.

Input Parameters:

Handle

ElementHandle

Handle to element

Transf2d

Transformation2D

New transformation

Returned value:

None

Exceptions:

kcs_ArgumentError

Invalid arguments list.

kcs_HandleInvalid

Invalid element handle.

kcs_DrawingNotCurrent

No drawing was current.

element_visibility_get (elementHandle)

This function sets visibility of element specified by handle.

Input Parameters:

elementHandle

KcsElementHandle

Handle to the element.

Returned value:

[0]

integer

1 - if element is visible

0- otherwise

Exceptions:

kcs_ArgumentError

Argument error

kcs_DrawingNotCurrent

There is no current drawing.

kcs_HandleInvalid

Given handle is not a valid handle.

element_visibility_set (elementHandle, Visibility)

This function sets visibility of element specified by handle.

Input Parameters:

elementHandle

KcsElementHandle

Handle to the element.

Visibility

integer

If Visibility = 1 element will be visible, if 0 not.

Returned value:

None.

Exceptions:

kcs_ArgumentError

Argument error.

kcs_DrawingNotCurrent

There is no current drawing.

kcs_HandleInvalid

Given handle is not a valid handle.

element_depersist(elementHandle)

The function removes given element from PADD. Presently, only dimension components are accepted.

Input Parameters:

elementHandle

KcsElementHandle

Handle to the element.

Returned value:

[0]

integer

-1  No dimension component.

0   Element already de-persisted, no action.

1   OK, element de-persisted.

Exceptions:

kcs_ArgumentError

Invalid parameter type.

kcs_HandleInvalid

Invalid handle.

kcs_DrawingNotCurrent

No drawing was current.

element_envelope_define (elementHandle)

The function makes a view/subview, in the current drawing, enveloped.

The subpicture is given by the element handle.

Input Parameters:

elementHandle

KcsElementHandle

Handle to a viev or subview

Returned value:

[0]

integer

1 if operation success,

0 if subpicture already was enveloped

Exceptions:

kcs_ArgumentError

Invalid parameters

kcs_DrawingNotCurrent

No drawing was current

kcs_HandleInvalid

Not a valid view/subview handle

element_envelope_remove (elementHandle)

element_envelope_remove (idPoint)

The function removes the envelope on a view/subview in the current drawing.

The enveloped subpicture is given either by the element handle, or identified by a 2D point.

Input Parameters:

elementHandle

KcsElementHandle

Handle to the enveloped view/subview

idPoint

Point2D

Point identifying the enveloped

Returned value:

[0]

integer

1 if operation success

0 if given subpicture was not enveloped, or no enveloped subpicture could be identified

Exceptions:

kcs_ArgumentError

Invalid parameters

kcs_DrawingNotCurrent

No drawing was current

kcs_HandleInvalid

Invalid handle to view/subview

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