Property Changing and Retrieving Functions
- Last UpdatedJan 07, 2026
- 4 minute read
This chapter describes functions that change properties of arbitrary entities in the current drawing.
Layer Functions
There is a possibility to use the Drafting layer show/hide mechanism in Vitesse. The user can specify layers to show (other layers will be hidden) or layers to hide other layers will be visible). It is not allowed to specify layers to hide and show at the same time.
To reset the layers show/hide mode, the function layer_show_all() should be used..
|
layer_show(layer) layer_show(layersList) |
||
|
The function will show layer (layers). It will set show mode if it is not selected yet. If application is in show mode than this layer will be added to previously selected layers. If hide mode is active it will be reset and than changed to show mode. |
||
|
Input Parameters: |
||
|
layer |
Layer |
Instance of KcsLayer. Layer class. |
|
layersList |
[Layer, …] |
List of KcsLayer. Layer class instances. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument type is not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
layer_hide(layer) layer_hide(layersList) |
||
|
The function will hide layer (layers). It will set hide mode if it is not selected yet. If application is in hide mode than this layer will be added to previously selected layers. If show mode is active it will be reset and than changed to show mode. |
||
|
Input Parameters: |
||
|
Layer |
Layer |
Instance of KcsLayer. Layer class. |
|
layersList |
[Layer, …] |
List of KcsLayer. Layer class instances. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument type is not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
layer_show_all() |
||
|
The function will reset layers show/hide mode. All layers will be visible. |
||
|
Input Parameters: |
||
|
None |
||
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
This function requires no arguments. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_GeneralError |
General error. |
|
Properties Get Functions
This chapter describes functions used to get properties of text, symbol and contour. The properties get functions described in this chapter use the Text, Symbol and Contour2D classes to get properties of element. These classes hold information about a text, symbol and contour..
|
element_layer_get(handle, layer) |
||
|
The function will return element layer. |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to element. |
|
layer |
Layer |
Instance of Layer class. |
|
Returned value: |
||
|
[0] |
Layer |
Instance of Layer class. |
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_PythonMethodNotFound |
Python method not found. Check your KcsLayer implementation file. |
|
|
element_layer_set(handle, layer) |
||
|
The function will set layer of element given by handle. |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to element. |
|
layer |
Layer |
Instance of Layer class. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_PythonMethodNotFound |
Python method not found. Check your KcsLayer implementation file. |
|
|
kcs_GeneralError |
General error. Layer can not be set. |
|
|
model_layer_set(model, layer) |
||
|
The function changes the layer of a model in all views in the current drawing. |
||
|
Input Parameters: |
||
|
model |
Model |
The Model (type & name) |
|
layer |
Layer |
Instance of Layer class. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ValueError |
Argument value error. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_ModelNotFound |
Model not found. |
|
|
kcs_GeneralError |
General error. Layer can not be set. |
|
|
element_colour_get(handle, colour) |
||
|
The function will get colour of geometry element given by handle. |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to geometry element. |
|
colour |
Colour |
Instance of Colour class. |
|
Returned value: |
||
|
[0] |
Colour |
Instance of Colour class. |
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_PythonMethodNotFound |
Python method not found. Check your KcsColour implementation file. |
|
|
element_linetype_get(handle, linetype) |
||
|
The function will get linetype of geometry element given by handle. |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to geometry element. |
|
linetype |
Linetype |
Instance of Linetype class. |
|
Returned value: |
||
|
[0] |
Linetype |
Instance of Linetype class. |
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_PythonMethodNotFound |
Python method not found. Check your KcsLinetype implementation file. |
|
|
element_linetype_set(handle, linetype) |
||
|
The function will set linetype to element given by handle. |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to geometry element. |
|
linetype |
Linetype |
Instance of Linetype class. |
|
Returned value: |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Argument types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_PythonMethodNotFound |
Python method not found. Check your KcsLinetype implementation file. |
|
|
kcs_GeneralError |
General error. Linetype can not be changed. |
|
|
text_properties_get(handle, text) |
||
|
The function returns a properties of text selected by handle. |
||
|
Input Parameters: |
||
|
handle |
integer |
Element handle |
|
text |
KcsText |
Instance of KcsText.Text class. |
|
Returned value: |
||
|
[0] |
KcsText |
Instance of KcsText. Text class. |
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value. |
|
|
kcs_HandleInvalid |
Given handle is not valid or was not found in drawing. |
|
|
kcs_DrawingNotCurrent |
No drawing was current. |
|
|
kcs_Error |
General error. |
|
|
kcs_PythonLibraryNotFound |
Program can't find python library. |
|
|
kcs_PythonMethodNotFound |
Python module error. |
|
|
contour_properties_get(handle, contour) |
||
|
The function returns a properties of contour selected by handle. |
||
|
Input Parameters: |
||
|
handle |
integer |
Element handle |
|
contour |
KcsContour2D |
Instance of KcsContour2D.Contour2D class. |
|
Returned value: |
||
|
[0] |
KcsContour2D |
Instance of KcsContour2D.Contour2D class. |
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value. |
|
|
kcs_HandleInvalid |
Given handle is not valid or was not found in drawing. |
|
|
kcs_DrawingNotCurrent |
No drawing was current. |
|
|
kcs_Error |
General error. |
|
|
kcs_PythonLibraryNotFound |
Program can't find python library. |
|
|
kcs_PythonMethodNotFound |
Python module error. |
|
|
symbol_properties_get(handle, symbol) |
||
|
The function returns a properties of symbol selected by handle. |
||
|
Input Parameters: |
||
|
handle |
integer |
Element handle |
|
symbol |
KcsSymbol |
Instance of KcsSymbol. Symbol class. |
|
Returned value: |
||
|
[0] |
KcsSymbol |
Instance of KcsSymbol. Symbol class. |
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value. |
|
|
kcs_HandleInvalid |
Given handle is not valid or was not found in drawing. |
|
|
kcs_DrawingNotCurrent |
No drawing was current. |
|
|
kcs_Error |
General error. |
|
|
kcs_PythonLibraryNotFound |
Program can't find python library. |
|
|
kcs_PythonMethodNotFound |
Python module error. |
|
|
element_colour_set(Handle, Colour) |
||
|
The function changes the colour of an arbitrary entity. |
||
|
Input Parameters: |
||
|
Handle |
integer |
Handle to the entity |
|
Colour |
Colour |
The colour |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_HandleInvalid |
Invalid handle to given entity |
|
|
kcs_ColourInvalid |
Invalid colour |
|
|
Example: |
||
|
# Example: kcs_ex_draft26.py # Example: kcs_ex_draft23.py |
||
|
reference_move () |
||
|
This function moves reference symbol together with associated text to a new location. |
||
|
Input Parameters: |
||
|
Handle |
ElementHandle |
Handle to reference element. |
|
Position |
Point2D |
New position where reference text should be placed. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Invalid arguments list. |
|
|
kcs_HandleInvalid |
Invalid element handle. |
|
|
kcs_DrawingNotCurrent |
No drawing was current. |
|