Model Handling Functions
- Last UpdatedNov 24, 2023
- 2 minute read
This chapter describes functions handling models in the current drawing.
|
model_draw(model, <viewhandle>) model_draw(AssemblyCriteria, <viewhandle>) |
||
|
This function draws whole model object, part or assembly. Valid model types are: plane panel, pipe, cable way, shell profiles, equipment, struct, hull curve, placed volume and ventilation. In case of plane panels parts like: holes and cutouts cannot be separately drawn. |
||
|
Input Parameters: |
||
|
model |
Model |
Instance of KcsModel.Model class (name, type and part). |
|
AssemblyCriteria |
ModelDrawAssyCriteria |
Instance of KcsModelDrawAssyCriteria class. |
|
viewhandle |
ElementHandle |
Optional parameter. Handle to model view where model should be placed. If not given model will be placed in all model views. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ArgumentError |
Invalid arguments. |
|
|
kcs_ValueError |
Invalid parameter value |
|
|
kcs_HandleInvalid |
Given handle is not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_ModelViewNotFound |
No model view is found. |
|
|
kcs_Error |
Specified model or assembly cannot be drawn. |
|
|
model_delete(Model, <ViewHandle>) |
||
|
The function deletes a given model in given view in the current drawing. |
||
|
Input Parameters: |
||
|
Model |
Model |
The model to delete (type & name) |
|
ViewHandle |
ElementHandle |
Optional view handle. If no view specified then all views will be used. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_ModelNotFound |
The model was not found in the drawing |
|
|
model_colour_set(Model, Colour, <ViewHandle>) |
||
|
The function changes the colour of a model in given view in the current drawing. |
||
|
Input Parameters: |
||
|
Model |
Model |
The model (type & name |
|
Colour |
Colour |
The colour |
|
ViewHandle |
ElementHandle |
Optional view handle. If no view specified then all views will be used. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_ModelNotFound |
The model was found in the drawing |
|
|
kcs_ColourInvalid |
Invalid colour |
|
|
model_layer_set(Model, Layer, <ViewHandle>) |
||
|
The function changes the colour of a model in given view in the current drawing. |
||
|
Input Parameters: |
||
|
Model |
Model |
The model (type & name |
|
Layer |
Layer |
The layer |
|
ViewHandle |
ElementHandle |
Optional view handle. If no view specified then all views will be used. |
|
Returned value: |
||
|
None |
||
|
Exceptions: |
||
|
kcs_ValueError |
Invalid parameter value |
|
|
kcs_DrawingNotCurrent |
No drawing was current |
|
|
kcs_ModelNotFound |
The model was found in the drawing |
|
|
kcs_ColourInvalid |
Invalid colour |
|
|
model_properties_get(handle, model) |
||
|
This function returns the properties of a model or part (subpicture on subview or component level or geometry handle) |
||
|
Input Parameters: |
||
|
handle |
ElementHandle |
Handle to the subview, component or geometry. |
|
model |
Model |
Instance of KcsModel.Model class. |
|
Returned value: |
||
|
[0] |
Model |
Instance of KcsModel.Model class. |
|
Exceptions: |
||
|
kcs_HandleInvalid |
Invalid handle. |
|
|
kcs_ArgumentError |
Invalid parameter. |
|
|
kcs_DrawingNotCurrent |
No drawing was current. |
|
|
kcs_ModelNotFound |
Model not found. |
|
|
kcs_draft.model_handle_get(model) |
||
|
The function will return list of all subviews containing given model or list of all components containing given model part (if KcsModel.Model.PartId <> 0) |
||
|
Input Parameters: |
||
|
mdel |
KcsModel.Model |
Instance of Model class. |
|
Returned value: |
||
|
[0] |
List of ElementHandle instances |
List of: -subviews' handles if PartId = 0 -components' handles if PartId <> 0 |
|
Exceptions: |
||
|
kcs_ArgumentError |
Arguments types are not valid. |
|
|
kcs_DrawingNotCurrent |
No drawing is current. |
|
|
kcs_ValueError |
Model name and type are to long strings. |
|
|
kcs_GeneralError |
General error. |
|
|
Example: |
||
|
# Example: kcs_ex_draft19.py # Example: kcs_ex_draft33.py |
||