Functions for Creation of Symbols
- Last UpdatedNov 24, 2023
- 1 minute read
This section describes functions to create symbol entities (elements) in the current drawing. Each function returns a handle to the created entity, used for identification in subsequent processing of the entity (for example, the delete function).
|
symbol_new(Font, SymbNo, Pos) symbol_new(Symbol) |
||
|
The function creates a symbol, with modal attributes, in the current drawing. |
||
|
Input Parameters: |
||
|
Font |
integer |
Font number. |
|
SymbNo |
integer |
Symbol number. |
|
Pos |
Point2D |
Position of the symbol. |
|
Symbol |
KcsSymbol |
Instance of KcsSymbol.Symbol class. |
|
Returned value: |
||
|
[0] |
integer |
Handle to the created symbol. |
|
Exceptions: |
||
|
kcs_FontInvalid |
Invalid font id |
|
|
kcs_SymbolInvalid |
Invalid symbol id. |
|
|
kcs_ValueError |
Invalid parameter value. |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_Error |
General error. |
|
|
kcs_PythonLibraryNotFound |
Program can't find python library. |
|
|
kcs_PythonMethodNotFound |
Python module error. |
|
|
Example: |
||
|
# Example: kcs_ex_draft12.py |
||
|
# Example: kcs_ex_draft24.py |
||
|
# Example: kcs_ex_draft25.py |
||
|
general_restr_symbol_new(Parent, StartPt, EndPt, Soft ) |
||
|
The function creates a new general restriction symbol primitive. |
||
|
Parent |
ElementHandle |
Parent subview handle. The created component will belong to given subview. |
|
StartPt |
Point2D |
Starting point of symbol |
|
EndPt |
Point2D |
Ending point of symbol |
|
Soft |
boolean |
If true restriction symbol will be generated using spline. Otherwise contour will be used. |
|
Returned value: |
||
|
[0] |
ElementHandle |
Handle to the created component. |
|
Exceptions: |
||
|
ks_DrawingNotCurrent |
No drawing was current |
|
|
kcs_HandleInvalid |
nvalid handle of subview. |
|
|
kcs_ArgumentError |
Invalid arguments list. |
|
|
kcs_ValueError |
Distance between points is to short. |
|
|
kcs_Error |
General error. General restriction symbol can't be created. |
|