AVEVA Marine Vitesse User Guide
AVEVA Marine Vitesse User Guide
AVEVA Marine Vitesse User Guide
Vitesse
User Guide
AVEVA Solutions Limited
Disclaimer
1.1 AVEVA does not warrant that the use of the AVEVA software will be uninterrupted, error-free or free from
viruses.
1.2 AVEVA shall not be liable for: loss of profits; loss of business; depletion of goodwill and/or similar losses; loss of
anticipated savings; loss of goods; loss of contract; loss of use; loss or corruption of data or information; any
special, indirect, consequential or pure economic loss, costs, damages, charges or expenses which may be
suffered by the user, including any loss suffered by the user resulting from the inaccuracy or invalidity of any data
created by the AVEVA software, irrespective of whether such losses are suffered directly or indirectly, or arise in
contract, tort (including negligence) or otherwise.
1.3 AVEVA's total liability in contract, tort (including negligence), or otherwise, arising in connection with the
performance of the AVEVA software shall be limited to 100% of the licence fees paid in the year in which the user's
claim is brought.
1.4 Clauses 1.1 to 1.3 shall apply to the fullest extent permissible at law.
1.5 In the event of any conflict between the above clauses and the analogous clauses in the software licence under
which the AVEVA software was purchased, the clauses in the software licence shall take precedence.
Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every part of it
(including source code, object code, any data contained in it, the manual and any other documentation supplied
with it) belongs to, or is validly licensed by, AVEVA Solutions Limited or its subsidiaries.
All rights are reserved to AVEVA Solutions Limited and its subsidiaries. The information contained in this document
is commercially sensitive, and shall not be copied, reproduced, stored in a retrieval system, or transmitted without
the prior written permission of AVEVA Solutions Limited. Where such permission is granted, it expressly requires
that this copyright notice, and the above disclaimer, is prominently displayed at the beginning of every copy that is
made.
The manual and associated documentation may not be adapted, reproduced, or copied, in any material or
electronic form, without the prior written permission of AVEVA Solutions Limited. The user may not reverse
engineer, decompile, copy, or adapt the software. Neither the whole, nor part of the software described in this
publication may be incorporated into any third-party software, product, machine, or system without the prior written
permission of AVEVA Solutions Limited, save as permitted by law. Any such unauthorised action is strictly
prohibited, and may give rise to civil liabilities and criminal prosecution.
The AVEVA software described in this guide is to be installed and operated strictly in accordance with the terms
and conditions of the respective software licences, and in accordance with the relevant User Documentation.
Unauthorised or unlicensed use of the software is strictly prohibited.
Copyright 1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved. AVEVA shall not
be liable for any breach or infringement of a third party's intellectual property rights where such breach results from
a user's modification of the AVEVA software or associated documentation.
AVEVA Solutions Limited, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom.
Trademark
AVEVA and Tribon are registered trademarks of AVEVA Solutions Limited or its subsidiaries. Unauthorised use of
the AVEVA or Tribon trademarks is strictly forbidden.
AVEVA product/software names are trademarks or registered trademarks of AVEVA Solutions Limited or its
subsidiaries, registered in the UK, Europe and other countries (worldwide).
The copyright, trademark rights, or other intellectual property rights in any other product or software, its name or
logo belongs to its respective owner.
Vitesse User Guide
Revision Sheet
Contents Page
Vitesse
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2
Development and Migration Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2
Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:1
Batch Vitesse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:1
Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:1
PML Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:2
Drafting Triggers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:3
Hull Planar Modelling Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:10
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:10
Registering trigger functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:10
Utility Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:12
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:12
Drafting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1
Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:2
Drawing Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:2
Functions for Modal Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:16
General Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:16
Hatch Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:18
Note and Position Number Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:19
Text Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:21
Symbol Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:24
Functions for Default Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:25
View Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:26
Model Handling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:32
Functions for Creation of Basic Geometric Entities . . . . . . . . . . . . . . . . . . . . . 5:35
Functions for Creation of Texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:37
Functions for Creation of Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:39
Functions for Creation of Drawing Components . . . . . . . . . . . . . . . . . . . . . . . 5:40
Dimensioning Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:40
Hatch Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:44
Note and Position Number Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:45
Other Drawing Components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:46
Property Changing and Retrieving Functions. . . . . . . . . . . . . . . . . . . . . . . . . . 5:48
Identifying and Capturing Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:54
Deleting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:63
Highlighting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:64
Subpicture and Element Navigation Functions . . . . . . . . . . . . . . . . . . . . . . . . 5:67
Drawing Element Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:68
Element Type Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:72
Subpicture Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:80
Visual Area Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:84
Shading Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:85
Common Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:86
Hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1
Weld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Weld Planning Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
1 Introduction
1.1 General
Vitesse is an easy and productive way to create customised, user developed functional
extensions (Vitesse programs) in an object oriented language enabled with access to the
Product Information Model and Core Modelling functionality. Such a Vitesse program can be
directly executed through a file browser, recent list and customised toolbars and menus, and
can also be connected to events in form of triggers.
Vitesse incorporates the language Python, a general purpose, freely available, interpreted
language which has been integrated to form the programmable environment in which a
Vitesse program is created. The syntax includes all normal features in a programming
language, like branching, loops etc. as well as full support for the object paradigm although
the user also has the full freedom to work in a more traditional function oriented fashion.
Many tasks that earlier have been complicated or even impossible to do can now be
performed with the help of Vitesse. The following examples describe a very limited subset of
what can be performed. Some more are shown in the proceeding sections.
Due to the combination between Product Information Model Data Extraction and access to
modelling functions in Vitesse it is possible to create rule-based constructions which
automatically adjust to the surroundings and where the rules are defined by the customer.
This can dramatically reduce the input that has to be given to the application, and minimise
the error rate, since once the Vitesse program is written it can be executed any number of
times with little or no possibility for human mistakes. This in total has a significant impact on
the time needed for design.
Easier updates of constructions can be performed, either by rerunning the original Vitesse
program, or, in the Hull case, by executing a Vitesse program that automatically reruns
schemes, instead of activating, running and storing a number of hull schemes manually.
This reduces the time needed for changes.
Customised drawings can be automatically created based on model data and existing
drawings can be processed for a multitude of purposes. One example could be visualisation
of selected Product Information Model features, by changing display features in a drawing
depending on the state of the underlying Product Information Model item. This can efficiently
show e.g. the progress of a design, or group models with common features for easy
identification.
Interactive creation of lists. With easy access to the product model it is straightforward to
create various types of customised listings or extractions, optionally in combination with
interactive identification of parts included.
1.2 Installation
The installation procedure properly sets up the necessary environment to run Vitesse. The
distribution includes the following files, which are placed in different directories below the
installation root directory pointed out by SB_SYSTEM.
• Run-time Python libraries
• Vitesse Library files and Python classes
• Example files
• Standard Vitesse triggers
The run-time Python libraries delivered are of version 2.4.2. These libraries only represent a
necessary subset of a full Python installation. If the Vitesse development environment 2.4).
The Windows system environment variable PYTHONPATH is used by Python to find
modules for the import command. This is automatically set up for directories required by
AVEVA Marine during installation and any previous value will be overwritten. This means
that user directories must be added to PYTHONPATH after installation.
Note: Please also note that installation of other software packages might modify
PYTHONPATH and cause Vitesse to malfunction.
The main directory for Vitesse is located directly below the installation root directory. The
Environment Variable SB_PYTHON is set up to point to this directory. This is also the
default directory used when running Vitesse scripts through the file browser in various
programs.
There is also a variable that defines the location of trigger scripts, SBB_TRIGDIR. This is
used by Standard Vitesse Triggers, and should normally not be modified. For more
information about triggers, see Triggers.
The Vitesse toolbar can be accessed from the View-Toolbars menu in Hull Design and
Marine Drafting.
It is also possible to issue debug messages from a Vitesse script which will be displayed in
the log window. This can be done by using the kcs_ui.message_debug() function.
The Vitesse Options Dialog is available from the Tools / Vitesse / Options menu item. The
following settings and options are available:
1. Editor. Here it is possible to set up the editor used when clicking on the "edit" button in
the toolbar.
• “Notepad” is the default editor
• “File association” will use the editor connected to the .py file extension in Windows.
• “Custom” will enable entering of your own editor of choice, e.g. Pythonwin
2. Logging options. Here it is possible to control when and where the log messages
should be presented. See also Vitesse Log Window.
3. Other.
• “Debug script name” can be used to set up the name of a Python script to be
executed when the debug toolbar button is clicked. It is supposed that this script will
start a debugger of your choice. See also Vitesse Menu and Toolbar.
• "Number of recent scripts" controls the number of scripts that will be displayed in
the recent list in the toolbar. Please note that you will need to restart the program
before this setting will be applied.
Note: All logging of script executions can affect the performance of the application
negatively and give a longer response time. This is especially valid for the “Logging
to log file” option, which should only be used when necessary. Note that also Python
“print” statements can lower the performance significantly.
3 Utilities
3.1.1 General
There is a possibility to run Vitesse scripts in batch mode. This is made possible through a
set of command line arguments for Drafting based programs in combination with a function
to exit the running program. This enables Vitesse scripts to be run in batch without user
interaction from any scripting or program language capable of starting an executable
program. Below is an example of how this can be done from a DOS BAT file:
Example:
At the end of the Vitesse script, there should be a call to the exit_program() function. This
will instruct the program to end execution, and control will be transferred to the calling script
or executable. In the example above the “echo” statement will be performed.
3.2 Triggers
3.2.1 General
Triggers are connected to events in the system that activates Python scripts. Each trigger is
a Python file having a predefined name. Further down in this documentation there is a list of
all events and their corresponding trigger name. The Environment Variable SBB_TRIGDIR
should be set up to point to the directory where the trigger are located. In a default
installation, this variable points to the /Vitesse/Trigger directory below the
installation root directory.
Note: The SBB_TRIGDIR and the some of the triggers are used by standard functionality.
User additions can be done to these trigger files, but the existing implementation
should be left intact for the standard functionality to work properly. See
documentation for each trigger for further information. Please also note that in order
to minimise migration work in connection with installation of new releases, user
added functionality in the trigger file should only include a call to another module.
Then the actual implementation of the trigger functionality should be in the other
module. This will make it easy to just introduce the user function call into a new
release of the trigger.
The trigger file should include two functions, pre() and post(). The pre() function is called
before the event is performed, and the post() function is called after the event.
Triggers are implemented in such a way that only interactive events will result in a trigger
call. For example, the interactive File-Open will initiate a call to the trig_draft_dwg_new
trigger, while using the kcs_draft.dwg_new() Vitesse function will not activate any trigger. If
the processing of the Interactive Event fails or is interrupted by the user, the Post Trigger will
never be called.
For trigger functions that should return values other than the result, a list should be used.
The first element of the list should be the trigger result.
Example:
# trig_draft_insert_model_filter.py
import kcs_att
import kcs_util
import KcsModel
def pre(*args):
list = []
for i in range(len(args[0])):
att = kcs_att.attribute_get_first(args[0][i])
if att != None:
list.append(args[0][i])
result = []
result.append(kcs_util.trigger_ok())
result.append(list)
return result
There is a possibility for a trigger to control the execution of the event by means of a number
of predefined return codes. These codes can be obtained using the kcs_util.trigger*
functions. If an unknown return code is issued or if the Python interpretation fails for a Pre-
trigger, the event will be interrupted.
file (containing both pre and post functions) is replaced by two PML function files
trigdraftinitpre.pmlfnc and trigdraftinitpost.pmlfnc. The PML
triggers should be located somewhere in the PMLLIB directory structure as for any other
ordinary PML function. As for Vitesse triggers, PML triggers should return, ok, abort or
override explicitly given as a string (se example below). The presence of a PML trigger
overrules the corresponding Vitesse trigger which becomes obsolete and not considered for
execution. A Vitesse trigger is considered for execution only if a corresponding PML trigger
is not found. When developing PML triggers, ensure the pml.index file (in PMLLIB) is
updated as expected by the pml rehash command followed by restart of the relevant
application module. Vitesse triggers with arguments of another type than the basic data
types (string, integer, real) are not possible to replace by a PML trigger. E.g. the Vitesse
trigger trig_draft_property_edit has an argument of the type Model and the system will
thereby not make any attempts to find a corresponding PML trigger.
Name: trig_draft_dwg_verify
Input Parameters: None
Allowed return values: Standard for Pre-Trigger
Override functionality: If kcs_util.trigger_override() is returned, no
part of the standard input model function will not be
performed.
Note: This trigger fires before user will be indicated to select
geometry.
3.2.5 Examples
The example file kcs_ex_trig01.py contains a generic trigger example that can be used to
verify the operation of a trigger. To enable this onto a certain trigger, please copy the file to
the name of the trigger, e.g. trig_draft_dwg_new.py. Using this sample, it is possible to see
input arguments and specify return values and result codes in an easy and interactive way.
Note: The trigger example files are located under the \Vitesse\Trigger directory
below the installation root directory. The reason that they are not in the
\Vitesse\Examples directory together with the rest of the example files is that
the SBB_TRIGDIR variable by default points to the \Vitesse\Trigger
directory. This makes it easy to enable the trigger samples by just copying or
changing the name of the file in its current location.
name that is defined by the user. It is recommended to register all the triggers at user
application startup and unregister them before the application is terminated.
The system provides three functions in kcs_util module for supporting dynamic triggers. See
detailed description and example below
get_registered_triggers ()
This function returns registered triggers as a dictionary.
Input Parameters:
None.
Returned value:
Example:
Module: Triggers.py
import kcs_util
def OpenDrawingPreTrigger():
# user code
3.3.1 General
The functions are made available in the Python program by the insertion of the statement
import kcs_util. The functions are then referred to as kcs_util.<function name>. Before
using a new function, please carefully read the function description.
The Vitesse Utility interface contains functions for:
• Comparing with the user response from Vitesse UI functions.
• Return codes from trigger functions.
• Checking which application is currently running.
• Accessing environment variables
• General purpose, such as coordinate translations etc.
Example:
import kcs_util
env = 'SB_PYTHON'
try:
cur_value = kcs_util.TB_environment_get(env)
except:
print kcs_util.error
ok()
The function returns a value that is equal to user response OK.
Input parameters:
None
Result:
[0] integer The value of OK
Exceptions:
None
cancel()
The function returns a value that is equal to user response CANCEL.
Input parameters:
None
Result:
[0] integer The value of CANCEL
Exceptions:
None
quit()
The function returns a value that is equal to user response QUIT.
Input parameters:
None
Result:
[0] integer The value of QUIT
Exceptions:
None
options()
The function returns a value that is equal to user response OPTIONS.
Input parameters:
None
Result:
[0] integer The value of OPTIONS
Exceptions:
None
operation_complete()
The function returns a value that is equal to user response OPERATION COMPLETE.
Input parameters:
None
Result:
[0] integer The value of OPERATION COMPLETE
Exceptions:
None
yes()
The function returns a value that is equal to user response YES.
Input parameters:
None
Result:
[0] integer The value of YES
Exceptions:
None
no()
The function returns a value that is equal to user response NO.
Input parameters:
None
Result:
all()
The function returns a value that is equal to user response ALL.
Input parameters:
None
Result:
[0] integer The value of ALL
Exceptions:
None
undo()
The function returns a value that is equal to user response UNDO.
Input parameters:
None
Result:
[0] integer The value of UNDO
Exceptions:
None
reject()
The function returns a value that is equal to user response REJECT.
Note: that REJECT is equal to CANCEL.
Input parameters:
None
Result:
[0] integer The value of REJECT
Exceptions:
None
exit_function()
The function returns a value that is equal to user response EXIT_FUNCTION.
Note: that EXIT_FUNCTION is equal to QUIT.
Input parameters:
None
Result:
[0] integer The value of EXIT_FUNCTION
Exceptions:
None
Example:
# Example: kcs_ex_util2.py
trigger_abort()
Return this function from a trigger to abort the function that fired the trigger.
Input parameters:
None
Returned value:
[0] integer The value of abort
Exceptions:
None
trigger_ok()
Return this function from a trigger to continue the function that fired the trigger.
Input parameters:
None
Returned value:
[0] integer The value of ok
Exceptions:
None
trigger_override()
Return this function from a trigger to override the function that fired the trigger.
Input parameters:
None
Returned value:
[0] integer The value of override
Exceptions:
None
Example:
# Example: kcs_ex_util3.py
TB_environment_get(Env)
The function gets the value of an environment variable.
Input parameters:
Env string The name of the environment variable
Returned value:
[0] string The value of the variable
Exceptions:
kcs_TranslateError No translation could be done
TB_environment_set(Env, Value)
The function sets a environment variable.
Note: The variable is changed only in the current process. Variables that set databank
paths will not take effect.
Input parameters:
Env string The name of the environment variable
Value string The new value of the environment variable
Returned value:
None
Exceptions:
None
coord_to_pos(Axis, Coord)
Express a co-ordinate as a main axis position (FR or LP term).
Input parameters:
Axis short integer Main axis:
1 = X (FR term)
2 = Y (horizontal LP term)
3 = Z (vertical LP term)
Coord real The co-ordinate to be translated
Returned value:
[0] integer Result:
0 = success,
otherwise failure
[1] short integer FR or LP number
[2] real offset from the FR or LP number
Exceptions:
None
pos_to_coord(Axis, No)
Translate a FR or LP position to a co-ordinate.
Input parameters:
Axis short integer Main axis:
1 = X (FR term)
2 = Y (horizontal LP term)
3 = Z (vertical LP term)
No short integer The FR or LP number
Returned value:
[0] integer Result:
0 = success,
otherwise failure
[1] real the translated co-ordinate
Exceptions:
None
exit_program()
The function terminates the program.
Note: The program is not terminated until the Python script is finished
clean_workspace()
The function cleans the workspace of all objects not reserved by the current application.
Input parameters:
None
Returned value:
[] None
Exceptions:
kcs_Error
Returned values:
[0] Integer Response
[1] JobId The resulting job id.
Exceptions:
kcs_ArgumentError Invalid parameter value
kcs_ValueError Could not execute specified application
save work()
The function performs savework.
Input Parameters:
None
Output parameters:
Returned value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:
get work()
The function performs getwork.
Input Parameters:
None
Output Parameters:
Returned value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:
quit_work()
The function performs quitwork.
Input Parameters:
Output Parameters:
Returned Value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:
unclaim_all()
The function performs unclaim all.
Input Parameters:
Output Parameters:
Returned Value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:
run_pdms_command(cmd)
The runs a pdms command.
Input Parameters:
cmd string The command to execute
Output Parameters:
Returned value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:
kcs_ArgumentError Invalid parameter value
3.4 UI Interface
3.4.1 General
The functions are made available in the Python program by the insertion of the statement
import kcs_ui. The functions are then referred to as kcs_ui.<function name>. Before using
a new function, please carefully read the function description.
The Vitesse UI Interface supports the following simple User Interface functions:
• Perform interactive indication in the graphical display of the application
• Pop up dialogue boxes in the same way as the application itself uses.
• Application window maximize, minimize, refresh display etc.
The returned value "User Response" in the functions should be checked against a proper
function in the Utility interface. Normally, the User Response kcs_util.ok() is returned when
the user has completed the input, while other responses like kcs_util.cancel(),
kcs_util.quit() gives the specific user interruption.
Note: that the User Response kcs_util.ok() should not be checked against the function
answer_req.
In the general Python programming environment there are also more advanced tools for
User Interface available. One example of such a tool is wxPython which can be
downloaded from www.wxpython.org
The default error is kcs_Error. Note that the kcs_Error exception is a general exception and
will not be further described below.
Example:
import kcs_ui
msg = 'Please give a position'
coord = KcsPoint2D.Point2D()
try:
res = kcs_ui.point2D_req(msg,coord)
except:
print kcs_ui.error
3.4.3 Classes
Some of the functions in the Vitesse UI interface use objects as input. These objects are
instances of Python classes. The classes used in this interface are described in section
General.
int_req(Message, InitValue)
The function presents a box with a message and lets the user key in an integer.
Input parameters:
Message string The message (max 512 characters)
InitValue integer The predefined value (optional)
Returned value:
[0] integer User Response
[1] integer The resulting integer
Exceptions:
kcs_ValueError Invalid parameter value
real_req(Message, InitValue)
The function presents a box with a message and lets the user key in a real.
Input parameters:
Message string The message (max 512 characters)
InitValue real The predefined value (optional)
Returned value:
[0] integer User Response
[1] real The resulting real
Exceptions:
kcs_ValueError Invalid parameter value
string_req(Message, InitValue)
The function presents a box with a message and lets the user key in a string.
Input parameters:
Message string The message (max 512 characters)
InitValue string The predefined value (optional, max 512
characters)
Returned value:
[0] integer User Response
[1] string The resulting string (max 512 characters)
Exceptions:
kcs_ValueError Invalid parameter value
Example:
# Example: kcs_ex_ui5.py
Returned value:
[0] integer User response
[1] Point2D The resulting 2D point
Exceptions:
kcs_ValueError Invalid parameter value
kcs_DrawingNotCurrent No drawing was current
Example:
# Example: kcs_ex_ui1.py
answer_req(Title, Question)
The function presents a box with a question and lets the user give the answer.
Input parameters:
Title string The title of the box (max 132 characters)
string The question (max 512 characters)
Question
Returned value:
[0] integer User Response
Exceptions:
kcs_ValueError Invalid parameter value
message_confirm(Message)
The function presents a box with a message and lets the user confirm it.
Input parameters:
Message string The message to the user (max 512
characters)
Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value
message_noconfirm(Message)
The function presents a message to the user without confirmation.
Input parameters
Message string The message to the user (max 512
characters)
Returned value
None
Exceptions
kcs_ValueError Invalid parameter value
Example:
# Example: kcs_ex_ui2.py
colour_select(Title, Colour)
The function presents a colour box and lets the user select a colour.
Input parameters:
Title string The title of the box (max 132 characters)
Output parameters:
Colour Colour The selected colour
Returned value:
[0] integer User response
[1] integer The selected colour
Exceptions:
kcs_ValueError Invalid parameter value
symbol_select(Prompt, Font)
The function lets the user select a symbol from a menu of all symbols in a given font.
Input parameters:
Prompt string The prompt (max 512 characters)
Font integer The symbol font
Returned value
[0] integer User response
:[1] integer The selected symbol within given font
Exceptions:
kcs_ValueError Invalid parameter value
kcs_FontInvalid The symbol font was not found
kcs_FontEmpty There are no symbols in the symbol font
symbol_select(Prompt, SymbList)
The function lets the user select a symbol from a menu of all symbols in a given list. This
list may contain symbols from any existing symbol font. Non-existing symbols in the list
will appear as blanks entries in the menu, thus alerting the user of incorrect input values.
Input parameters:
Prompt string The prompt (max 512 characters)
SymbList Symbollist The symbol font
Returned value:
[0] integer User response
[1] integer The font containing the selected symbol
[2] integer The selected symbol within that font
Exceptions:
kcs_ValueError Invalid parameter value
Example:
# Example: kcs_ex_ui3.py
# Example: kcs_ex_ui4.py
model_info()
The function displays information about user-indicated models. The function interacts with
the user.
Input parameters:
None
Returned value:
[0] integer User Response
Exceptions:
None
app_window_minimize ()
The function minimizes application window.
Input parameters:
None.
Returned value:
None.
Exceptions:
None.
app_window_maximize ()
The function maximizes application window.
Input parameters:
None.
Returned value:
None.
Exceptions:
None.
app_window_restore ()
The function restores application window to its original size..
Input parameters:
None.
Returned value:
None.
Exceptions:
None.
app_window_refresh()
This function is used to make output to the application window immediately visible.
Normally, the user should not bother about this: such "refreshing" is done automatically
whenever the application stops and waits for user input. However, when the user
interaction is (temporarily or permanently) handled by tools outside the Vitesse UI
interface (e.g. when using a wxPython script) this function might be necessary to refresh
the application window.
Input parameters:
None.
Output parameters:
None.
Returned value
None.
Exceptions:
None.
3.5.1 General
The functions are made available in the Python program by the insertion of the statement
import kcs_dex. The functions are then referred to as kcs_dex.<function name>. Before
using a new function, please carefully read the function description.
3.5.2 Functions
These functions deal with data extraction. All data possible to extract in User's Guide Data
Extraction are available here as well.
This gives the ability to handle rules in Vitesse programs, since the surroundings of a
construction can be investigated. It also gives the possibility to produce all kinds of listings,
containing data from databases.
extract(dexstring)
Perform data extraction.
Input parameters:
dexstring string string containing a valid data extraction
statement. Please consult the User's Guide
Data Extraction.
Returned value:
[0] integer Result:
0 = success
otherwise failure
next_result()
Activate the next result of a previously made data extraction.
Returned value:
[0] integer indicates the type of the result value
= 0 empty tree part.
= 1 integer type result
= 2 real value type result.
= 3 string type result.
= 4 real vector 3D type result
get_commandstring()
Get the data extraction command string for current result.
Returned value:
[0] string the command string
get_int()
Get current integer value.
Returned value:
[0] integer the integer value
get_real()
Get current real value.
Returned value:
[0] real the real value
get_string()
Get current string value.
Returned value:
[0] string the string value
get_reavec3d()
Get current real vector 3D
Returned value:
[0] real x value
[1] real y value
[2] real z value
get_box()
Get current box
Returned value:
[0] real x min
[1] real y min
[2] real z min
[3] real x max
[4] real y max
[5] real z max
get_reavec2d()
Get current real vector 2D
Returned value:
[0] real x value
[1] real y value
get_indexedreal(index)
Get value from current real vector nD.
Input parameters:
index integer index of wanted real
Returned value:
[0] real the real value
3.5.3 Examples
This example shows how to calculate the total weight of a hull block, and then just print out
the sum.
Example:
import kcs_ui
import kcs_util 1
import kcs_dex
total_weight = 0.0 2
block = kcs_ui.string_req('Key in name of block') 3
if block[0] == kcs_util.ok():
string = "HULL.BLOCK('" + block[1]\
+"').PANEL(*).WEIGHT" 4
kcs_dex.extract(string) 5
type = kcs_dex.next_result() 6
while type >= 0: 7
if type == 2:
total_weight = total_weight\
+kcs_dex.get_real() 8
type = kcs_dex.next_result()
print"Total weight for block " + block[1] + \
" is: " + `total_weight` + " tons" 9
4 Python Classes
4.1 General
This section describes the General Python classes used in the different Vitesse interfaces.
Class methods may be changed or added by the programmer. However, the class attributes
may NOT be changed. To use the classes, add 'import Kcs<classname>' in the Vitesse
program. The class attributes can be updated by using dot-notation (although methods exist
for this purpose).
4.2 Geometry
These python classes handles different kinds of geometry.
Class KcsPoint2D.Point2D
The class holds information about a 2D point. It is the basic class for Vitesse 2D
operations.
Parameters and attributes:
X real x-coordinate of the point
Y real y-coordinate of the point
Constructor:
Point2D (<x>, This constructor will create instance of Point2D class. Parameters
<y>) are defined as above, default values are zeros.
Methods:
DistanceToPoint(p real Calculates straight line distance between point
) and second point given as parameter.
p Point2D Point to get distance to
Move (xmove, Translates the point by given values
ymove)
xmove real Change in x-coordinate
ymove real Change in y-coordinate
Round (decimals) Rounds coordinate values to a given number of
decimals.
Example:
p = Point2D(103.67,203.73)
p.Round(1)
print p # [X Y:103.7,203.7]
Example:
point = KcsPoint2D.Point2D(10.0,0.0)
Class KcsVector2D.Vector2D(X,Y)
The class holds information about a 2D vector.
Parameters and attributes:
X real x-coordinate of the vector
Y real y-coordinate of the vector
Methods:
SetFromVector
SetLength
SetFromPoints
BlankProduct
CompareVector
SetFromVectorDifference
DotProduct
SetComponents
Length
LargestComponentAxis
Rotate
Round
ScalarComponentOnVector
SetFromVectorSum
SetToUnitVector
Example:
vec = KcsVector2D.Vector2D(1.0,0.0)
Class KcsRline2D.Rline2D(Start,End)
The class holds information about a restricted 2D line.
Parameters and attributes:
Start Point2D Start point of the line
End Point2D End point of the line
Methods:
None
Examples:
sp = KcsPoint2D.Point2D(0.0,0.0)
ep = KcsPoint2D.Point2D(100.0,100.0)
line = KcsRline2D.Rline2D(sp,ep)
Class KcsRectangle2D.Rectangle2D(Corner1,Corner2)
The class holds information about a 2D axis-parallel rectangle.
NB: The rectangle is defined by two opposite corners.
Parameters and attributes:
Corner1 Point2D First corner of the rectangle
Corner2 Point2D Second corner of the rectangle
Methods:
None
Examples:
c1 = KcsPoint2D.Point2D(0.0,0.0)
c2 = KcsPoint2D.Point2D(100.0,100.0)
rectangle = KcsRectangle2D.Rectangle2D(c1,c2)
Class KcsArc2D.Arc2D
The class holds information about a 2D arc segment. It is used in many Vitesse classes
and functions i.e. arc_new, arc_highlight and dim_diameter_new in module kcs_draft.
Parameters and attributes:
Start Point2D Start point of the arc segment
End Point2D End point of the arc segment
Amplitude real Amplitude of the arc segment
Constructor:
Arc2D (start, This constructor will create instance of Arc2D class. Parameters are
end, amplitude) defined as above.
Methods:
None
Class protocols:
__repr__ Used to return string representation of Arc2D object.
Examples:
sp = KcsPoint2D.Point2D(0.0,0.0)
ep = KcsPoint2D.Point2D(100.0,100.0)
ampl = 30.0
arc = KcsArc2D.Arc2D(sp,ep,ampl)
arc.Amplitude = 40
Class KcsCircle2D.Circle2D
The class holds information about a 2D circle. It is used in Vitesse kcs_draft module
functions i.e. dim_diameter_new, circle_new or circle_highlight.
Parameters and attributes:
Centre Point2D Centre of the circle
Radius real Radius of the circle
Constructor:
Circle2D (centre, This constructor will create instance of Circle2D class. Parameters
radius) are defined as above.
Methods:
HasPoint (point) integer Checks whether given point is inside the circle:
1 – point is inside the circle
0 – point is outside the circle or it is on the circle
point Point2D Point to test.
IsPointOnCircle integer Checks whether given point is on the circle:
(point) 1 – point is on the circle
0 – point is inside or outside the circle
point Point2D Point to test
GetTangentPoints Point2D No optional parameters given:
(tngPnt1, or
Method gets possible tangent points. Each of two
<tngPnt2>, <cle>) [ Point2D,
returned tangent points on the circle and a point
Point2D ]
tngPnt1 outside the circle defines tangent to the
circle. If tngPnt1 is on the circle, method returns
only one point equal to tngPoint1.
Optional parameters given:
Method returns one tangent point of the master
circle and one tangent point of circle <cle>, both
lying on one common tangent of two circles.
Points tngPnt1 and tngPnt2 define which variant
of tangential line is considered (resulting points
are possibly closest to given).
tngPnt1 Point2D A point outside the circle essential for main circle
tangent point(s) calculation
<tngPnt2> Point2D An approximate tangent point to circle <cle> for
common tangent calculation.
<cle> Circle2D Second circle for common tangent calculation
Examples:
cp = KcsPoint2D.Point2D(100.0,100.0)
rad = 50.0
circle = KcsCircle2D.Circle2D(cp,rad)
Class KcsEllipse2D.Ellipse2D(Corner1,Corner2)
The class holds information about a 2D ellipse circumscribed by a rectangle.
NB: The circumscribing rectangle is defined by two opposite corners.
Parameters and attributes:
Corner1 Point2D First corner of the circumscribing rectangle
Corner2 Point2D Second corner of the circumscribing rectangle
Methods:
Examples:
c1 = KcsPoint2D.Point2D(100.0,100.0)
c2 = KcsPoint2D.Point2D(400.0,400.0)
ellipse = KcsEllipse2D.Ellipse2D(c1,c2)
Class KcsPolygon2D.Polygon2D
The class holds information about a 2D polygon. Polygon is represented as a list of
points. Polygons are used in Vitesse functions i.e. note_new() in module kcs_draft.
Parameters and attributes:
Polygon [ Point2D ] List of polygon points. Access to list is possible
also by class protocols __len__, __getitem__ and
__setitem__
Constructor:
Polygon2D(<startp>) This constructor will create instance of Point2D
class. If startp is not None, it initiates the list of
polygon points in Polygon attribute.
<startp> Point2D Start point of the polygon. None by default
Methods:
AddPoint(nextp) Adds a point at the end of the polygon
nextp Point2D The next point of the polygon
Class protocols:
__repr__ Used to return string representation of Polygon2D object
Examples:
sp = KcsPoint2D.Point2D(100.0,50.0)
polygon = KcsPolygon2D.Polygon2D(sp)
sp.X = 30.0
sp.Y = 120.0
polygon.AddPoint(sp)
sp.Y = 400.0
polygon.Addpoint(sp)
point = polygon[1]
Class KcsContour2D.Contour2D
The class holds information about contour. It is used in Vitesse functions, i.e.
contour_properties_get and hatch_new in module kcs_draft or pan_curve_create in
module kcs_hull.
Parameters and attributes:
Contour [segment] List of contour segments. Each segment is a list of
one or two arguments. The syntax is
[startPoint, <amplitude>] where:
startPoint - Point2D at the end of the segment
amplitude - amplitude at the midpoint of segment
(if 0 or none then segment is a straight line)
First segment always consists of one point only.
The point is a start point of contour.
Visible integer Visibility:
1 : contour is visible
0 : contour is not visible.
Detectable integer Detect ability:
1 : contour is detectable
0 : contour is not detectable.
Colour Colour Colour of contour
LineType LineType Line type of contour. Line type must be defined in
system.
Layer Layer Layer of contour
Constructor:
Contour2D (startp) This constructor will create an instance of
Contour2D class
startp Point2D Start point of the contour
Methods:
AddLine (point) Add a line (straight) segment to the contour
Class KcsConic2D.Conic2D
The class holds information about a 2D conic segment. It is used in Vitesse kcs_draft
module functions, i.e. conic_new or conic_highlight
Parameters and attributes:
Start Point2D The start point
Examples:
sp = KcsPoint2D.Point2D(100.0,100.0)
ep = KcsPoint2D.Point2D(300.0,300.0)
amp = KcsVector2D.Vector2D(1.0,2.0)
cff = 0.1
con = KcsConic2D.Conic2D(sp,ep,amp,cff)
Class KcsPoint3D.Point3D
The class holds information about a 3D point. It is the basic class for Vitesse 3D
operations.
Parameters and attributes:
X real x-coordinate of the point
Y real y-coordinate of the point
Z real z-coordinate of the point
Constructor:
Point3D (<x>, This constructor will create instance of Point3D class. Parameters
<y>, <z>) are defined as above, default values are zeros.
Methods:
DistanceToPoint(p real Calculates straight line distance between point
) and second point given as parameter
p Point3D Point to get distance to
Round (decimals) Rounds coordinate values to a given number of
decimals.
Example:
p = Point3D(103.67,203.73, 300)
p.Round(1)
print p # [X Y:103.7,203.7, 300.0]
decimals integer Number of decimals to round to
SetFromPoint (p) Set point as a copy of other point
Example:
point = KcsPoint3D.Point3D(0.0,0.0,0.0)
Class KcsVector3D.Vector3D
The class holds information about vector 3D.
Attributes:
X Float X-coordinate
Y Float Y-coordinate
Z Float Z-coordinate
Methods:
Class constructor: This constructor will create instance of Vector3D
class.
Vector3D(<x>, <y>, <z>) Coordinates are optional. Default value for all
coordinates is:
-32000
AngleToVector(v1) Returns angle (in radians) between self and
another vector 3D v1.
AngleToVectorWithSign(v1) Returns angle (in radians) between self and
another vector 3D v1 with sign.
BlankProduct (scale) Scale the vector length by scale value.
BoxProduct (v1, v2) Calculates the box product between self and other
two vectors v1 and v2.
CompareVector(v1, tol) Compares with another vector v1 and tolerance tol.
DotProduct (v1) Returns scalar product between self and vector v1.
AbsoluteLargestComponentAxis() Returns axis with largest component absolute
value. It returns:
0 for X axis,
1 for Y axis and
2 for Z axis.
Length () Returns length of vector.
Example:
from KcsPoint3D import Point3D
v1 = Point3D(12, 22, 24)
v1[v1.AbsolutLargestComponentAxis()] = 0.0
print v1
Class KcsLine3D.Line3D(Point,Direction)
The class holds information about an unlimited 3D line
Parameters and attributes:
Point Point3D A point on the line
Direction Vector3D A vector along the line
Methods:
ScalarComponentOfVector
VectorComponentOfVector
Transform
Examples:
pnt = KcsPoint3D.Point3D(100.0,100.0,100.0)
dir = KcsVector3D.Vector3D(0.0, 0.0, 1.0)
line = KcsLine3D.Line3D( pnt, dir)
Class KcsPolygon3D.Polygon3D(Start)
The class holds information about a 3D polygon.
Parameters:
Start Point3D Start point of the polygon
Methods:
AddPoint
ClassPolygon3D.GetNoOfPoints()
The function returns number of points in polygon.
ClassPolygon3D.GetPoint()
The function returns Point3D instance of polygon point selected by index (0 based).
Examples:
sp = KcsPoint3D.Point3D(100.0,50.0,0.0)
polygon = KcsPolygon3D.Polygon3D(sp)
sp.X = 30.0
sp.Y = 120.0
polygon.AddPoint(sp)
sp.Y = 400.0
polygon.Addpoint(sp
Class KcsPlane3D.Plane3D)
The class holds information about an unlimited plane. It is used by Vitesse functions i.e
view_slice_planes_get() in module kcs_draft.
Parameters and attributes:
Point Point3D A point on the plane
Normal Vector3D A vector perpendicular to the plane
Constructor:
Plane3D (pnt, This constructor will create instance of Plane3D class. Parameters
norm) are defined as above.
Methods:
IntersectLine integer Intersects the plane with a line. If the intersection
(line, point) is found it returns 0 and sets “point” parameter to
intersection point, otherwise returns –1.
Class protocols:
__repr__ Used to return string representation of Plane3D object.
Examples:
pnt = KcsPoint3D.Point3D(0.0,0.0,0.0)
norm = KcsVector3D.Vector3D(0.0, 1.0, 0.0)
plane = KcsPlane3D.Plane3D( pnt, norm)
Class KcsCircle3D.Circle3D
The class holds information about a 3D circle.
Parameters and attributes:
Centre Point3D Centre of the circle
Normal Vector3D Normal vector to circle plane
Radius real Radius of the circle
Constructor:
Circle3D This constructor will create instance of Circle3D class. Parameters are
(centre, normal, defined as above.
radius)
Class protocols:
__repr__ Used to return string representation of Circle3D object.
Examples
cp = KcsPoint3D.Point3D(100.0,100.0, 50.0)
rad = 50.0
norm = KcsVector3D.Vector3D(0,0,1)
circle = KcsCircle2D.Circle2D(cp,norm,rad)
Class KcsBox.Box
The class holds information about a 3D box. It is used i.e. with classes
KcsAssembly.Assembly, KcsVolPrimitiveBlock.VolPrimitiveBlock or with function
view_symbolic_new in module kcs_draft.
Parameters and attributes:
Origin Point3D Box origin
LengthDir Vector3D Length direction vector
HeightDir Vector3D Height direction vector
Length real Length along ‘LengthDir’ vector
Height real Height along ‘HeightDir’ vector
Width real Width along right normal of “length-height” plane
Constructor:
Box (origin, lengthDir, heightDir, This constructor will create instance of Box class.
length, height, width) Parameters are defined as above.
Methods:
SetAxisParallelBox (lowCorner, It will create axis parallel box. Height direction is
upCorner) or parallel to Y axis and Length direction is parallel to
Z axis.
(x1, y1, z1, x2, y2, z2)
lowCorner Point3d Lower-left (min z) corner of Bo
upCorner Point3d Upper-right (max z) corner of Box
x1, y1, z1, real Corners in coordinate list format (first = lower-left,
x2, y2, z2 second = upper-right)
IsEmpty() integer 1 - Box is empty (three dimensions are equal 0)
0 - Box is not empty
Class protocols:
__repr__ Used to return string representation of Box object.
Examples:
import KcsBox
import KcsPoint3D
import KcsVector3D
origin = KcsPoint3D.Point3D(0,0,0)
lengthDir = KcsVector3D.Vector3D(0,1,2)
heightDir = KcsVector3D.Vector3D(0,2,1)
box = KcsBox.Box(origin, lengthDir, heightDir, 45.7 , 10, 55.5)
Class KcsCap.Cap
The class holds information about a cap. The cap primitive describes a spherical
segments, i.e. a part of a sphere, cut off with plane.
Parameters and attributes:
Origin Point3d Cap origin
Direction Vector3d Cap direction vector
Diameter real Cap diameter
Amplitude real Cap amplitude
Constructor:
Cap (orig, dir, diam, ampl) This constructor will create instance of Cap class.
Parameters are defined as above.
Class protocols:
__repr__ Return string representation of Cap object.
Example:
import KcsCap
import KcsPoint3D
import KcsVector3D
origin = KcsPoint3D.Point3D(4,5,7.8)
direction = KcsVector3D.Vector3D(0,0,1)
cap = KcsCap.Cap(origin, direction, 4, 7.8)
cap.Diameter = 1
Class KcsCone.Cone
The class holds information about a cone. For the cone primitive at least one of the two
defining radii must be greater than zero.
Parameters and attributes:
Origin Point3D Cone origin (centre of first end circle)
Direction Vector3D Cone direction vector
Length real Cone length.
Diameter1 real The diameter of first end circle
Diameter2 real The diameter of second end circle
Constructor:
Cone (orig, dir, len, diam1, This constructor will create instance of Cone class.
<diam2>) Parameters are defined as above, by default
<diam2> is equal to diam1. At least one of the
diameters must be greater then zero.
Class protocols:
__repr__ Return string representation of Cone object.
Example:
origin = KcsPoint3D.Point3D(4,5,7.8)
direction = KcsVector3D.Vector3D(0,0,1)
cone = KcsCone.Cone(origin, direction, 20, 8, 0)
cone.Diameter2 = 1
Class KcsConnection.Connection
The class holds information about a connection.
Parameters and attributes:
Pos Point3D Origin of the connection
Dir Vector3D Direction of the connection
Type integer The type of the connection (1-9)
Number integer The number of the connection (1-199)
Descr string The description of the connection
Constructor:
Connection (pos, dir, type, number, This constructor will create an instance of Connec-
<descr>) tion class. Parameters are defined as above,
description is an empty string by default.
Class protocols:
__repr__ Return string representation of Connection object.
Examples:
pos = KcsPoint3D.Point3D(100.0,100.0, 0.0)
dir = KcsVector3D.Vector3D(1.0,2.0,3.0)
con = KcsConnection.Connection(pos, dir, 1, 50,
‘description’)
Class KcsDate.Date
The class holds information about date
Parameters and attributes:
_Year integer Year
_MonthY integer Month
_Day integer Day
Methods:
Class constructor: This constructor will create instance of Date class.
Date(<integer year>, <integer
month>, <integer day>)
__cmp__ Used to compare two Date objects.
__rpr__ Used to return string representation of Date object.
SetDate(year, month, day) Sets date.
SetDate(Date)
GetDate() Returns date as tuple containing three integers:
(year, month, day)
Example:
import KcsDate
a = KcsDate.Date(2001, 10, 10)
print a
a.SetDate(2000, 10, 11)
print '%04i %02i %02i' %.GetDate()
see also:
# Example: kcs_ex_ass01.py
# Example: kcs_ex_db01.py
Class KcsTime.Time
The class holds information about time. It is used with other Vitesse classes.
Parameters and attributes:
Hour integer Hour part
Minute integer Minute part
Second integer Second part
Hundredths integer Hundredth of second
Constructor:
Time(<hour>,<min>,<sec>,<hund>) This constructor will create instance of Time
class. Parameters are defined as above. Default
values are 0.
Methods:
SetTime (hour, min, sec, hund) Sets time from four parts. Parameters are defined
as above.
SetTime (time) Sets time from another Time instance.
time Time Time object to copy
GetTime () (integer, Returns time as tuple:
integer, integer,
(hour, minute, second, hundredths)
integer)
Class protocols:
__cmp__ Used to compare two Time objects.
__repr__ Used to return string representation of Time object.
Example:
import KcsTime
a = KcsTime.Time(05, 10, 10, 00)
print a
a.SetTime(05, 10, 11, 00)
print '%02i:%02i:%02i.%02i' %GetTime()
see also:
# Example: kcs_ex_db01.py
Class KcsDateTime.DateTime
The class holds information about date and time. This class inherits from Date and Time
classes.
Parameters and attributes:
None.
Methods:
Examples:
import KcsDateTime
a = KcsDateTime.DateTime(2001, 10, 19, 05, 10, 10, 00)
print a
see also:
# Example: kcs_ex_db01.py
Class KcsButtonState.ButtonState
The class holds information about buttons states during interactive operations. It is used
in interactive functions call i.e. point2D_req in module kcs_ui.
Parameters and attributes:
LockEnabled integer Lock buttons state:
0 - disabled,
1 - enabled
OptionsEnabled integer Options button state:
0 - disabled
1 - enabled
LockChecked string State of lock buttons:
None - no lock button checked
‘U’ - U lock checked
‘V’ - V lock checked
Constructor:
ButtonState() This constructor will create instance of ButtonState class. By
default all buttons are disabled/unchecked.
Class protocols:
Example:
import KcsButtonState
import KcsPoint2D
import kcs_ui
point = KcsPoint2D.Point2D()
buttons = KcsButtonState.ButtonState()
buttons.LockEnabled = 1
buttons.OptionsEnabled = 1
buttons.LockChecked = 'U'
kcs_ui.point2D_req('Select 2D point', point, buttons)
Class KcsCursorType.CursorType
The class holds information about cursor type used in kcs_ui.point2D_req function
Parameters and attributes:
__nType integer Type of cursor. This variable should not be
accessed directly.
__Arguments list Additional information for specified cursor type.
This variable should not be accessed directly.
Methods:
SetCrossHairs() This function will set cursor type to CrossHair
cursor.
SetRubberBand(point) This function will set cursor type to RubberBand
cursor. Point specifies first point position.
SetRubberRectangle(point) This function will set cursor type to
RubberRectangle. Point specifies first corner
position.
SetRubberCircle(point) This function will set cursor type to
RubberCircle. Point will specify centre of circle.
GetCursorType() This function will return current cursor type. It
can be:
• 'CrossHair'
• 'RubberBand'
• 'RubberRectangle'
• 'RubberCircle'
SetDragCursor(highlight, point) This function will set cursor type to DragCursor.
• highlight
Instance of HighlightSet class containing
drag cursor definition
• point
Point specifying cursor position.
Example:
center = KcsPoint2D.Point2D(0, 0)
Cursor = KcsCursorType.CursorType()
Cursor.SetRubberCircle(point)
print Cursor.GetCursorType()
Class KcsHighlightSet.HighlightSet
The class holds information defining drag cursor.
Parameters and attributes:
__Elements list List of elements defining highlight set.
Methods:
AddGeometry2D( Adds graphical 2D element to highlight set.
element, • element
<linetype>)
instance of following classes: Arc2D,
Contour2D, Point2D, Rrectangle2D
• linetype (KcsLinetype.Linetype )
optional parameter defining type of line
used to draw the element
AddGeometry3D( Adds graphical 2D element to highlight set.
element, • element
<handle>,
instance of following classes: Point3D,
<linetype>) Polygon3D
• handle
(KcsElementHandle.ElementHandle)
Handle to view in which element is drawn. If
no handle given, element is drawn in all
model views.
• linetype (KcsLinetype.Linetype )
optional parameter defining type of line
used to draw the element
AddModel( model ) Adds model to highlight set.
• model (KcsModel.Model)
model information
AddSubpicture( handle ) Adds subpicture to highlight set.
• handle (KcsElementHandle)
handle to view, subview or component
Reset() Removes all elements from highlight set.
Example:
highlight = KcsHighlightSet.HighlightSet()
cursor = KcsCursorType.CursorType()
highlight.AddSubpicture( handle )
cursor.SetDragCursor( highlight, refpoint )
see also:
# Example: kcs_ex_ui1.py
Class KcsStat_point2D_req.Stat_point2D_req
The class holds information about point2D selection method.
Parameters and attributes:
__CursorType iCursorType Type of cursor. This variable should not be
accessed directly.
__Point2dDefMode integer Point definition mode. This variable should not
be accessed directly.
__HelpPoint Point2D Help point for ModeOffsetCurrent definition
mode.
This attribute is optional.
__Scale Real Scale
Methods:
SetDefMode(mode) This function will set definition mode. Argument
mode is a string that specifies point definition
mode:
• 'ModeKeyIn'
• 'ModeCursor'
• 'ModeNode'
• 'ModeExist'
• 'ModeSymbConnection'
• 'ModeAuto'
• 'ModeArcAtAngle'
• 'ModeArcCentre'
• 'ModeDistanceAlong'
• 'ModeMidPoint'
• 'ModeIntersect'
• 'ModeOffsetCurrent'
• 'ModeNearest'
• 'ModeCOG'
• 'ModeEvent'
These names are defined in
KcsStat_point2D_req.Point2dDefModes
dictionary.
Example:
CursorType = KcsCursorType.CursorType()
CursorType.SetRubberCircle(KcsPoint2D.Point2D(100, 100))
Status = KcsStat_point2D_req.Stat_point2D_req()
Status.SetCursorType(CursorType)
Status. SetDefMode('ModeOffsetCurrent')
Status.SetHelpPoint(KcsPoint2D.Point2D(0, 0))
point = KcsPoint2D.Point2D();
kcs_ui.point2D_req('Select point', point, Status)
print Status.GetDefMode()
4.5 Miscellaneous
These python classes are of miscellaneous types.
Class KcsTransformation3D.Transformation3D()
The class holds information about a 3D transformation matrix
Attributes:
Type integer Type of transformation matrix:
= 0 Unknown type of matrix
= 1 Matrix does not contain general scaling or
projection
= 2 Matrix contains general scaling
= 3 Matrix contains projection
element(1,1) in the matrix
Matrix11 real
.
.
Matrix44 real element(4,4) in the matrix
Methods:
SetFromTransformation
Combine
GetByRow
SetByRow
SetFromPointAndTwoVectors
SetFromPointAndThreeVectors
Invert
ReflectX
ReflectY
ReflectZ
Rotate
Translate
Examples:
orig = KcsPoint3D.Point3D(0.0,0.0,0.0)
Uvec = KcsVector3D.Vector3D(1.0, 0.0, 0.0)
Vvec = KcsVector3D.Vector3D(0.0, 1.0, 0.0)
trvec = KcsVector3D.Vector3D(0.0, 1000.0, 2000.0)
trmat= KcsTransformation3D.Transformation3D()
trmat. SetFromPointAndTwoVectors( orig, Uvec, Vvec)
trmat.Translate(trvec)
Class KcsStringlist.Stringlist(Initstring)
The class holds information about a list of strings.
Parameters:
Initstring string The first string in the list
Methods:
AddString
Examples:
str = 'First string'
list = KcsStringlist.Stringlist(str)
str = 'Second string'
list.AddString(str)
Class KcsSymbollist.Symbollist(FontId,SymbNo)
The class holds information about a list of symbols, each represented by an integer pair
denoting the font identification and the symbol number within that font.
Parameters:
FontId integer First symbol: The font identification
SymbNo integer First symbol: The symbol number within the font
Methods:
AddSymbol
Examples:
fontid = 23
symbno = 1
list = KcsSymbollist.Symbollist( fontid, symbno)
fontid = 66
symbno = 16
list.AddSymbol(fontid, symbno)
Class KcsColour.Colour)
The class holds information about a specific colour. It is used in Vitesse functions i.e.
colour_set in module kcs_draft or colour_select in module kcs_ui.
Parameters and attributes:
ColourString string The name of the colour
"White"
"Cyan"
"Blue"
"Magenta"
"Red"
"Yellow"
"Green"
"Black"
"Wheat"
"MediumAquamarine"
"NavyBlue"
"DarkOrchid"
"FireBrick"
"Orange"
"ForestGreen"
"DimGrey"
"Tan"
"Aquamarine"
"SlateBlue"
"Violet"
"IndianRed"
"Gold"
"LimeGreen"
"Grey"
"Sienna"
"Turquoise"
"LightBlue"
"BlueViolet"
"Pink"
"Coral"
"SpringGreen"
"LightGrey"
Constructor:
Colour This constructor will create instance of Colour class. Parameter is
(colourString) defined as above.
Class protocols:
__repr__ Used to return string representation of Colour object.
Examples:
col1 = KcsColour.Colour("Violet")
col1_str = col1.ColourString
col2 = KcsColour.Colour()
col2.ColourString = col1_str
Class KcsLinetype.Linetype(LinetypeString)
The class holds information about a specific line type.
Parameters and attributes:
Examples:
# get system name for first alias name
aliases = KcsLinetype.GetLinetypes()
SysName = KcsLinetype.GetSystemName(aliases[0])
Class KcsModel.Model(Type,Name)
The class holds information about a specific model
Parameters and first two attributes:
Type string The model type.
Valid types are:
"plane panel"
"hull curve"
"longitudinal"
"transversal"
"subsurface"
"lines fairing curve"
“space general”
Name string The model name.
Remaining attributes:
PartType string The model part type.
Methods:
Class constructor: This constructor will create instance of
ModelDrawAssyCriteria(<name>) ModelDrawAssyCriteria class.
name - is an assembly name. This parameter is
optional.
SetAssemblyName(name) Sets name of assembly object.
GetAssemblyName() Returns name of assembly object.
IsRecursive() Returns 1 if Recursive mode is selected. If it is 0
Parts mode is selected.
SetRecursive(mode) Sets mode flag to:
Recursive - if mode is 1
Parts - if mode is 0
EnableModelType(type, value) Enables(value=1) or disables(value=0) given
model type. As type one of the following names
should by used:
'PlanePanel', 'CurvedPanel', 'Pipe', 'Equipment',
'Cableway', Structure', 'PlacedVolume' or
'Ventilation'.
IsModelTypeEnabled(type) Returns 1 if given type is enabled, otherwise it will
return 0.
Combine(transf) Performs combination of two transformations.
Combines self with another transformation matrix
given by transf which is another instance of
Transformation2D class.
Invert() Performs inversion of transformation matrix.
Example:
criteria = KcsModelDrawAssyCriteria. ModelDrawAssyCriteria ('BL-M902');
criteria.SetRecursive(1) # Recursive mode
criteria.EnableModelType('PlanePanel', 0)................ # Exclude PlanePanels
from selection
see also:
# Example: kcs_ex_draft33.py
Class KcsObject.Object
The class holds information about database object.
Parameters and attributes:
__Name string Name of object.
__Code1 integer Object code 1.
__Code2 integer Object code 2
__DateTime DateTime Creation date and time.
Example:
import KcsObject
see also:
# Example: kcs_ex_db01.py
Class KcsObjectCriteria.ObjectCriteria
The class holds information about database object selection criteria.
Parameters and attributes:
__Name string or None Name of object given with wildcards.
__Code1 integer or None Object code 1.
__Code2 integer or None Object code 2
__DateTime tuple or None Date and time criteria. Stored as:
1. (DateTime, DateTime)
2. (integer, DateTime)
3. None
Example:
import KcsObjectCriteria
from KcsDateTime import DateTime
a = KcsObjectCriteria.ObjectCriteria()
print a
a.SetName("PLANE*")
a.SetCreationDate('>=', DateTime(2000, 10, 19, 23, 00, 00,
00))
a.SetSize('<', 100)
print a
see also:
# Example: kcs_ex_db01.py
Class KcsPrintOptions.PrintOptions(printername)
The class holds information about print options.
Parameters and attributes:
PrinterName string Printer name, empty means to use currently
selected on
Orientation integer Page orientation,
0 - Currently selected
1 - Portrait
2 - Landscape
PrintToFile integer Activity of print-to-file option:
0 - print-to-file option set to false
1 - print-to-file option set to true
FileName String File name for print result if print-to-file option is
active.
NoOfCopies integer Number of copies. If it is 0 than currently value will
be used.
EffPrintArea integer Effective print area:
0 - Currently selected
1 - Drawing Form
2 - Drawing Extension
3 - Current Window
AutoOrient integer Auto-orientation flag:
0 - Use current state of flag
1 - Activate option
2 - Deactivate option
ScaleToFit integer Scale-to-fit flag:
0 - Use current state of flag
1 - Activate option
2 - Deactivate option
Example:
options = KcsPrintOptions.PrintOptions('\\ntsvr7\p015');
options.SetOrientation(1)
options.SetScaleToFit(1)
kcs_draft.dwg_print(options)
see also:
# Example: kcs_ex_draft27.py
Class KcsTransformation2D.Transformation2D()
The class holds information 2D transformation.
Parameters and attributes:
Example:
transformation = KcsTransformation2D.Transformation2D();
center = KcsPoint2D.Point2D(10, 10)
angle = (3.1415/180) * 45........................... # 45 degrees
transformation.Rotate(center, angle)................ # rotate
transformation.Scale(2.0)........................... # and scale
see also:
# Example: kcs_ex_draft31.py
# Example: kcs_ex_draft34.py
Class KcsCaptureRegion2D.CaptureRegion2D()
The class holds information about 2D capture region. It is used in Vitesse capturing
functions i.e. model_capture and geometry_capture in module kcs_draft.
Parameters and attributes:
Inside integer Side of capturing region. If 0 all inside of contour
will be included, if 1 all outside will be included.
Cut integer Intersection flag. If 0 geometry intersecting the
capturing region will not be included, if 1 geometry
intersecting the capture region will be included.
Infinite integer Infinite flag. Set to 1 if region is infinite. Reset to 0
by SetRectangle and SetContour functions.
Rect integer Contour type flag. Set to 1 by SetRectangle
function and reset to 0 by SetContour function
(readonly as object variable).
Contour Contour2D Contour defining boundary of region. Set by
SetRectangle and SetContour functions (readonly
as object variable).
Constructor:
CaptureRegion2D() This constructor will create instance of
CaptureRegion2D class (flags set to 1: Inside, Infi-
nite, flags reset to 0: Cut, Rect).
Methods:
SetRectangle Sets the region based on given rectangle. It sets
(rect) Contour attribute with input rectangle contour, sets
Rect flag to 1 and resets Infinite flag to 0.
rect Rectangle2D Capturing rectangle
SetContour Sets the region based on given contour. It sets
(cont) Contour attribute with input contour, resets Rect
and Infinite flags to 0.
cont Contour2D Capturing contour
Class protocols:
Example:
point1 = KcsPoint2D.Point2D(0, 0)
point2 = KcsPoint2D.Point2D(100, 100)
rectangle = KcsRectangle2D.Rectangle2D(point1, point2)
region = KcsCaptureRegion2D.CaptureRegion2D()
region.SetRectangle(rectangle)
region.Inside = 1
region.Cut = 0
Class KcsLayer.Layer(layerid)
The class holds information about layer element.
Parameters and attributes:
__LayerId integer Layer id.
layerid integer Initial value for __LayerId attribute.
Methods:
SetLayer
GetLayer
GetDescription
Example:
layer = KcsLayer.Layer(2)
print (layer.GetDescription())
Example:
symbolElement = KcsSymbol.Symbol(21, 2)
symbolElement.SetVisible(1)
reflectedInU = symbolElement.IsFeflectedInUAxis()
Class KcsText.Text(text)
The class holds information about text element.
Parameters and attributes:
__Visible integer Visibility. If 1 text is visible, if 0 not.
__Detectable integer Detectability. If 1 text is detectable, if 0 not.
__Colour Colour Colour
__LineType LineType LineType
Example:
text = 'example text'
textElement = KcsText.Text(text)
textElement.SetVisible(1)
aspect = textElement.GetAspect()
Class KcsInterpretationObject.SymbolicView
Class KcsInterpretationObject.CurvedPanelView
The class holds information about a curved panel view.
Parameters and attributes: ([]Default setting)
Seams integer Seams in view [1=Yes]/0=No
SeamNames integer Seam names in view [1=Yes]/0=No
Plates integer Plates in view [1=Yes]/0=No
Material integer Material specification in view 1=Yes/[0=No]
Stiffeners integer Stiffeners in view [1=Yes]/0=No
StiffNames integer Stiffener profile names in view 1=Yes/[0=No]
ShellStiffNames integer Shell stiffener names in view 1=Yes/[0=No]
PartNames integer Part names (stiffener) in view 1=Yes/[0=No]
Endcuts integer Display endcuts in view 1=Yes/[0=No]
Jigs integer Display jigs in view [1=Yes]/0=No
Heights integer Display jig heights in view 1=Yes/[0=No
FrameCurves integer Frame curves in view 1=Yes/[0=No]
FrameCurvesNames integer Names of frame curves in view 1=Yes/
[0=No]
DirectionMarks integer Direction marks in view 1=Yes/[0=No]
HoleCrossMarks integer Hole crossmarks in view 1=Yes/[0=No]
Methods:
Property set/get methods.
SetSeams (integer)
GetSeams ()
SetSeamsNames (integer)
GetSeamsNames ()
SetPlates (integer)
GetPlates ()
SetMaterial (integer)
GetMaterial ()
SetStiffeners (integer)
GetStiffeners ()
SetStiffNames (integer)
GetStiffNames ()
SetEndcuts (integer)
GetEndcuts ()
SetJigs (integer)
GetJigs ()
SetHeights (integer)
GetHeights ()
4.6 Weld
These python classes are used in connection with the kcs_weld interface.
Class KcsWeldTable.WeldTable
The class holds information about a weld table.
Parameters and attributes:
__WeldTableName String Name of weld table object
__WeldTableComm String Weld table comment
ent
__TotalWeldLength Real Total weld length
__TotalSuspension Real Total suspension length
Length
__WeldedJoints list of Welded joint data
WeldedJoint
Methods:
Class constructor: This constructor will create an instance of
WeldTable class.
WeldTable()
SetWeldTableName(string) Sets weld table name
GetWeldTableName() Returns weld table name
SetWeldTableComment(string) Sets weld table comment
GetWeldTableComment() Returns weld table comment
SetTotalWeldLength(real) Sets the total weld length
GetTotalWeldLength() Returns total weld length
SetTotalSuspensionLength(real) Sets total suspension length
GetTotalSuspensionLength() Returns total suspension length
SetWeldedJoint(int,WeldedJoint) Sets the given welded joint
GetWeldedJoint(int) Returns the given welded joint
GetNumberWeldedJoints() Returns number of welded joints
AddWeldedJoint(WeldedJoint) Adds the welded joint
Example:
import KcsWeldTable
wt = KcsWeldTable.WeldTable()
wt.SetWeldTableComment("weld table comment")
Class KcsWeldedJoint.WeldedJoint
The class holds information about a welded joint.
Example:
import KcsWeldTable
import KcsWeldedJoint
wt = KcsWeldTable.WeldTable()
wj = wt.GetWeldedJoint( 1)
wj.SetJointComment("joint comment")
Class KcsWeld.Weld
This class holds information about a weld.
Parameters and attributes:
__WeldName string Name of weld
__WeldComment string Weld comment
__WeldLength real Weld length
__LegLength real Weld leg length
__Layers integer Number of weld layers
__Position string Weld position
__TestProcedure string Test procedure
__Process string Process
__StandardProces string Standard process
s
__StartSuspension real Start suspension
__EndSuspension real End suspension
__ConnectionAngl real Connection angle
e
__RotationAngle real Rotation angle
__InclinationAngle real InclinationAngle
__TorchVector Vector3D Torch vector
__BevelPart1 real Bevel code, first part
__BevelPart2 real Bevel code, second part
__ThicknessPart1 real Thickness, first part
__ThicknessPart2 real Thickness, second part
__Geometry GeoContour3D Weld geometry
Methods:
ClassConstructor: This constructor will create an instance of Weld
class
Weld()
SetWeldName(int, int) Set the weld name
GetWeldName() Returns the weld name
SetWeldComment(string) Sets weld comment
GetWeldComment() Returns weld comment
SetWeldLength(real) Sets the weld length
GetWeldLength() Returns weld length
Example:
import KcsWeldTable
import KcsWeldedJoint
import KcsWeld
wt = KcsWeldTable.WeldTable()
wj = wt.GetWeldedJoint( 1)
wld = wj.GetWeld( 1)
wld.SetWeldComment("weld comment")
wj.SetWeld( wld)
wt.SetWeldedJoint( 1, wj)
4.7 Hull
Class KcsBodyPlanViewOptions.BodyPlanViewOptions
The class holds information about Body plan View attributes.
Parameters and attributes:
BodyPlanName string Defines view name
bAutoSeams integer Auto Seams flag. If set, include all seams
(longitudinal direction) and butts (transversal
direction) inside the box.
bAutoLongTrac integer Auto longitudinal trace flag. If set, include traces of
e all profiles inside the box.
bAutoLongSecti integer Auto longitudinal section flag. If set, include cross-
on sections of all profiles inside the box
SurfacesFilter [ string ] List of surface for filtering (include/exclude
depends on SurfacesExclude flag)
SurfacesExclud integer Surfaces exclude/include flag
e
Scale integer Defines view scale
AftLimits Point3d Defines coordinate of aft limit of the view
FwdLimits Point3d Defines coordinate of fwd limit of the view
bLooking constant Defines looking code. Can be one of:
LOOKING_PS = 1
LOOKING_SB = 2
LOOKING_FOR = 4
LOOKING_AFT = 3
LOOKING_TOP = 5
LOOKING_BOT = 6
LongSectionIma constant Defines how cross-sections of profiles should be
ge drawn. Can be one of:
IMAGE_FULL = 0
IMAGE_MOULD = 1
IMAGE_THICK = 2
LongSectionFra integer This attribute can be used to display the cross-
me section of the profiles at a single frame only.
DrawFrame integer Interval (number of frames) between sections to be
drawn in the body plan view.
SeamColour colour Defines seam colour
LongColour colour Defines longitudinal colour
FrameColour colour Defines frame colour
GridSpacing integer Defines grid spacing, if it should be drawn.
PanelFilter [ string ] Include/Exclude list
SeamsFilter [ string ] Include/Exclude list (depends on SeamsExclude
flag)
SeamsExclude integer Except flag
Class KcsCopyPanOptions
The class holds information about Copy Panel Options : Inherits from
KcsMovePanOptions
Parameters and attributes:
__Dictionary Dictionary Panel Names Dictionary
__BlockName string Block Name
Methods:
Class KcsMovePanOptions
The class holds information about Move Panel Options
Parameters and attributes:
__LocationType Constant Type of Location. Can be one of:
PRINCIPAL_PLANE =1
THREE_POINTS =2
PLANE_OBJECT =3
__Coordinate Constant Defines Coordinate. Can be one of:
X =1
Y =2
Z =3
__RelativePosition Constant Defines Relative Position. Can be one of:
1 – Relative
0 – Not Relative
__CoordinateValue string Coordinate Value in String format
__Origin Point3D If defined by three points, Point of Origin
__Uaxis Point3D If defined by three points, Point of Uaxis
__Vaxis Point3D If defined by three points, Point of VAxis
__ObjectName string If Defined by Object, object name
Methods:
Class KcsPanelSchema
The class contains functions operating on panel schema.
Methods:
SetValue(Group, Keyword, Value) Function to set value of keyword in panel
schema statement.
Parameters:
Group ( Integer/String ) : Index of statement in
group or statement string
Keyword ( String ) : Name of keyword
Value ( String ) : Value of keyword
GetValue(Group, Keyword ) Function to get value of keyword in panel
schema statement.
Group ( Integer/String ) : Index of statement in
group or statement string
Keyword ( String ) : Name of keyword
Return value: ( String ) Value of keyword in given
statement
Class KcsPanHoleOptions
The class holds information about PanHole Options.
Parameters and attributes:
__Axis Constant Defines axis by which hole is created:
BY_UNDEF = 0
BY_U = 1
BY_V = 2
BY_UV = 3
BY_X = 11
BY_Y = 12
BY_Z = 13
BY_YZ = 21
BY_XZ = 22
BY_XY = 23
BY_XYZ = 30
BY_X_Y_ZAP = 36
BY_X_YAP_Z = 34
BY_XAP_Y_Z = 32
BY_XRT = 40
BY_1 = 100
BY_2 = 200
BY_T = 500
____HasApprox Integer Defines if approximated coordinate.
0 - true
1- false
__Pt1 Point3D Defines the origin coordinates.
__Pt2 Point3D Defines the origin coordinates.
__AsStored integer Defines the origin of a hole "as stored".
This is used when the hole is created from an
existing contour which has a transformation. The
contour will be projected into the curved panel
along the normal of the plane in which the
contour is defined.
1 - true
0 - false
__Rotation Point3D In case of an asymmetrical hole, this defines the
direction of the U-axis of the hole.
__Symm Constant Symmetry code.
SYMM_AS_PANEL = 0
SYMM_PS = 1
SYMM_SB = 12
__IsFictive integer Define if hole will be burnt or only marked.
1 - true
0 - false
Class KcsRunModeOptions
The class holds information about planar hull scheme run mode options.
Parameters and attributes:
__ConfirmGenerati Integer Confirm generation option.
on
__TraceOn Integer Trace on option
Methods:
SetConfirmGeneration(Integer) Set Confirm Generation value.
Allowed values: [ 0,1, None ]
GetConfirmGeneration Get Confirm Generation value.
SetTraceOn (Integer) Set Trace On value.
Allowed values: [ 0,1, None ]
GetTraceOn () Get Trace On value.
Class KcsShPlateProp.ShPlateProp
The class holds information about a shell plate.
Parameters and attributes:
__PartsList String An explicitly given parts list name.
__GPS_1 String General Purpose String.
__GPS_2 String General Purpose String.
__GPS_3 String General Purpose String.
__GBP_4 String General Purpose String.
__SurfaceTreatment String Surface Treatment.
__Destination String Destination.
__Thickness Float Material Thickness (inside).
__ThicknessOut Float Material Thickness (outside).
__Quality String Material Quality Code.
__Posno Integer Position Number.
__LaminateIn Integer Laminate code for inside of plate.
__LaminateOut Integer Laminate code for outside of plate. A value o 0
means same laminate code as for inside.
__LongitudinalShrinkage Float Longitudinal shrinkage.
__TransversalShrinkage Float Transversal shrinkage.
__RawPlate String Raw Plate Identification.
Methods:
GetDestination
GetGPS_1
GetGPS_2
GetGPS_3
GetGPS_4
GetLaminateIn
GetLaminateOut
GetLongitudinalShrinkage
GetPartsList
GetPosno
GetQuality
GetRawPlate
GetSurfaceTreatment
GetThickness
GetThicknessOut
GetTransversalShrinkage
SetDestination
SetGPS_1
SetGPS_2
SetGPS_3
Class KcsShPlateProp.ShPlateProp
SetGPS_4
SetLaminateIn
SetLaminateOut
SetLongitudinalShrinkage
SetPartsList
SetPosno
SetQuality
SetRawPlate
SetSurfaceTreatment
SetThickness
SetThicknessOut
SetTransversalShrinkage
ClassKcsShStiffProp.ShStiffProp
The class holds information about a shell stiffener.
Parameters and attributes:
_DummyInterval Integer = 1 The shell stiffener is a dummy interval.
_GPS_1 String General purpose string.
_GPS_2 String General purpose string.
_GPS_3 String General purpose string.
_GPS_4 String General purpose string.
_SurfaceTreatment String Surface treatment.
_Destination String Destination.
_UseStiffenerData Integer = 1 Use the profile data in this class.
= 0 Use the profile data in the shell profile this
stiffener belongs to.
_Posno Integer Position number.
_PosnoPrefix String Position number prefix.
_PosnoSuffix String Position number prefix.
_Profile _Type
Profile type according to standards.
_Parameters
Profile parameters.
_Quality String Material quality code.
_End[0,1] _Connection
Connection code.
_Excess
Excess.
_Offset
The given length from the starting / ending
point of the trace to the actual starting /
ending point of the physical profile,
measured as described below. This length
should always be >=0.
_OffsetFrom
The physical end point of the shell stiffener
will be located at a distance
_Offset from the plane described by
_OffsetFrom, measured perpendicularly to
the plane.
Can be of type:
kcsCUTTING_PLANE
kcsFRAME_PLANE
kcsBUTTOCK_PLANE
kcsWATERLINE_PLANE
_EndCut
• _CalcWebAngle
The angle is calculated according to the
values of _Connection.
• _CalcFrom
kcsCUTTING_PLANE
kcsFRAME_PLANE
kcsBUTTOCK_PLANE
kcsWATERLINE_PLANE
• _Type
End cut type.
• _Parameters
End cut parameters
_WebBevel
Bevel Code for profile web.
_FlaBevel
Bevel code for profile flange.
_InclAngle
Angle measure.
_InclAngelType
Angel type:
kcsX_AXIS,KcsY_AXIS,kcsZ-
AXIs,
kcsPERPENDIUCULAR,
kcsPERP_WHOLe,
kcsCUTTING_PLANE
_TraceBevel Float Bevel code along the trace of this stiffener.
_Shrinkage Float Shrinkage of the stiffener in millimeters per
meter.
_FilletWeldDepth Float Depth of fillet weld when stiffener is mounted on
a curved panel.
_Perpendicular Integer = 1 The stiffener is perpendicular to the surface at all
positions along the trace.
= 0 Inclination is specified at both ends.
Methods:
GetDestination
GetDummyInterval
GetUseStiffenerData
SetDestination
SetDummyInterval
SetFilletWeldDepth
SetGPS_1
SetGPS_2
SetGPS_3
SetGPS_4
SetPerpendicular
SetPosno
SetPosnoPrefix
SetPosnoSuffix
SetProfileParameter
SetProfileType
SetQuality
SetShrinkage
SetSurfaceTreatment
SetTraceBevel
SetUseStiffenerData
Class KcsShellXViewOptions
The class holds information about Shell Expansion View Options.
Parameters and attributes:
__ShellXName string Defines View Name
__DevelopedFrom Constant Defines Coordinate. Can be one of:
Code X = 1
Y = 2
Z = 3
__DevelopedFrom Point3D Defines Developed From Coordinate
Coordinate
__SternLimtsCode string Defines Limits Code. Can be one of:
PLANE_BY_SEAMS = 1
PLANE_BY_X = -1
PLANE_BY_Y = -2
PLANE_BY_Z = -3
__SternLimitsSeam [] If defined by Seams, list of seams.
s
__SternLimitsCoor Point3D Defines Limits Coordinate.
dinate
Class KcsSplitPanOptions.SplitPanOptions
The class holds information about Split Panel Options
Parameters and attributes:
5 Drafting
5.1 General
The functions are made available in the Python program by the insertion of the statement
import kcs_draft. The functions are then referred to as kcs_draft.<function name>. Before
using a new function, please carefully read the function description.
Vitesse for Drafting contains functions for many different purposes. There are functions for
e.g. create a new drawing, place text in drawing, create geometric entities, create drawing
components, and highlighting. The functions are divided into the following sections:
• Drawing Functions
• Modal Properties
• Default Values
• View Functions
• Model handling functions
• Creation of basic geometric entities
• Creation of texts
• Creation of symbols
• Creation of drawing components
• Property changing and Retrieving Functions
• Identifying and Capturing Functions
• Deleting functions
• Highlighting functions
• Subpicture and Element Navigation
• Drawing element functions
• Subpicture functions
• Visual Area functions
Every function in the interface will be explained and some examples have been included to
show how the functions can be used.
5:1 12 Series
Vitesse User Guide
Drafting
The default error is kcs_Error. If no specific exception occurs, this error is set. Note that
the kcs_Error exception is a general exception and will not be further described below.
Example:
import kcs_draft
import KcsColour
new_colour = KcsColour.Colour("Red")
try:
kcs_draft.colour_set(new_colour)
except:
print kcs_draft.error
5.3 Classes
Some of the functions in the Vitesse Drafting interface take objects as input. These objects
are instances of Python classes. The classes used in this interface are described in
General.
Note: Only one drawing at a time may be current. This means that no drawing may be
current before creating a new or opening an existing drawing. If a drawing is current
it first has to be closed.
5:2 12 Series
Vitesse User Guide
Drafting
5:3 12 Series
Vitesse User Guide
Drafting
5:4 12 Series
Vitesse User Guide
Drafting
dwg_pack()
The function packs the current drawing.
Arguments:
None.
Returned value:
None.
Exceptions:
kcs_DrawingNotCurrent No drawing was current.
kcs_ArgumentError Invalid arguments list.
dwg_purge()
The function purges the current drawing. I.e. Removes any empty subpictures down to
subcomponent level.
Input parameters:
None.
Returned value:
[] None
Exceptions:
kcs_DrawingNotCurrent
kcs_Error
5:5 12 Series
Vitesse User Guide
Drafting
dwg_save()
The function saves the current drawing in the data bank. Note: An already existing
version in the data bank will be overwritten!
Input Parameters:
None
Returned value:
None
Exceptions:
kcs_DbError Data bank error
kcs_DrawingLocked The drawing is locked in the data bank
kcs_DrawingNotCurrent No drawing was current
kcs_ReadOnlyMode Drawing was opened in read-only mode
dwg_save_as('NewDwgName', <Databank>)
This function saves the current drawing with a new name in the given databank.
Input Parameters:
NewDwgName string The new drawing name (max. 25 characters)
Databank string Optional databank name. If not given then
standard drawing databank will be used. Allowed
values are: 'SB_ASSPDB' - for automatic
assembly drawings databank and 'SB_PDB' - for
standard drawings databank
Returned value:
None
Exceptions:
kcs_DbError Databank error.
kcs_DrawingExist Drawing already exists in databank.
kcs_DrawingNotCurrent No drawing was current
kcs_DrawingLocked The drawing is locked in the databank
kcs_NameError Invalid name of drawing
kcs_NameOccupied The name is used by the system
dwg_close()
The function closes the current drawing The drawing is not stored and will not be the
current one any more.
5:6 12 Series
Vitesse User Guide
Drafting
Input Parameters:
None
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
dwg_exist(DwgName, <DwgType>)
The function checks if a drawing of given type exists in the data bank.
Input Parameters:
DwgName string Name of drawing (maximum 25 characters)
<DwgType> Constant or Drawing type. It can be defined by using:
string
1. drawing types constants
(see chapter: "Drafting Constants"):
e.g. kcs_draft.kcsDWGTYPE_ASSEMBLY
2. logical databank names: e.g. "SB_PDB"
User defined drawing databanks can be specified
also by:
1. constant
kcs_draft.kcsDWGTYPE_USER_DEFINED
and database index e.g.
kcs_draft.kcsDWGTYPE_USER_DEFINED
+2
2. logical databank names: e.g. "SB_PDB002"
A list of all drawing databanks defined in the
system can be obtained by using
kcs_draft.dwg_type_list_get function.
This parameter is optional. If not given, the
standard drawing databank will be used.
Returned value:
[0] integer 0: The drawing does not exist in the data bank
1: The drawing exists in the data bank.
Exceptions:
kcs_CouldNotOpenDatabank Not possible to open databank. Probably
because of wrong user database name or id.
dwg_delete(DwgName, <DwgType>)
The function deletes a drawing of a given type in the databank.
Input Parameters:
DwgName string Name of drawing (maximum 25 characters)
5:7 12 Series
Vitesse User Guide
Drafting
dwg_current()
The function checks if a drawing is current.
Input Parameters:
None
Returned value:
[0] integer 0: No drawing is current
1: A drawing is current
Exceptions:
None
dwg_name_get()
The function returns the name of the current drawing.
Input Parameters:
None
Returned value:
[0] string The name
Exceptions:
kcs_DrawingNotCurrent No drawing was current
dwg_print(options)
The function prints current drawing using selected print options.
Input Parameters:
5:8 12 Series
Vitesse User Guide
Drafting
5:9 12 Series
Vitesse User Guide
Drafting
Example
#Example:kcs_ex_draft32.py
5:10 12 Series
Vitesse User Guide
Drafting
The function exports selected views/subviews to 2d3d dxf file. Model parts are exported
to ModelSpace block as 3D entities. Non-model parts are exported to PaperSpace block
as 2D entities.
Input Parameters:
FileName string Name of file to be created. The file must not exist
before. If no path is given, the file is created in
current directory. If no extension is given, the
default extension .dxf will be used.
ViewSubviewsList list of Element List of views and/or subviews handles. Specified
Handle views/subviews must be model views/subviews.
Paper Vector2D Paper size
Margins Vector2D Margins size
<DetailLevel> integer Level of dxf file detail. It can be one of the
following:
1 - Low detail
2 - Medium detail
3 - High detail (default)
4 - Extra detail
This parameter is optional.
<ACVersion> integer Version of AutoCAD in which exported file will be
open. It can be one of the following values:
12 - for R12
13 - for R13
14 - for R14
15 - for R15 (AutoCAD 2000) (default)
18 - for R18 (AutoCAD 2004)
This parameter is optional.
<Mode> integer Type of dxf file:
0 - text dxf file (default)
1 - binary dxf file
This parameter is optional.
<nElemVisibility> integer Type of exports hidden elements:
0 - hidden elements are invisible in exported file
(default)
1 - hidden elements are visible in exported file
<nLayerVisibility> integer Type of exports hidden layers:
0 - hidden layers are invisible in exported file (default)
1 - hidden layers are visible in exported file
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingNotCurrent No drawing was current.
kcs_AlreadyExist Destination file already exists.
kcs_HandleInvalid List of views/subviews is empty or there are
handles for not model views/subviews.
5:11 12 Series
Vitesse User Guide
Drafting
5:12 12 Series
Vitesse User Guide
Drafting
dwg_wmf_export(FileName)
The function exports the current drawing to a metafile.
Input Parameters:
FileName string Name of file to be created. The file must not exist
before. If no path is given, the file is created in
current directory. If no extension is given, the
default extension .wmf will be used.
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingNotCurrent No drawing was current.
kcs_AlreadyExist Destination file already exists.
kcs_ValueError For some reasons file can not be opened. For
example file on read only drive.
kcs_Error Internal error. Drawing can not be exported.
dwg_preview_bmp_export(FileName,DwgType,DwgName)
The function exports the preview of the given drawing to a bitmap file. Please note that a
preview of this drawing must exist in the preview image database.
Input Parameters:
FileName string Name of file to be created. If no path is given, the
file is created in current directory.
DwgType integer The drawing type code for the drawing.
DwgName string Name of the drawing to create a bitmap file from.
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid parameter.
kcs_FileError The file could not be created.
kcs_PreviewError The preview object could not be found in the
preview image database.
Example:
#kcs_ex_draft43.py
form_name_get()
The function returns form name of current drawing.
Input Parameters:
5:13 12 Series
Vitesse User Guide
Drafting
None
Returned value:
[0] string Name of drawing form
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Drawing has no form.
kcs_Error General error
dwg_type_list_get()
The function returns all drawing types registered in the system as a Python dictionary.
Input Parameters:
None
Returned value:
[0] dictionary The dictionary contains drawing types as keys
and pairs: description and logical databank name
as values. Example:
kcsDWGTYPE_GEN : ('General drawing',
'SB_PDB')
You can find all registered types using keys()
function of the returned dictionary.
dwg_validate(OutOfDate, NotFound)
The function validates the current drawing and returns two lists of KcsModel.Model
instances. The first list contains model objects that have been updated on the databank
after this drawing was saved. List two contains model objects in the drawing that cannot
be found on the databank. Only one instance of the object is returned and always as un-
reflected.
Input parameters:
OutOfDate List
NotFound List
5:14 12 Series
Vitesse User Guide
Drafting
Returned value:
[0] OutOfDate List of KcsModel objects
[1] NotFound List of KcsModel objects
Exceptions:
kcs_DrawingNotCurrent
kcs_Error
dwg_layers_is_shown ()
The function tests if application display mode is show layers. If show layers mode is
active the function returns true otherwise false.
Input Parameters:
None
Returned value:
[0] integer 0: Show layers mode is not active
1: Show layers mode is active
Exceptions:
kcs_DrawingNotCurrent No drawing is current
dwg_layers_is_hidden()
The function tests if application display mode is hide layers. If hide layers mode is active
the function returns true otherwise false.
Input Parameters:
None
Returned value:
[0] integer 0: Hide layers mode is not active
1: Hide layers mode is active
Exceptions:
kcs_DrawingNotCurrent No drawing is current
dwg_layers_shown_get ()
The function returns list of layers that are displayed when application mode is show
layers.
Input Parameters:
None
Returned value:
[0] list List of KcsLayer objects
Exceptions:
kcs_DrawingNotCurrentkcs_LayersD No drawing is current. Application is not in show
isplayModeInvalid layers mode
dwg_layers_hidden_get ()
The function returns list of layers that are hidden when application mode is hide layers.
Input Parameters:
5:15 12 Series
Vitesse User Guide
Drafting
None
Returned value:
[0] list List of KcsLayer objects
Exceptions:
kcs_DrawingNotCurrentkcs_LayersD No drawing is current. Application is not in hide
isplayModeInvalid layers mode
Example:
kcs_ex_draft26.py
Example:
# Example: kcs_ex_draft1.py
# Example: kcs_ex_draft27.py
# Example: kcs_ex_draft30.py
colour_set(ModalColour)
The function sets the modal colour for ordinary geometry.
Input Parameters:
ModalColour Colour The colour
Returned value:
None
Exceptions:
kcs_ColourInvalid Invalid colour
colour_get(ModalColour)
The function gets the modal colour.
Output Parameters:
ModalColour Colour The colour
Returned value:
[0] Colour The colour
Exceptions:
None
5:16 12 Series
Vitesse User Guide
Drafting
linetype_display_settings_get()
The function returns the line type display settings.
Input Parameters:
None.
Returned value:
[0] LineTypeDis The current line type display settings - instance of
playSettings KcsLineTypeDisplaySettings.LineTypeDisplaySettin
gs class.
Exceptions:
kcs_ArgumentError Invalid arguments list.
linetype_display_settings_set (modelLTDSettings)
The function sets the line type display settings.
Input Parameters:
ModalLTDSettings LineTypeDis Instance of
playSettings KcsLineTypeDisplaySettings.LineTypeDisplaySettin
gs class
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid parameter type
linetype_set(ModalLinetype)
The function sets the modal line type.
Input Parameters:
ModalLinetype Linetype The line type.
Returned value:
None
Exceptions:
kcs_LinetypeInvalid Invalid line type
linetype_get(ModalLinetype)
The function gets the modal line type.
Output Parameters:
ModalLinetype Linetype The line type
Returned value:
[0] Linetype The line type
Exceptions:
None
layer_set(Layer)
The function sets the modal layer.
5:17 12 Series
Vitesse User Guide
Drafting
Input Parameters:
Layer integer The layer
Returned value:
None
Exceptions:
Kcs_ArgumentError Invalid arguments list.
layer_get()
The function gets the modal layer.
Input Parameters:
None
Returned value:
[0] integer The layer
Exceptions:
None
Example:
# Example: kcs_ex_draft2.py
hatch_pattern_set(Angle, Distance)
The function sets the modal hatch pattern to a given angle and line distance.
Input Parameters:
Angle real The angle of the hatch pattern lines, between -90
and 90 degrees.
Distance real The distance between the hatch pattern lines (>0.0)
Returned value:
None
Exceptions:
kcs_Argument Error Invalid arguments list.
kcs_ValueError Invalid parameter value
std_hatch_pattern_set(Type)
The function sets the modal hatch pattern to one of the three standard patterns:
1. Single hatching with hatch angle defined by the default parameter
HATCH_ANG_PAT1.
2. Single hatching with hatch angle defined by the default parameter
HATCH_ANG_PAT2.
3. Cross hatching with hatch angle defined by the default parameter
HATCH_ANG_CROSS.
5:18 12 Series
Vitesse User Guide
Drafting
Input Parameters:
Type integer The standard hatch pattern type (1, 2 or 3)
Returned value:
None
Exceptions:
kcs_StdHatchPatternInvalid Invalid standard hatch pattern type
userdef_hatch_pattern_set(Page, Detail)
The function sets the modal hatch pattern to a user defined pattern found in the standard
hatch pattern book.
Input Parameters:
Page integer The page in the standard hatch pattern book
Detail integer The detail in the selected page
Returned value:
None
Exceptions:
kcs_PageNotFound The page was not found
kcs_DetailNotFound The detail within the page was not found
Example:
# Example: kcs_ex_draft3.py
note_symbol_set(Symbol)
The function sets the modal note symbol.
Input Parameters:
Symbol integer The modal note symbol in the font for Note symbols (range [31-
60] in the standard font, range [1-400] in the alternative font).
(to suppress the note symbol, give -1)
Returned value:
None
Exceptions:
SymbolInvalid
note_symbol_get()
The function gets the modal note symbol.
Input Parameters:
5:19 12 Series
Vitesse User Guide
Drafting
None
Returned value:
[0] integer The modal note symbol in the font for Note symbols
Exceptions:
None
posno_symbol_set(Symbol)
The function sets the modal position number symbol.
Input Parameters:
Symbol integer The modal position symbol in the font for Position Number
symbols (range [61-80] in the standard font, range [601-999] in
the alternative font).
Returned value:
None
Exceptions:
SymbolInvalid
posno_symbol_get()
The function gets the modal position number symbol.
Input Parameters:
None
Returned value:
[0] integer The modal position symbol in the font for Position Number
symbols
Exceptions:
None
posno_height_set(Height)
The function sets the modal height of position number symbols.
Input Parameters:
Height real The height of position number symbols (> 0.0)
Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value
posno_height_get()
The function gets the modal height of position number symbols.
Input Parameters:
None
Returned value:
[0] real The height of position number symbols
5:20 12 Series
Vitesse User Guide
Drafting
Exceptions:
None
Example:
# Example: kcs_ex_draft4.py
text_height_set(Height)
The function sets the modal text height.
Input Parameters:
Height real The text height (> 0.0)
Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value
text_height_get()
The function gets the modal text height.
Input Parameters:
None
Returned value:
[0] real The text height
Exceptions:
None
text_rotation_set(Rot)
The function sets the modal text rotation angle.
Input Parameters:
Rot real The text rotation angle, in degrees.
Returned value:
None
Exceptions:
None
text_rotation_get()
The function gets the modal text rotation angle.
Input Parameters:
None
Returned value:
5:21 12 Series
Vitesse User Guide
Drafting
text_aspect_set(Aspect)
The function sets the modal text aspect, i.e. the width/height ratio.
Input Parameters:
Aspect real The text aspect. A negative value means
proportional text.
Returned value:
None
Exceptions:
None
text_aspect_get()
The function gets the modal text aspect.
Input Parameters:
None
Returned value:
[0] real The text aspect
Exceptions:
None
text_slant_set(Slant)
The function sets the modal text slanting angle
Input Parameters:
Slant real The text slanting angle, in degrees (90 means
standard slant).
Returned value:
None
Exceptions:
None
text_slant_get()
The function gets the modal text slanting angle.
Input Parameters:
None
Returned value:
[0] real The text slanting angle, in degrees
Exceptions:
None
5:22 12 Series
Vitesse User Guide
Drafting
text_ascii_font_set(Font)
The function sets the modal ASCII text font.
Input Parameters:
Font integer The ASCII text font.
Valid fonts are:
0-7 (system fonts)
8-99 (user-defined fonts)
101,105 (ISO8859 fonts)
Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value
text_ascii_font_get()
The function gets the modal ASCII text font.
Input Parameters:
None
Returned value:
[0] integer The ASCII text font
Exceptions:
None
text_vector_font_set(Vfont)
The function sets the modal text vector (multi-byte) font, e.g. Japanese.
text_vector_font_get()
The function gets the modal text vector font.
Input Parameters:
None
Returned value:
[0] integer The text vector font
Exceptions:
None
text_ilsp_set(Ilsp)
5:23 12 Series
Vitesse User Guide
Drafting
The function sets the modal text interline space factor, used for multiple line texts. The
distance between two text lines will then be Interline space factor * text height. Note that a
negative value means "negative" growth direction.
Input Parameters:
Ilsp real The text interline space factor
Returned value:
None
Exceptions:
None
text_ilsp_get()
The function gets the modal text interline space factor.
Input Parameters:
None
Returned value:
[0] real The text interline space factor
Exceptions:
None
Example:
# Example: kcs_ex_draft5.py
symbol_height_set(Height)
The function sets the modal symbol height.
Input Parameters:
Height real The symbol height.
> 0: height of symbol space
< 0: height of symbol (absolute value)
Returned value:
None
Exceptions:
None
symbol_height_get()
The function gets the modal symbol height.
Input Parameters:
None
Returned value:
5:24 12 Series
Vitesse User Guide
Drafting
symbol_rotation_set(Rot)
The function sets the modal symbol rotation angle.
Input Parameters:
Rot real The symbol rotation angle, in degrees
Returned value:
None
Exceptions:
None
symbol_rotation_get()
The function gets the modal symbol rotation angle.
Input Parameters:
None
Returned value:
[0] real The symbol rotation angle, in degrees
Exceptions:
None
Example:
# Example: kcs_ex_draft6.py
default_value_set(DefStatement)
The function updates a default value by a given default statement.
Input Parameters:
DefStatement string The default statement (max 80 characters).
Statement string in format ‘KEYWORD=VALUE’ or
‘KEYWORD:VALUE’.
Returned value:
None
5:25 12 Series
Vitesse User Guide
Drafting
Exceptions:
kcs_Error Invalid arguments list
kcs_ValueError Invalid parameter value
kcs_DefKeywordInvalid Invalid default keyword
kcs_DefValueInvalid Invalid default value
default_value_get(DefKeyword)
The function returns a default statement, given a default keyword.
Input Parameters:
DefKeyword string The default keyword (max 40 characters).
Returned value:
[0] string The default statement
Exceptions:
kcs_Error Invalid arguments list.
kcs_DefKeywordInvalid Invalid default keyword
Example:
# Example: kcs_ex_draft18.py
5:26 12 Series
Vitesse User Guide
Drafting
view_move(ViewHandle, DeltaVec)
The function moves a view by a delta vector.
Input Parameters:
ViewHandle integer Handle to the view
DeltaVec Vector2D The delta vector
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to given view
5:27 12 Series
Vitesse User Guide
Drafting
view_identify(ViewName, <PictWinExt>)
view_identify(IdPnt, <PictWinExt>)
The function returns a handle to a view, identified by name or closest to a given point in
the current drawing.
Input Parameters:
ViewName string The name of the view
IdPnt Point2D The identification point
<PictWinExt> KcsPictWinE Picture element window extension.
xt.PictWinEx
t
Returned value:
[0] integer Handle to the view.
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_ViewNotFound No view was found
view_hl_remove(ViewHandle)
The function removes hidden lines from a view.
Input Parameters:
ViewHandle integer Handle to the view
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_HandleInvalid Invalid handle to given view
5:28 12 Series
Vitesse User Guide
Drafting
5:29 12 Series
Vitesse User Guide
Drafting
view_slicedepth_get (ViewHandle)
The function retrieves the defined forward and backward distance for slice planes in
relation to the view plane for a given view. The view can either be a symbolic view or a
sliced model view. For a symbolic view forward and backward slice depth from the
projection plane is returned. For a sliced model view, a single depth is returned.
5:30 12 Series
Vitesse User Guide
Drafting
Input Parameters:
ViewHandle ElementHan Handle to view
dle
Returned value:
[0] integer Return code:
0 - no slice depth returned, view is not sliced
1 - slice depth returned for model view
2 - forward and backward slice depth returned
[1] real Slice depth for model view or forward slice depth for
symbolic view
[2] real Backward slice depth for symbolic view
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingNotCurrent No drawing was current.
kcs_HandleInvalid Given handle is invalid. (e.g. doesn't point to view)
kcs_Error General error
kcs_ModelViewNotFound Given handle doesn't point to model view
view_slice_planes_get(handle)
This function returns slice planes for symbolic view.
Input Parameters:
handle ElementHan Symbolic view handle.
dle
Returned value:
[0] Plane3D Tuple with slice planes represented by 2 instances
[1] Plane3D of Plane3D class.
Exceptions:
kcs_ArgumentError Argument Error
kcs_DrawingNotCurrent Drawing not current
kcs_HandleInvalid Handle invalid
kcs_ModelViewNotFound Given handle doesn't specify model view
kcs_GeneralError Given handle doesn't specify symbolic view
view_symbolic_model_tra(ViewHandle,Transf3D)
The function retrieves the model transformation matrix for a given symbolic view.
Input Parameters:
View Handle ElementHan Handle to symbolic view.
dle
Transf3D Transformati Instance of
on3D KcsTransformation3D.Transformationd3D class
Returned value:
[0] Transf3D Instance of
KcsTransformation3D.Transformation3D class
Exceptions:
5:31 12 Series
Vitesse User Guide
Drafting
view_restriction_area_get(ViewHandle)
This function returns area that has been defined for a view in a modelling drawing form.
Input Parameters:
ViewHandle ElementHan Handle to the view.
dle
Returned value:
[0] KcsRectangl Defined area of view.
e2D
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.
kcs_DoesNotExist Restriction area for specified view is not defined.
Example:
# Example: kcs_ex_draft17.py
# Example: kcs_ex_draft16.py
# Example: kcs_ex_draft34.py
# Example: kcs_ex_draft30.py
# Example: kcs_ex_draft31.py
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:
5:32 12 Series
Vitesse User Guide
Drafting
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 ElementHandl Optional view handle. If no view specified then all
e 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
5:33 12 Series
Vitesse User Guide
Drafting
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 ElementHandl Handle to the subview, component or geometry.
e
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.Mod Instance of Model class.
el
Returned value:
[0] List of List of:
ElementHandl -subviews' handles if PartId = 0
e instances -components' handles if PartId <> 0
Exceptions:
5:34 12 Series
Vitesse User Guide
Drafting
Example:
# Example: kcs_ex_draft19.py
# Example: kcs_ex_draft33.py
arc_new(Arc)
The function creates a circular arc.
Input Parameters:
Arc Arc2D The arc definition
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_AmplitudeTooBig The amplitude was too big
circle_new(Circle)
The function creates a circle.
Input Parameters:
Circle Circle2D The circle definition
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
conic_new(Conic)
The function creates a conic segment.
Input Parameters:
5:35 12 Series
Vitesse User Guide
Drafting
contour_new(Contour)
The function creates a contour.
Input Parameters:
Contour Contour2D The contour definition
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_AmplitudeTooBig The amplitude in at least one segment was too big
ellipse_new(Ellipse)
The function creates an ellipse.
Input Parameters:
Ellipse Ellipse2D The ellipse definition
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
line_new(Line)
The function creates a restricted line.
Input Parameters:
Line Rline2D The line definition
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
point_new(Point)
The function creates a point.
Input Parameters:
Point Point2D The point definition
5:36 12 Series
Vitesse User Guide
Drafting
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
rectangle_new(rectangle, <radius>)
The function creates regular or with rounded-corners rectangle.
Input Parameters:
Rectangle Rectangle2D Description of rectangle.
radius real It is used for rounded corners rectangle and
specifies radius for corners arcs. Valid values are
from 0.0 to half length of minimal rectangle side.
This parameter is optional.
Returned value:
[0] ElementHandl Handle to new element.
e
Exceptions:
kcs_ValueError Invalid parameter value. (e.g. radius not valid)
kcs_DrawingNotCurrent No drawing was current
kcs_Error General error. Can't create element.
spline_new(Spline)
The function creates a spline, defined by a number of points. The spline is created with no
tangent conditions.
Input Parameters:
Polygon Polygon2D The points defining the spline
Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
Example:
# Example: kcs_ex_draft7.py
5:37 12 Series
Vitesse User Guide
Drafting
Multiple line texts are handled. The character '\n' is used as separator between two lines.
text_length(Text)
The function calculate the text length in specified font format.
Input Parameters:
Text KcsText.Text The text definition.
None.
Returned value:
[0] float The length of the text.
Exceptions:
kcs_ArgumentError Invalid argument.
text_new(String, Pos)
text_new(Text)
The function creates a text, with modal attributes, in the current drawing.
Input Parameters:
String String Element handle.
Pos Point2D Position of the text.
Text KcsText Instance of KcsText.Text class.
Returned value:
[0] Integer Handle to the created text
Exceptions:
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.
rule_text_new(Text, RuleNo)
The function creates a text according to a given rule number, in the drawing form of the
current drawing. If such a text already exists, it will be replaced.
Input Parameters:
Text string The text value (maximum 512 characters)
RuleNo integer The rule number
Returned value:
[0] integer Handle to the created text
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_NoFormInDrawing The drawing contains no form
kcs_RuleNoInvalid Invalid rule (not found in form)
kcs_FormNotFound The drawing form was not found in the data bank
5:38 12 Series
Vitesse User Guide
Drafting
Example:
# Example: kcs_ex_draft11.py
# Example: kcs_ex_draft24.py
# Example: kcs_ex_draft25.py
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
5:39 12 Series
Vitesse User Guide
Drafting
5:40 12 Series
Vitesse User Guide
Drafting
5:41 12 Series
Vitesse User Guide
Drafting
5:42 12 Series
Vitesse User Guide
Drafting
5:43 12 Series
Vitesse User Guide
Drafting
The function adds dimensioning from one model object to another along a third in a given
view. The model objects have to intersect the same surface. Valid model types are:
longitudinal, transversal, hull curve, seam and stiffener.
Input Parameters:
Viewhandle Element Handle to model view.
Handle
From List List of KcsModel.Model
Along List List of KcsModel.Model
To List List of KcsModel.Model
Type Integer = 0: only the dimension text will be created.
= 1: Arrow at end point and circle at start point also
displayed.
= 2: The dimension trace are also displayed.
Colour KcsColour.C The colour of the dimension
olour
Returned value:
[0] List Handles to the created components
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_ArgumentError Invalid arguments list
kcs_GeneralError List of result can't be created for some internal
reason
kcs_ ModelViewNotFound Specified view not found
Example:
# Example: kcs_ex_draft8.py
# Example: kcs_ex_draft29.py
# Example: kcs_ex_draft28.py
hatch_new(Contour)
hatch_new(ContHandle)
The function creates a hatch pattern component, given a closed 2D contour.
Input Parameters:
Contour Contour2D The contour definition
ContHandle integer Handle to the contour
Returned value:
[0] integer Handle to the created component
Exceptions:
5:44 12 Series
Vitesse User Guide
Drafting
hatch_island_new(HatchHandle, Island)
hatch_island_new(HatchHandle, IslandHandle)
The function removes the part of the given hatch pattern that lies inside a given island,
defined by a closed 2D contour.
Input Parameters:
HatchHandle integer Handle to the given hatch pattern component
Island Contour2D The island contour definition
IslandHandle integer Handle to the island contour
Returned value:
[0] integer Handle to the resulting hatch pattern component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to hatch pattern/island contour
kcs_AmplitudeTooBig The amplitude in at least one segment in the island
contour was too big
kcs_OwnerNotFound No structural owner to the resulting hatch pattern
component could be derived
Example:
# Example: kcs_ex_draft9.py
note_new(Text, RefLine)
The function creates a note component. The reference line is defined by a 2D polygon.
Input Parameters:
Text string The text of the note
RefLine Polygon2D The reference line
Returned value:
[0] integer Handle to the created note component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
5:45 12 Series
Vitesse User Guide
Drafting
posno_new(Text, RefLine)
The function creates a position number component. The reference line is defined by a 2D
polygon.
Input Parameters:
Text string The text of the position number
RefLine Polygon2D The reference line
Returned value:
[0] integer Handle to the created position number component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_SymbolError The modal position number symbol was not found
kcs_OwnerNotFound No structural owner to the resulting position number
component could be derived
Example:
# Example: kcs_ex_draft10.py
cloud_new(Parent, Shape)
The function creates a new cloud primitive.
Parent ElementHan Parent subview handle. The created cloud
dle component will belong to given subview.
Shape Rectangle2D Contour for cloud symbol.
or
Polygon2D
Returned value:
[0] ElementHan Handle to the created cloud component.
dle
Exceptions:
ks_DrawingNotCurrent No drawing was current
kcs_ValueError Values of input parameters are invalid. For example:
given polygon has only 2 vertexes.
kcs_ArgumentError Invalid arguments list.
kcs_Error General error. Cloud component can't be created.
kcs_HandleInvalid Invalid handle of subview.
5:46 12 Series
Vitesse User Guide
Drafting
5:47 12 Series
Vitesse User Guide
Drafting
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:
5:48 12 Series
Vitesse User Guide
Drafting
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.
element_layer_get(handle, layer)
The function will return element layer.
Input Parameters:
5:49 12 Series
Vitesse User Guide
Drafting
element_layer_set(handle, layer)
The function will set layer of element given by handle.
Input Parameters:
handle ElementHan Handle to element.
dle
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.
5:50 12 Series
Vitesse User Guide
Drafting
Input Parameters:
handle ElementHan Handle to geometry element.
dle
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 ElementHan Handle to geometry element.
dle
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 ElementHan Handle to geometry element.
dle
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.
5:51 12 Series
Vitesse User Guide
Drafting
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 KcsContour Instance of KcsContour2D.Contour2D class.
2D
Returned value:
[0] KcsContour Instance of KcsContour2D.Contour2D class.
2D
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:
5:52 12 Series
Vitesse User Guide
Drafting
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 ElementHan Handle to reference element.
dle
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.
5:53 12 Series
Vitesse User Guide
Drafting
Capture Functions
This chapter describes functions to capture elements in the current drawing. The capture
functions described in this chapter use the CaptureRegion2D as input parameter. This
CaptureRegion2D class holds information about a 2D capture region. Region can be
described by a Contour2D or Rectangle2D.
This chapter describes functions to identify arbitrary entities in the current drawing.
element_identify(Name)
The function returns a handle to the entity in the current drawing, identified by a given
name. If there are more than one entity with this name, the first one encountered will be
returned.
Input Parameters:
Name string The name of the entity
Returned value:
[0] KcsElementHandle Handle to the entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ElementNotFound The entity was not found in the drawing
model_identify(IdPnt, Model)
The function identifies a model, closest to a given point in the current drawing.
Input Parameters:
IdPnt Point2D The identification point
Model Model The model to identify (type & name)
Output Parameters:
Model Model The model identified
Returned value:
[0] Model The model identified
[1] integer Handle to the model subview
[2] integer Handle to the model component
Exceptions:
kcs_ValueError Invalid parameter value
kcs_DrawingNotCurrent No drawing was current
kcs_ModelNotFound No model identified
subview_identify(point)
subview_identify(name)
5:54 12 Series
Vitesse User Guide
Drafting
The function returns a handle to the subview on 2:nd level closest to the given point or
with a given name. Please note that only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
name string The name of the subview.
Returned value:
[0] integer Handle to identified subview.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_SubviewNotFound Subview not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
component_identify(point)
component_identify(name)
The function returns a handle to the component on 3:nd level closest to the given point or
with a given name. Please note that only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
name string The name of the component.
Returned value:
[0] integer Handle to identified component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_ComponentNotFound Component not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error
General error.
dim_identify(point)
The function returns a handle to the dimension component closest to the given point.
Please note that only visible layers are considered.
Input Parameters:
Point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified dimension component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Dimension not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
5:55 12 Series
Vitesse User Guide
Drafting
note_identify(point)
The function returns a handle to the note component closest to the given point. Please
note that only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified note component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Note not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
posno_identify(point)
The function returns a handle to the position number component closest to the given
point. Please note that only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified position number
component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Position number not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
hatch_identify(point)
The function returns a handle to the hatch component closest to the given point. Please
note that only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified hatch component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Hatch not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
text_identify(point)
The function returns a handle to the text closest to the given point. Please note that only
visible layers are considered.
5:56 12 Series
Vitesse User Guide
Drafting
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified text.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Text not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
symbol_identify(point)
The function returns a handle to the symbol closest to the given point. Please note that
only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified symbol.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Symbol not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
contour_identify(point)
The function returns a handle to the contour closest to the given point. Please note that
only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] Integer Handle to identified contour.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Contour not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
point_identify(point)
The function returns a handle to the point closest to the given point. Please note that only
visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified point.
5:57 12 Series
Vitesse User Guide
Drafting
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Point not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
geometry_identify(point)
The function returns a handle to the geometry closest to the given point. Please note that
only visible layers are considered.
Input Parameters:
point Point2D Point in drawing.
Returned value:
[0] integer Handle to identified geometry.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Geometry not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
model_capture(region)
The function returns a list of handles to models captured by given region. Please note that
only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured models
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
dim_capture(region)
The function returns a list of handles to dimensions captured by given region. Please note
that only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured dimensions
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
5:58 12 Series
Vitesse User Guide
Drafting
note_capture(region)
The function returns a list of handles to notes captured by given region. Please note that
only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured notes
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
posno_capture(region)
The function returns a list of handles to position numbers captured by given region.
Please note that only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured position numbers.
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
hatch_capture(region)
The function returns a list of handles to hatches captured by given region. Please note
that only visible layers are considered.
Input Parameters:
Region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured hatches
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
5:59 12 Series
Vitesse User Guide
Drafting
text_capture(region)
The function returns a list of handles to texts captured by given region. Please note that
only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured texts
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
symbol_capture(region)
The function returns a list of handles to symbols captured by given region. Please note
that only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured symbols
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
contour_capture(region)
The function returns a list of handles to contours captured by given region. Please note
that only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured contours
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
5:60 12 Series
Vitesse User Guide
Drafting
point_capture(region)
The function returns a list of handles to points captured by given region. Please note that
only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured points
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
geometry_capture(region)
The function returns a list of handles to geometries captured by given region. Please note
that only visible layers are considered.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of Handles to captured geometries
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
view_capture(region)
The function returns a list of handles to views captured by given region.
Input Parameters:
region CaptureRegion2D Region in drawing.
Returned value:
[0] List of element Handles to captured views.
handles.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound The entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
5:61 12 Series
Vitesse User Guide
Drafting
subview_capture(region)
The function returns a list of handles to subviews captured by given region.
Input Parameters:
region CaptureRegion2D. Region in drawing.
Returned value:
[0] List of element Handles to captured subviews.
handles.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound The entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
component_capture(region)
The function returns a list of handles to components captured by given region.
Input Parameters:
region CaptureRegion2D. Region in drawing.
Returned value:
[0] List of element Handles to captured components.
handles.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound The entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
label_identify(point)
The function returns a handle to the label component closest to the given point. Please
note that only visible layers are considered.
Input Parameters:
Point Point2D Point in drawing.
Returned value:
[0] Integer Handle to identified label component.
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Label not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
label_capture(region)
The function returns a list of handles to labels captured by given region. Please note that
only visible layers are considered.
Input Parameters:
5:62 12 Series
Vitesse User Guide
Drafting
Example:
# Example: kcs_ex_draft20.py
# Example: kcs_ex_draft21.py
# Example: kcs_ex_draft22.py
element_delete(Handle)
The function deletes an arbitrary entity in the current drawing. The entity is given by a
handle.
Input Parameters:
Handle KcsElement Handle to the entity
Handle
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_HandleInvalid Invalid handle to given entity
Example:
# Example: kcs_ex_draft14.py
5:63 12 Series
Vitesse User Guide
Drafting
Example:
hl_handle = arc_highlight(arc)
<do something>
highlight_off(hl_handle)
arc_highlight(Object)
circle_highlight(Object)
The function highlights a circle.
Input Parameters:
Object Circle2D The circle definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
5:64 12 Series
Vitesse User Guide
Drafting
conic_highlight(Object)
The function highlights a conic segment.
Input Parameters:
Object Conic2D The conic segment definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
contour_highlight(Object)
The function highlights a contour.
Input Parameters:
Object Contour2D The contour definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
ellipse_highlight(Object)
The function highlights an ellipse.
Input Parameters:
Object Ellipse2D The ellipse definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
line_highlight(Object)
The function highlights a restricted line.
Input Parameters:
Object Rline2D The line definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
5:65 12 Series
Vitesse User Guide
Drafting
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
point_highlight(Object,<Type>)
The function highlights a point.
Input Parameters:
Object Point2D The point definition
Type =1 A cross will be drawn that stays the same size
regardless of zoom.
Else A circle will be drawn as before.
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
rectangle_highlight(Object)
The function highlights a rectangle.
Input Parameters:
Object Rectangle2D The rectangle definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError kcs_ValueError
spline_highlight(Object)
The function highlights a spline.
Input Parameters:
Object Polygon2D The spline definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
element_highlight(Handle) or element_highlight([Handles])
The function highlights an arbitrary entity/entities given by a handle/list of handles.
Input Parameters:
5:66 12 Series
Vitesse User Guide
Drafting
highlight_off(Handle)
The function turns off a given highlighting.
Input Parameters:
Handle KcsElementH Handle to a highlighted entity (no validity check.
andle
If zero is given, all highlighted entities are turned
off.
Returned value:
None
Exceptions:
None
Example:
# Example: kcs_ex_draft13.py
element_parent_get(elementHandle)
The function returns handle to the parent subpicture of the given element.
Input Parameters:
elementHandle KcsElementH Handle to element
andle
Returned value:
[0] KcsElementH Handle of parent subpicture.
andle
Exceptions:
kcs_ArgumentError Parameter is not expected.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element has no parent. This exception is raised
when an attempt is made to get the parent of a
view.
5:67 12 Series
Vitesse User Guide
Drafting
element_child_first_get(<subpictureHandle>)
The function returns handle to the first child of the given subpicture handle. If no
argument is given, a handle to the first view in the drawing is returned.
Input Parameters:
subpictureHandle KcsElementH Handle to subpicture
andle
Returned value:
[0] KcsElementH Handle of the first child element.
andle
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element has no children.
kcs_Error General error.
element_sibling_next_get(elementHandle)
The function returns handle to the next sibling of the given element.
Input Parameters:
elementHandle KcsElementH Handle to element
andle
Returned value:
[0] KcsElementH Handle of the next sibling element.
andle
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound There is no next sibling element.
kcs_Error General error.
Example:
# Example: kcs_ex_draft30.py
element_transform(elementHandle, <transf2d>)
The function transform element by given transformation data.
Input Parameters:
5:68 12 Series
Vitesse User Guide
Drafting
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 ElementHandl Handle to source element.
e
targetSubpictureHa ElementHandl Handle to target parent subpicture.
ndle e
5:69 12 Series
Vitesse User Guide
Drafting
Returned value:
[0] ElementHandl Handle to new element.
e
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. (e.g. 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 ElementHandl Handle to the element. This parameter is optional.
e
Returned value:
[0] KcsRectangle Current extent area.
2D
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
5:70 12 Series
Vitesse User Guide
Drafting
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 KcsElementH Handle to the element.
andle
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_depersist(elementHandle)
The function removes given element from PADD. Presently, only dimension components
are accepted.
Input Parameters:
elementHandle KcsElementH Handle to the element.
andle
Returned value:
[0] integer -1 No dimension component.
0 Element already de-persisted, no action.
1 OK, element de-persisted.
5:71 12 Series
Vitesse User Guide
Drafting
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
element_is_contour(elementHandle)
The function checks if an element is a contour.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_view(elementHandle)
The function checks if an element is a view.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_subpicture(elementHandle)
The function checks if an element is a subpicture.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
5:72 12 Series
Vitesse User Guide
Drafting
element_is_subview(elementHandle)
The function checks if an element is a subview.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_component(elementHandle)
The function checks if an element is a component.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_text(elementHandle)
The function checks if an element is a text.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
5:73 12 Series
Vitesse User Guide
Drafting
element_is_symbol(elementHandle)
The function checks if an element is a symbol.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_note(elementHandle)
The function checks if an element is a note component.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_posno(elementHandle)
The function checks if an element is a position number component.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_dimension(elementHandle)
The function checks if an element is a dimension component.
5:74 12 Series
Vitesse User Guide
Drafting
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_hatch(elementHandle)
The function checks if an element is a hatch component.
Input Parameters:
elementHandle KcsElementH Handle to the element
andle
Returned value:
[0] integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
Example:
# Example: kcs_ex_draft30.py
element_is_nesting(elementHandle)
The function checks if an subpicture is a nesting subview or component which belongs to
it.
Input Parameters:
elementHandle ElementHandle Handle to the component or subview.
Returned value:
[0] Integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
5:75 12 Series
Vitesse User Guide
Drafting
element_is_burning_sketch(elementHandle)
The function checks if an subpicture is a burning sketch subview or component which
belongs to it.
Input Parameters:
elementHandle ElementHandle Handle to the component or subview.
Returned value:
[0] Integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
element_is_detail_sketch (elementHandle)
The function checks if an subpicture is a detail sketch subview or component which
belongs to it.
Input Parameters:
elementHandle ElementHandle Handle to the component or subview.
Returned value:
[0] Integer 1 if element matches type, otherwise 0
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.
Example:
# Example: kcs_ex_draft30.py
element_is_bodyplan_view (ViewPtr)
This function checks whether the current picture is a BodyplanView.
Input parameters
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a BodyplanView
1==If the model is a BodyplanView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
5:76 12 Series
Vitesse User Guide
Drafting
element_is_curpanel_view (ViewPtr)
This function checks whether the current picture is a CurpanelView.
Input parameters
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a CurpanelView
1==If the model is a CurpanelView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_detail_view (ViewPtr)
This function checks whether the current picture is a Detail View.
Input parameters
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a Detail View
1==If the model is a Detail View
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_devpla_view (ViewPtr)
This function checks whether the current picture is a DevplaView.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a DevplaView
1==If the model is a DevplaView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
5:77 12 Series
Vitesse User Guide
Drafting
element_is_devsti_view (ViewPtr)
This function checks whether the current picture is a DevstiView.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a DevstiView
1==If the model is a DevstiView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_general_view (ViewPtr)
This function checks whether the current picture is a General View.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a General View
1==If the model is a General View
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_shellx_view (ViewPtr)
This function checks whether the current picture is a ShellxView.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a ShellxView
1==If the model is a ShellxView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
5:78 12 Series
Vitesse User Guide
Drafting
element_is_symbolic_view (ViewPtr)
This function checks whether the current picture is a Symbolic View.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a Symbolic View
1==If the model is a Symbolic View
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_templ_view (ViewPtr)
This function checks whether the current picture is a TemplView.
Input parameters:
ViewPtr Integer Handle to the view
Returned value:
[0] Integer 0==If the model is not a TemplView
1==If the model is a TemplView
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_Value_Error Invalid parameter value.
kcs_DrawingNotCurrent Active drawing not set.
kcs_GeneralError List of result can't be created for some internal
reason.
element_is_depersisted(elementHandle)
The function checks if given element is de-persisted.
Input Parameters:
elementHandle KcsElementHa Handle to the element.
ndle
Returned value:
[0] integer 1 if element matches type, otherwise 0.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
element_is_label(elementHandle)
The function checks if an element is a label component.
5:79 12 Series
Vitesse User Guide
Drafting
Input Parameters:
elementHandle KcsElementHa Handle to the element.
ndle
Returned value:
[0] integer 1 if element matched type, otherwise 0.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
subview_new (<name>)
The function creates a new subview. The subview will be placed within the current view.
Current subpicture cannot be set to "automatic" when this function is executed.
Input Parameters:
name string Name for new subview (optional).
Returned value:
[0] KcsElementH Handle to created subview.
andle
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_NameOccupied Name is already in use in current view.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
component_new (<name>)
The function creates a new component. The component will be placed within the current
subview. Current subpicture cannot be set to "automatic" when this function is executed.
Input Parameters:
name string Name for new component (optional).
Returned value:
[0] KcsElementH Handle to created component.
andle
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_NameOccupied Name is already in use in current subview.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
5:80 12 Series
Vitesse User Guide
Drafting
subpicture_current_set (subpictureHandle)
The function sets a subpicture to be current for the creation of new geometry. If a
component subpicture element handle is give, this will be set as current. If a handle to
view or subview is given, the component (and subview) will be chosen by the system. If
no argument is given the subpicture will be automatically chosen each time geometry is
created.
Note: If you will try to set a view or a subview which has no children as current then
system will create component (and subview) and set it current.
Input Parameters:
subpictureHandle KcsElementH Handle to subpicture (optional).
andle
Returned value:
[0] KcsElementH Handle to created component.
andle
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
subpicture_current_get ()
The function returns the current subpicture status. If an empty result list is returned, this
means that the current subpicture setting is set to "automatic".
Note: If you will use that function when current subpicture settings is not set to
"automatic" and there are no views, subviews or components system will create
one at set is as current. Handles of created subpictures will be returned.
Input Parameters:
None
Returned value:
[0] List of If not empty then handles to current view (first list
ElementHandl item), subview (second list item) and component
e (third list item).
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
subpicture_name_set(subpictureHandle, name)
The function sets new name for existing subpicture. Name of form view can't be changed.
If name is not empty and there is another subpicture on this level with the same name
exception will be raised.
Input Parameters:
5:81 12 Series
Vitesse User Guide
Drafting
subpicture_name_get(subpictureHandle)
The function gets name of existing subpicture.
Input Parameters:
subpictureHandle KcsElementH Handle to element.
andle
Returned value:
[0] String Name of existing subpicture.
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound There is no next sibling element.
kcs_Error General error.
Example:
# Example: kcs_ex_draft30.py
subpicture_save(subpHandle)
The function saves subpicture given by handle to standard subpicture databank.
Subpicture name will be used for saving so it must be set first.
Input Parameters:
subpHandle ElementHandl Subpicture handle
e
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_HandleInvalid Given handle is not valid.
5:82 12 Series
Vitesse User Guide
Drafting
5:83 12 Series
Vitesse User Guide
Drafting
Example:
#Example:
kcs_ex_draft37.py
CommonSample.py
dwg_repaint()
The function repaints entire drawing.
Input Parameters:
None
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current.
dwg_zoom()
The function zooms the display to the specified rectangle.
Input Parameters:
rectangle KcsRectangle New display area
2D
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current.
kcs_ArgumentError Invalid parameter type.
kcs_ValueError Specified rectangle is empty.
kcs_PythonMethodNotFound Python Rectangle2D class method not found.
zoom_extent_get()
The function returns currently displayed area of drawing. Note that if the drawing is empty
this function can return empty rectangle. The IsEmpty() method of Rectagle2D class
should be use for test.
Input Parameters:
rectangle KcsRectangle Instance of Rectangle2D class.
2D
Returned value:
rectangle KcsRectangle Displayed area of drawing
2D
Exceptions:
5:84 12 Series
Vitesse User Guide
Drafting
Example:
# Example: kcs_ex_draft35.py
shd_new(ViewHandle)
The function creates a shaded view given a handle to a view. If a shaded view already
exists then an exception is set, as only one shaded view can exist at a time.
Input parameters:
ViewHandle The handle to the view to show in shaded mode.
Returned value:
[] None
Exceptions:
kcs_ArgumentError
kcs_DrawingNotCurrent
kcs_HandleInvalid
kcs_Error
kcs_ShadedViewExists
shd_projection_set(TransformationMatrix)
The function sets the projection for a shaded view given a transformation matrix. If no
shaded view exists then an exception is set.
Input parameters:
TransformationMat KcsTransform The transformation matrix
rix ation3D.Trans
formation3D
Returned value:
[] None
Exceptions:
kcs_ArgumentError
kcs_DrawingNotCurrent
kcs_Error
kcs_NoShadedViewExists
shd_autoscale()
5:85 12 Series
Vitesse User Guide
Drafting
The function auto scales a shaded view. If no shaded view exists then an exception is set.
Input parameters:
Returned value:
[] None
Exceptions:
kcs_ArgumentError
kcs_DrawingNotCurrent
kcs_Error
kcs_NoShadedViewExists
shd_zoom_box(BoxMinPoint, BoxMaxPoint)
The function zooms a shaded view given the min and max points of a 3D box. If no
shaded view exists then an exception is set.
Input parameters:
BoxMinPoint KcsPoint3D.P
oint3D
BoxMaxPoint KcsPoint3D.P
oint3D
Returned value:
[] None
Exceptions:
kcs_ArgumentError
kcs_DrawingNotCurrent
kcs_Error
kcs_NoShadedViewExists
5:86 12 Series
Vitesse User Guide
Drafting
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.
5:87 12 Series
Vitesse User Guide
Drafting
5:88 12 Series
Vitesse User Guide
Hull
6 Hull
6.1 General
Vitesse functions in Hull can be use to create planar as well as curved model objects. The
functions are divided into two modules one for planar hull and one for curved hull:
kcs_hullpan and kcs_chm.
The basic feature of these Vitesse interfaces is that objects/components may be created
from an input file. In the planar case the input file is the plane panel scheme and in the
curved case the input file is the XML based description file which may be used to generate
objects by the Batch Curved Hull program. In this way all types of plane panels/components
and all types of curved model objects can be created via the Vitesse Hull interfaces.
The input languages of the planar and curved input file will not be explained here, please
refer to Hull \ Planar Modelling \ Design Language of Hull Modelling and Hull \ Curved
Modelling \ User’s Guide Batch \ Input Language of Curved Hull Modelling.
Although the basic feature is to generate object/components via an input file, the Vitesse
interfaces also have functions for “direct” modification. In the planar module you will also
find powerful methods to copy/move/split panels, split stiffeners and remove seams.
Note: The kcs_Error exception is a general exception and will not be further described
below.
default_value_set(statement)
These functions are used to set and get the default values valid in Planar-, Curved
Modelling and Structural Design.
Input Parameters:
Statement String Statement string in format KEYWORD=VALUE.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid parameter value.
kcs_DefKeywordInvalid Invalid default keyword.
kcs_DefValueInvalid Invalid default value.
default_value_get(statement)
The function gets given default value
Input Parameters:
Statement String The default keyword.
Returned value:
[0] String The default statement.
Exceptions:
kcs_DefKeywordInvalid Invalid default keyword.
kcs_ArgumentError Invalid argument format.
6.3.2 Activate/Store/Skip/Delete/Recreate
pan_activate(ListOfPanels)
Activate a number of panels
Input Parameters:
ListOfPanels list of strings The names of the panels to be activated.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_ModelNotFound The panel was not found.
kcs_ModelLocked The panel was locked by another user.
pan_skip(ListOfPanels)
Skip the panels indicated by “ListOfPanels”. Each panel in “ListOfPanels” must one of
the currently activated panels. An empty list means all currently activated panels.
Input Parameters:
ListOfPanels list of strings The names of the panels to be skipped.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_ModelNotFound The panel is not active or does not exist
pan_store(ListOfPanels)
Store the panels indicated by “ListOfPanels”. Each panel in “ListOfPanels” must one of
the currently activated panels, otherwise it will be ignored. An empty list means all
currently activated panels.
Input Parameters:
ListOfPanels list of strings The names of the panels to be stored.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_ModelNotFound The panel is not active or does not exist
pan_delete(ListOfPanels)
Delete the panels indicated by “ListOfPanels”. Each panel in “ListOfPanels” must one of
the currently activated panels. An empty list means all currently activated panels.
Input Parameters:
ListOfPanels list of strings The names of the panels to be stored.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_NoModelIsCurrent The panel is not active or does not exist
pan_list_active( )
Get a list of all currently activated panels
Input Parameters:
none
Returned value:
[0]PanelNames list of strings The names of the panels that are currently
activated.
Exceptions:
none
pan_recreate(<ListOfPanels>)
Recreate panels from list in topological order. The panels must be activated. If no
parameter is given then all activated panels will be recreated..
Input Parameters:
ListOfPanels list of strings Optional list of names of the panels to be recreated.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_NoModelIsCurrent Panel is not active
pan_init(scheme,ident)
Initialize a new panel. This function also starts a new scheme with the given name and
adds an 'ident' statement first in the scheme. The directory path need not be given. It is
then fetched from the global variable SB_SHIPSCH. If another scheme is already active
a control question appears.
Input Parameters:
scheme string name of scheme.
ident string the ident statement in the schema
Returned value:
none
Exceptions:
kcs_ArgumentError Incorrect number of, or type of parameters
kcs_SystemError AVEVA Marine error
kcs_InterpretationError Hull Planar Scheme interpretation error
kcs_GenerationError Hull Planar Scheme generation error
kcs_Error Other error
pan_modify(panel,mode)
stmt_exec(group,statement)
Add the statement given as input to current scheme and run it. The components are
generated into the current panels.
Input Parameters:
group integer number of the group to replace. For
addition the group number should be set to
zero.
statement string containing the statement to be executed.
Should be in standard Hull Plane Modelling
format.
Returned value:
none
Exceptions:
kcs_ArgumentError Incorrectnumber of, or type of, parameters
kcs_SystemError AVEVA Marine error
kcs_InterpretationError Hull Planar Scheme interpretation error
kcs_GenerationError Hull Planar Scheme generation error
kcs_Error Other error
stmt_exec_single(group,statement,panel)
Add the statement given as input to the scheme of the given panel and run it. The
components are generated into the given panel
Input Parameters:
group integer (as stmt_exec)
statement string (as stmt_exec)
panel string the name of the panel
Returned value:
none
Exceptions:
group_get(panel,part_id)
Get the group number for a given component within a panel.
Input Parameters:
panel string the name of the panel
part_id integer the component identity to get the group
number for
Returned value:
group integer the group number
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters
kcs_SystemError AVEVA Marine error
kcs_ModelNotFound Panel or group not found
kcs_Error Other error
group_next(panel,act,group)
Get the number of the group according to input. Either the first group number can be
returned. In this case the input parameter group has no meaning. Or the group following
the given one can be returned. The last option is to check the validity of an existing
group number. If it is valid the same group number is returned. In case of failure, an
exception is raised just as for the other functions.
Input Parameters:
panel string the name of the panel
act integer -2: get first group
0: get this group
1: get next group
group integer the component identity to get the group
number for
Returned value:
group integer the resulting group number
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters
kcs_SystemError AVEVA Marine error
kcs_ModelNotFound Panel or group not found
kcs_Error Other error
stmt_get(panel,group)
Get the statement text for a given group within a panel. The statement text can be
changed and used in the "kcs_hullpan.stmt_exec" function to change a group of
components.
Input Parameters:
panel string the name of the panel containing the group
group integer the number of the group to get the
statement text for
Returned value:
statement string the statement text
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters
kcs_SystemError AVEVA Marine error
kcs_ModelNotFound Panel or group not found
kcs_Error Other error
pan_scheme_runmode_get( )
Get the current run mode options. These are the same options as you can view/change
with the interactive function “Planar\Scheme\Run Mode” of planar hull modelling.
Input Parameters:
none
Returned value:
RunModeOptions Instance of The current run mode options.
KcsRunModeOp
tions
pan_scheme_runmode_set(RunModeOptions)
Set the current run mode options. These are the same options as you can view/change
with the interactive function “Planar\Scheme\Run Mode” of planar hull modelling. You
may modify current settings for “Confirm Generation” and “Trace On”.
Input Parameters:
RunModeOptions Instance of The current run mode options.
KcsRunModeOp
tions
Returned value:
none
nerr()
Number of interpretation and generation errors when the exceptions
kcs_InterpretationError or kcs_GenerationError was raised. If kcs_SystemError was
raised 1 is returned.
Input Parameters:
none
Returned value:
nerr integer number of errors
Exceptions:
none
err_code(error_ind)
Get the error code after any of the exceptions kcs_InterpretationError,
kcs_GenerationError or kcs_SystemError.
Input Parameters:
error_ind integer index number between 1 and nerr(). For
kcs_SystemError set error_ind to zero.
Returned value:
error_code integer the error code
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters
or value out of bounds.
err_mess(error_ind)
Get the error message after any of the exceptions kcs_InterpretationError,
kcs_GenerationError or kcs_SystemError.
Input Parameters:
error_ind integer index number between 1 nd nerr(). For
kcs_SystemError set error_ind to zero.
Returned value:
error_mess string the error message
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters
or value out of bounds.
editor(panel)
Invoke the editor with a scheme for the given panel. Can be used after the exceptions
kcs_InterpretationError or kcs_GenerationError to show the erroneous statement in its
context.
Input Parameters:
panel string the name of the panel
Returned value:
none
Exceptions:
kcs_ArgumentError Incorrect number of, or type of, parameters.
• KcsPanelSchema Class
The KcsPanelSchema python can help you to modify the schema of a panel. You initiate
this class by giving the name of the panel for which you want to do scheme updates. There
are two methods SetValue and GetValue that will get/set the value of a specific keyword in a
specific statement
Example:
KcsPanelSchema
import KcsPanelSchema
import kcs_ui
panelName = 'JUMBO-GIR11700'
sch = KcsPanelSchema.PanelSchema( panelName )
group = 8
val = sch.GetValue(group, 'SID')
es = sch.SetValue(group, 'SID', 'OS')
val = sch.GetValue(group, 'SID')
0 Standalone keyword
1 Integer
2 Real
4 Integer, real or string. The keyword is basically a integer or real value but may
also be expressed with a string description: QUA=A32, LEN=H-20,
CUT=ABC
8 Description name
6.3.4 Copy/Move/Split/Topology
These are functions that operates on the panel object level. You can copy or move whole
panels, split panels and get topology information about the panel.
pan_copy(ListOfPanels, CopyPanOptions)
Copy some of the currently activated panels. The new panels will also be activated.
Input Parameters:
ListOfPanels string or list List of panels to copy. It can be a single panel name
or strings or a list of names. Every panel in the list must be
among the activates ones otherwise an exception is
return (kcs_NoModelIsCurrent).
CopyPanOptions Instance of Detailed information about the copy operation
KcsCopyPan
Options
Returned value:
[None
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_NoModelIsCurrent One or more of the selected panels are not
activated.
pan_move(ListOfPanels, MovePanOptions)
Move all currently selected panels
Input Parameters:
ListOfPanels string or list List of panels to copy. It can be a single panel name
or strings or a list of names. Every panel in the list must be
among the activates ones otherwise an exception is
return (kcs_NoModelIsCurrent).
MovePanOptions KcsMovePa Instance of KcsMovePanOptions. Detailed
nOptions. information about the move operation.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_NoModelIsCurrent One or more of the selected panels are not
activated.
pan_split(ListOfPanels, SplitPanOptions)
Split all the currently activated panels.
Input Parameters:
ListOfPanels string or list List of panels to copy. It can be a single panel name
or strings or a list of names. Every panel in the list must be
among the activates ones otherwise an exception is
return (kcs_NoModelIsCurrent).
SplitPanOptions Instance of This object contains all the detailed information for
KcsSplitPan the split operation.
Options
Returned value:
none
Exceptions:
kcs_Error General error.
pan_topology(Model, Act)
Calculate the dependencies to/from a given model object.
Input Parameters:
Model Instance of The model object The “Root” object.
KCSModel
Act string Activity indicating how to calculate the
dependencies:
“Dependent primary” - List all objects that depends
on “Model”. Only search one level.
“Dependent all” - List all objects that depends on
“Model”. Search all levels.
“Defining” - List all object that defines “Model” (i.e.
a list of all objects that “Model” depends on)
Returned value:
[0]TopoList List of The list of all model objects that depend on or
instances of defines “Model”.
KcsModel
Exceptions:
kcs_ArgumentError Invalid input parameters
kcs_Error Topology calculation failed.
pan_remove_seam(panel_name, component)
Remove a seam from a panel. This function corresponds to the function “Remove seam”
of the interactive planar hull modelling. It removes the seam an “glues” all components
that are split by the seam.
Input Parameters:
panel_name The name of the panel
component The seam component number
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters, e.g. the group number
does not exist.
kcs_NoModelIsCurrent The panel is not activated.
pan_group_delete(panel_name,group)
Delete a group of components from a panel.
Input Parameters:
panel_name The name of the panel
group The group number
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameters, e.g. the group number
does not exist.
kcs_NoModelIsCurrent The panel is not activated.
pan_sti_split_by_model(group, component_id)
Split a group of stiffeners where they intersect another model, i.e. a hole, a stiffener or a
seam in the current panel. This function operates on all active panels.
Input Parameters:
group integer The group to be split.
component_id integer Selected the “splitting” component. The function will
be split the group of stiffeners where this
component intersect the stiffeners. The component
may be a stiffener, a seam, a hole, a flange or a
bracket.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input parameters.
pan_sti_split_by_plane(group, plane)
Split a group of stiffeners where they intersect a plane. This function operates on all
active panels.
Input Parameters:
Group integer The group to be divided.
Plane string The group will be divided where this plane
intersects the stiffeners. Plane is a string describing
a principal plane. It can be a string like
“X=FR50+200”, “Y=8000” or Z=”LP23-100”.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input parameters.
kcs_Error The split failed: no intersection or other error.
Example
# Example: kcs_ex_hullpan03.py
view_detail_new(act, component_handle)
When a handle to a component is given, and create a detail view.
Input Parameters:
act integer Selects the type of component:
2 - Flange
3 - Stiffener
4 - Bracket
5 - Seam
view_symbolic_modify(ViewHandle, SymbolicViewOptions)
This function will get all view options from an existing symbolic view and deliver them in a
KcsInterpretationObject (Python object).
Input Parameters:
ViewHandle ElementHan Handle to the view.
dle
Returned value:
SymbolicViewOptio KcsInterpret Instance of the “KcsInterpretationObject” object.
ns ationObject The object will be filled with all the view options that
were set when the view was created.
Exceptions:
kcs_InvalidView The given view is not a symbolic view or view data
is missing.
view_symbolic_recreate(ViewHandle)
Recreate a symbolic view.
Input Parameters:
ViewHandle ElementHan Handle to the view.
dle
Returned value:
none
Exceptions:
kcs_ArgumentError The given view is not a symbolic view or view data
is missing.
kcs_DrawingNotCurrent The is no current drawing
Examples
# Example: kcs_ex_hullpan04.py (view_detail_new)
pan_curve_create( )
The function returns a curve statement to add in the current panel.
Input Parameters:
plane code integer The code of the plane.
view handle handle The handle of the current view
curve name string The name of created curve
panel name string The name of the current panel
contour contour2D The contour object
Returned value:
[0] integer Result code
[1] string Curve statement
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
pan_curve_store( )
The function makes curve object out of the contour and saves it on the databank.
Input Parameters:
dwg handle handle The handle of the current drawing.
view handle handle The handle of the current view.
curve name string The name of created curve.
cont handle handle The handle of the contour.
contour handle The contour object.
Returned value:
[0] integer Result code
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
Examples
# Example: kcs_ex_hullcurve1.py
# Example: kcs_ex_hullcurve2.py
6.3.9 Examples
Example on using the plane panel modelling interface. All error handling has been left out to
keep the example small. A slash (\) at the end of lines mean that the statement continues on
the next line.
Example:
import kcs_ui
import kcs_util
import kcs_hullpan
import kcs_draft
from KcsModel import Model
from KcsPoint2D import Point2D
upperDeck = Model()
lowerDeck = Model()
kcs_hullpan.pan_store()
kcs_hullpan.pan_skip()
run_XML(XmlFileName, LogFileName)
Generates a number of curved hull object described in the XML document. The objects
described in the XML file will be created and also stored in the data bank.
Input Parameters:
XmlFileName string The full path name of the XML input file.
LogFileName string The full path name of a log file, where you will find
detailed information about the XML generation. If
empty string, log messages will appear in the
standard output log file of curved hull modelling
application.
Returned value:
[0]SuccessList List of A list of all successfully created curved model
KcsModel objects. Each KcsModel object contains type and
objects name.
Exceptions:
kcs_ArgumentError Invalid input parameter.
kcs_Error XML generation failed, see log file.
output_XML(ModelList, OutputFileName)
Get the XML description of existing curved hull model objects.
Input Parameters:
ModelList List of Selects the objects for which an XML description
KcsModel will be created. Each object in the list is an instance
objects of KcsModel. Type and name must be given.
OutputFileName string The XML output file. Full path name of the file. An
existing file will be overridden a non-existing file will
be created.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input parameter.
kcs_ObjNotFound Object not found
Example
# Example: kcs_ex_hull_XML.py
view_shellexp_new(ViewOptions)
Create a shell expansion view.
Input Parameters:
ViewOptions Instance of KcsShellExpView. An object with all the
options to set up a shell expansion view
Returned value:
[0]ViewHandle ElementHan Handle to the new shell expansion view.
dle
Exceptions:
view_bodyplan_new(ViewOptions)
Create a body plan view
Input Parameters:
ViewOptions Instance of KcsBodyPlanView. An object with all the
options to set up a bodyplan view
Returned value:
[0]ViewHandle ElementHan Handle to the new view.
dle
Exceptions:
kcs_Error Failed to create the view.
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
view_curvedpanel_new(Panel, ViewOptions)
Create a curved panel view
Input Parameters:
Panel Model The curved panel to create the view for.
ViewOptions KcsInterpret Instance of KcsInterpretationObject. Options for the
ationObject. view.
CurvedPanel
View
Returned value:
[0]ViewHandle ElementHan Handle to the new view.
dle
Exceptions:
kcs_Error Failed to create the view.
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
kcs_NameOccupied A view of this panel exists in current drawing (same
view name).
kcs_NameOccupied No view with expected name created.
kcs_SubpictureNotValid View created on wrong level.
view_shprof_new(Stiffener)
Create a shell profile view
Input Parameters:
Stiffener KcsModel Instance of KcsModel. Name of the profile to create
a view for.
Returned value:
[0]ViewHandle ElementHan Handle to the new view.
dle
Exceptions:
kcs_Error Failed to create the view.
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
view_devpla_new(Plate)
Create a shell profile view
Input Parameters:
Plate KcsModel Instance of KcsModel. Name of the shell plate to
create a view for.
Returned value:
[0]ViewHandle ElementHan Handle to the new view.
dle
Exceptions:
kcs_Error Failed to create the view.
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
view_modify(ViewHandle)
Get the view options data for a given view
Input Parameters:
ViewHandle ElementHan Handle to the view.
dle
Returned value:
ViewOptions Instance of any of the hull “view option” classes:
KcsCurvedPanelView, KcsShellExpView,
KcsBodyPlaneView or KcsInterpretationObject. The
view option object will be filled with all the view
options that was set when the view was created.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
kcs_HandleInvalid The view handle is invalid or view data is missing.
view_recreate(ViewHandle)
Recreate a given view.
Input Parameters:
ViewHandle ElementHan Handle to view.
dle
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input.
kcs_DrawingNotCurrent There is no current drawing.
Examples
# Example: kcs_ex_hullcurved_views01.py
plate_prop_get(Obj)
To get properties of a shell plate.
Input Parameters:
Obj Instance of KcsModel. Type, name and part id
must be given. This is the shell plate to get data for.
Returned value:
Properties Instance of KcsShPlateProp carrying the data
extracted.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_ObjectNotFound Object not found.
kcs_Error There was a problem in extracting data from the
object.
plate_prop_set(Obj, Prop)
Sets properties for a shell plate. This function will lock the shell plate. To unlock you must
call either “kcs_chm.store” or “kcs_chm.skip”.
Input Parameters:
Obj KcsModel Instance of KcsModel. Type, name and part id
must be given. This is the shell plate to set data for.
Prop KcsShPlateProp Instance of KcsShPlateProp carrying the data to
set.
Returned value:
ResProp Instance of KcsShPlateProp carrying the updated
plate data.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_ObjectNotFound Object not found.
kcs_ObjectLocked Object Locked.
kcs_AccessDenied Access denied.
kcs_Error There was a problem in setting data in the object.
stiffener_split(ObjToSplit, SplittingObj)
Split a shell profile or a shell stiffener at a given position. This function will lock the whole
shell profile. To unlock you must either call “kcs_chm.store” or “kcs_chm.skip”.
Input Parameters:
stiffener_combine(Stiff1, Stiff2)
Combines two shell stiffeners into one. This function will lock the whole shell profile. To
unlock you must call either “kcs_chm.store” or “kcs_chm.skip”.
Input Parameters:
Stiff1 KcsModel Instance of KcsModel. Stiff1 will be combine with
Stiff2.
Stiff2 KcsModel Instance of KcsModel
Returned value:
ResultStiff Instance of KcsModel. If the combine operation
succeeded this is the resulting stiffener.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error The combine failed: Objects do not exist, the
stiffeners are not neighbouring stiffeners or other
error.
stiffener_prop_get(Obj)
To get properties of a shell stiffener.
Input Parameters:
Obj Instance of KcsModel. Type, name and part id must
be given. This is the shell stiffener to get data for.
Returned value:
Properties Instance of KcsShStiffProp carrying the data
extracted.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_ObjectNotFound Object not found.
kcs_Error There was a problem in extracting data from the
object.
stiffener_prop_set(Obj, Prop)
Sets properties for a shell stiffener. This function will lock the shell stiffener. To unlock you
must call either “kcs_chm.store” or kcs_chm.skip”.
Input Parameters:
Obj KcsModel Instance of KcsModel. Type, name and part id must
be given. This is the shell stiffener to set data for.
Prop KcsShStiffPr Instance of KcsShStiffProp carrying the data to set.
op
Returned value:
ResProp Instance of KcsShStiffProp carrying the updated
stiffener data.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_ObjectNotFound Object not found.
kcs_ObjectLocked Object locked.
kcs_AccessDenied Access denied.
kcs_Error There was a problem in setting data in the object.
cpan_hole_create(PanelName, HoleOptions)
Creates a new hole in a curved panel object. The panel will be locked in the data bank.
Use store kcs_chm.store” to store and unlock the panel or “kcs_chm.skip” to discard the
changes and unlock the panel.
Input Parameters:
PanelName string The name of the curved panel.
HoleOptions KCSPanHol This python object contains all the data that
eOptions specifies the shape and position of the new hole.
Please see this python file for documentation.
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error Failed to create the hole.
Examples
# Example: kcs_ex_hull_shellstiff.py
# Example: kcs_ex_hull_shellcurves.py
# Example: kcs_ex_hull_cpanhole.py
# Example: kcs_ex_hull_sh_stiff_prop.py
stiffener_to_profdb(Stiff)
Transfer a given shell profile to the production data base.
Input Parameters:
Stiff KcsModel Instance of KcsModel.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error The transfer failed: Objects do not exist or other error.
FramesIntersectingPanel(Frames)
Returns frames name intersection with panel.
Input Parameters:
Frames MarFrames
Returned value:
String [] List with frames name intersection with panel.
Exceptions:
Mar_InvalidPanelName Invalid panel name.
Mar_IntersectionNotFound Intersection not found.
6.4.4 Store/Skip/Delete/Recreate
store(Model)
Store a curved hull object. This store method works as the store in interactive curved hull.
It is an “intelligent” store, i.e. it will update all related objects.If you choose to store a shell
profile for instance, this function will also store shell stiffeners and trace curves and
update limit tables.
Input Parameters:
Model A KcsModel object.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input
kcs_Error Storing failed: Model objects does not exist, is
locked by another user or other error.
skip(Model)
Skips a curved hull object, i.e. removes any locks set on the object and related objects. (If
you choose to skip a shell profile for instance, the function will also unlock shell stiffeners
and trace curves that belong to the profile.)
Input Parameters:
Model A KcsModel object.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input
kcs_Error Skip failed: Model objects does not exist, is locked
by another user or other error.
delete(Model)
Delete a curved hull object. This store method works as the delete function in interactive
curved hull. It is an “intelligent” delete, i.e. it will also delete/update related objects.If you
choose to delete a shell profile for instance, this function will also delete all shell stiffeners
and trace curves and remove the profile from the limit tables.
Input Parameters:
Model A KcsModel object.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input
kcs_Error Delete failed: Model objects does not exist, is
locked by another user or other error.
recreate(Model)
Recreate a curved hull object.
Input Parameters:
Model A KcsModel object.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid input
kcs_Error Recreate failed: Model object does not exist or
other error.
Examples
# Example: kcs_ex_hull_shellcurves.py
# Example: kcs_ex_hull_shellstiff.py
• Hull curves
• Seams and butts
• Shell stiffeners
• Curves along Jig rows and columns
• Frame curves
• Planar panel limits
• Hole crossmarks
Hole cross-marks are identified by the curved panel (Model class "Name" attribute, "Type"
attribute), hole part ID (Model class "PartId" attribute), subpart type ("SubPartType" attribute
"crossmark") and subpart ID corresponding to horizontal or vertical crossmark position
("SubPartId" attribute 666 or 667). Correct Model class instances are returned by
kcs_draft.model_identify() function.
6.5.1 General
Traditionally there have been two options to create holes in Hull. By use of the inbuilt hole
standards (parameter controlled) or to use any closed curve as hole. A facility has been
developed that allows the customer to set up his own parameter controlled hole standard to
be used in principle the same way as the built-in standard. From a user's point of view such
holes are defined in exactly the same way as the standard holes, i.e. by a hole type (name)
followed by a number of parameters separated by asterisks.
The option to develop a customer specific hole standard is implemented by means of the
Python language. On top Hull has a "hole hook" with the fixed name _TBhookCustHole.
This may branch into several sub-scripts for different hole types. How this is organised is up
to the customer to decide. The customer developed holes are handled by the user interface
in the same way as the in-built standard holes, using the drawing _ _SBH_HOLE_MENU_ _
to create the user dialogue.
A picture, organized as a view of its own and named as the added hole type, must be added
to this drawing. Further details can be found in Setup and Customisation / Customising
Dialog Hull.
A Vitesse script is delivered in the release , _TBhookCustHole, with two example holes
that have the format FH<par1>*<par2> and HOS<par1>*<par2>*<par3>*<par4>
(suitable values for test are FH150*30 and HOS600*400*50*25).
Additional holes can be implemented by expanding this script (or invoking sub-scripts from
it). The name of the script is fixed and it must be placed in the directory indicated by the
global variable PYTHONPATH.
getHoleName(HoleNo):
The function returns the name of the hole from the list of holes.
Input Parameters:
HoleNo integer Index to hole list.
Returned value:
HoleList[HoleNo] string Hole name.
getHoleSegment(SegNo):
The function returns a hole segment from the hole contour.
Input Parameters:
Segno integer Hole segment number.
Returned value:
HoleData[SegNo] reals Segment part R,U,V.
setHoleContour(HoleName, NPar, Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8):
The function creates a customer defined hole by creating hole segments to the HoleData
list. The function should define a hole contour in the UV co-ordinate system whose origin
will be the reference point of the hole. Up to 8 number of hole parameters are allowed.
The breakpoints of the holecontour should be defined as a number of segments (R, U, V),
where R is equal to 0.0 for a line segment, positive for a counterclock radius and negative
for a clockwise radius. The hole code should be implemented with an exception handling
mechanism so that a failure to run the code will always be signalled by the return code.
Input Parameters:
Holename string The name of the customer hole.
Npar real Number of parameters.
Par1 real Hole parameter 1.
Par2 real Hole parameter 2.
Par3 real Hole parameter 3.
Par4 real Hole parameter 4.
Par5 real Hole parameter 5.
Par6 real Hole parameter 6.
Par7 real Hole parameter 7.
Par8 real Hole parameter 8.
Returned value:
6.6.1 General
Non standard brackets have in traditionally had to be generated as bracket panels. This
means that the panel bracket must have been generated as a panel of its own first and then
its "mother" panel must have been activated to enable the panel bracket to be connected.
A feature has been implemented which makes it possible to integrate the modelling of
panels brackets with the normal panel modelling under certain circumstances.
Characteristics of this implementation are:
• It makes use of a Vitesse script in the Python language with the fixed name "
_TBhookCustBracket". This script may contain the definition of any number of panel
brackets (or calls on sub-scripts performing the same task). It is the responsibility of the
customer to develop and maintain this script.
• The hook is activated by a new option in the bracket selection menu with a bracket
symbol and the text "Other brackets". The Vitesse based brackets are selected by
picking (or keying in the short name “V”) the Vitesse symbol in the bracket syntax
selection dialogue.
• When this alternative has been selected, another symbol menu will pop-up containing
symbols, each corresponding to a Vitesse script for an panel bracket. The number of
the selected bracket will be supplied to the bracket hook so that the corresponding
script may be activated. A new symbol font (with number 95) is used to contain these
symbols. It is the responsibility of the customer to update this font as new scripts are
added. A picture representing the new bracket shall be added to the drawing
_ _SBH_BKT_MENU_ _. The added picture shall be organized as a view of its own
and be named in a way that makes it simple to select also by keying in the name.
Further details can be found in Setup and Customisation / Customising Dialogs in Hull.
• After picking control is transferred to the script that will be executed. After execution
control will be returned to the main panel and the generated bracket will automatically
be connected to it.
• It is the responsibility of the customer to see to it the called script generates a proper
panel bracket. Otherwise, the customer has the same options available for generating
bracket panels as when panels otherwise are generated via Vitesse.
The beauty of this implementation is that panel brackets that are so "standardised" that it
makes sense to develop a Vitesse script for them can be generated as belonging to the
panel according to a routine that is similar to that of ordinary standard brackets.
A simple example of the Vitesse hook _TBhookCustBracket is delivered together with the
system. The name of the script is fixed and it must be placed in the directory indicated by
the global variable PYTHONPATH. Condition for this option is that a license for Hull Vitesse
is available.
getBracketName(BraInd)
The function connects the bracket symbol to a bracket name.
Input Parameters:
BraInd integer Bracket number.
Returned values:
BracketList[BraInd] string Bracket name.
setBracketContour(BracketNo, BracketName):
The bracket defining function. New bracket scripts are added in this function.
Input Parameters:
BracketNo integer Bracket number.
BracketName string Bracket name
Returned value:
BraRes integer Result code. The predefined values should be
used.
0 Ok
1 The bracket could not be generated
6.7.1 General
This is a facility which allows the customer to set up his own parameter controlled notch
standard to be used in principally the same way as the built-in standard. From a user's point
of view such notches are defined in exactly the same way as the standard notches, i.e. by a
notch type (name) followed by a number of parameters separated by asterisks.
The option to develop a customer specific notch standard is implemented by means of the
Python language. On top Hull has a "notch hook" with the fixed name _TBhookCustNotch.
This may branch into several sub-scripts for different notch types. How this is organised is
up to the customer to decide. The customer developed notches are handled by the user
interface in the same way as the in-built standard notches, using the drawing _
_SBH_EDGE_NOTCH_MENU_ _ to create the user dialogue.
A picture, organized as a view of its own and named as the added notch type, must be
added to this drawing. Further details can be found in Setup and Customisation /
Customising Dialogs in Hull.
A Vitesse script is delivered in the release , _TBhookCustNotch, with two example nocthes
that have the format NOTA<par1>*<par2> and NOTB<par1>*<par2>.
Additional notches can be implemented by expanding this script (or invoking sub-scripts
from it). The name of the script is fixed and it must be placed in the directory indicated by the
global variable PYTHONPATH.
getNotchName(notchNo):
The function returns the name of the notch from the list of notches.
Input Parameters:
NotchNo integer Index to notch list.
Returned value:
NotchList[NotchNo] string Notch name.
getNotchSegment(SegNo):
The function returns a notch segment from the notch contour.
Input Parameters:
Segno integer Notch segment number.
Returned value:
NotchData[SegNo] reals Segment part R,U,V.
setNotchContour(NotchName, NPar, Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8):
The function creates a customer defined notch by creating segments to the NotchData
list. The function should define a notch contour in the UV co-ordinate system whose origin
will be the reference point of the notch. Up to 8 number of parameters are allowed. The
breakpoints of the contour should be defined as a number of segments (R, U, V), where R
is equal to 0.0 for a line segment, positive for a counter clock radius and negative for a
clockwise radius. The notch code should be implemented with an exception handling
mechanism so that a failure to run the code will always be signalled by the return code.
Input Parameters:
Notchname string The name of the customer notch.
Npar real Number of parameters.
Par1 real Notch parameter 1.
Par2 real Notch parameter 2.
Par3 real Notch parameter 3.
Par4 real Notch parameter 4.
Par5 real Notch parameter 5.
Par6 real Notch parameter 6.
Par7 real Notch parameter 7.
Par8 real Notch parameter 8.
Returned value:
NotchRes integer Result code. The predefined values should be used.
0 OK
1 Unrecognized notch type
2 Wrong number of parameters
3 Unreasonable parameter values
4 Notch geometry could not be generated
7 Weld
7.1 General
Vitesse features access to the functionality in Weld Planning. For more information, see
Weld Planning.
The interface has the following features:
• function to perform a weld calculation and create a weld table
• function to get the calculation result
• functions to change some data in an existing weld table
• function to delete an existing weld table
The functions are made available in the Python program by the insertion of the statement
import kcs_weld. The functions are then referred to as kcs_weld.<function name>. Before
using a new function, please carefully read the function description.
weld_calculation(assembly_name,recursive)
Starts the weld detection for the given assembly, and optionally also for all its sub-
assemblies.
Input parameters:
assembly_name string Path name of the assembly
recursive integer 0 = only the given assembly
1 = include all sub-assemblies
Returned value:
0 Error in weld calculation
1 Weld calculation OK
Exceptions:
kcs_ModelNotFound Assembly not found
kcs_Error General error
weld_properties_get(assembly_name, weld_table)
Returns the result of the weld detection.
Input parameters:
assembly_name string Path name of the assembly
Output parameters:
weld_table WeldTable Instance of KcsWeldTable.WeldTable class
Returned value:
[0] integer 1 = Success
Exceptions:
kcs_AssemblyNotFound Assembly not found
kcs_PythonMethodNotFound Python method not found. Check your KcsWeldTable
implementation file.
kcs_ArgumentError Invalid arguments list.
weld_properties_set(assembly_name, weld_table)
Updates an existing weld table.
Input parameters:
assembly_name Path name of the assembly
Weld_table Instance of KcsWeldTable.WeldTable
Returned value:
0 Error updating weld table
1 OK
Exceptions:
kcs_ModelNotFound Assembly not found
weld_delete(assembly_name)
Deletes the weld table object on data bank
Input parameters:
assembly_name Path name of the assembly
Returned value:
0 Error deleting weld table
1 OK
Exceptions:
kcs_ModelNotFound Assembly not found
kcs_Error General error
8 Model Structures
8.1 General
The functions are made available in the Python program by the insertion of the statement
import kcs_modelstruct. The functions are then referred to as kcs_modelstruct.<function
name>. Before using a new function, please carefully read the function description.
The Vitesse Model Structures interface contains functions for:
• Creating and Deleting Hull blocks
8.3 Functions
block_delete(name)
The function deletes existing hull block.
Input Parameters:
name string Name of hull block
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DoesNotExist Specified block does not exist.
kcs_Error General error. Block can not be
deleted.
9.1 General
The Geometry Macro Facility is a program used to create predefined geometry. The main
purpose of using geometry macros in is to create design standards. Example of such
standards are profile cutouts in Hull.
Note: Previous versions of the system further allowed any user to define geometry macros
creating drawings and sub-pictures. However, this is in AVEVA Marine no longer
supported. Instead Vitesse functions for Drafting should be used. Consequently, the
information about Geometry Macro, as given in this section is only documented for
reference, not to be used by AVEVA Marine customers.
9.2 Introduction
In interactive applications, 2D drawings are built up by different interactive functions of the
applications. Similarly, 3D figures can be created by the combination of volume primitives.
These operations normally work on entity level, i.e. by the addition of lines, arcs, texts, etc.
or by the duplication of information of the drawing.
However, in many situations the drawing or volume to be created is parenthesized, i.e.
controlled by a relatively small number of parameters and/or conditions.
The Geometry Macro Facility has been developed as a tool to create such drawings/
volumes by defining a number of parameters in calls of geometry macros.
A geometry macro is written as a text in a format like a programming language.
The elements of the language are:
• the geometrical entities that can be created
• "program logic", like branching and loops
• basic arithmetics, logical and trigonometrical operations
Details about all these things can be found below.
9.3 Functions
• vector
• line
• arc
• circle
• contour
• spline
• symbol
• text
• text file
• layer
• line type
• attribute
• note
• hatch pattern
A geometry macro used for volumes may generate the following entities:
• point
• vector
• parallelepiped
• cylinder
• cone
• spherical segment
• general cylinder
• toroid
• polygon
• rotational primitive
• attribute
One geometry macro can define either a 2D drawing/sub-picture or a 3D volume. However,
some of the volume primitives use 2D entities as parameters.
+ add
- change sign
% division
** exponentiation
== qual
greater equal
less equal
* multiplication
OR logical or
- subtraction
AB absolute value
SUBSTR substrings
1. Print on terminal
2. Create 2D geometry and store on data bank
3. Create 3D volume model and store on data bank
4. Create 3D volume model + picture and store on data bank
9.4 Appendices
< >term
....preceding expression may be repeated
• Statement Types
The input language contains the following different statement types:
• Statement Syntax
Below, the complete syntax of each statement type is described.
ARC,<arc_name>,<start_pnt>
[/ARCMIDPNT=(<mid_pnt>,<end_pnt>)]
[/ARCRADIUS=(<end_pnt>,<rad>)]
[/ARCAMPLITUDE=(<end_pnt>,<ampl>)];
<arc_name> is the name of the arc and will be assigned the type ARC_2D. The
maximum length of <arc_name> is 32 characters.
<start_pnt> is the starting point of the arc with type POINT_2D.
ARCMIDPNT=(<mid_pnt>,<end_pnt>)
<mid_pnt> is the mid point of the arc when the arc is defined by giving three
points. It has the type POINT_2D.
<end_pnt> is the ending point of the arc with type POINT_2D.
ARCRADIUS=(<end_pnt>,<rad>)
<end_pnt> is the ending point of the arc with type POINT_2D.
<rad> is the arc radius when the arc is defined by giving two points + radius. It
has the type DECIMAL.
ARCAMPLITUDE=(<end_pnt>,<ampl>)
<end_pnt> is the ending point of the arc with type POINT_2D.
<ampl> is the arc amplitude when the arc is defined by giving two points +
amplitude. It has the type DECIMAL.
Structure:
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(N,<arc_name>,'NSEG')
/STRUCTURE=(X,<arc_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<arc_name>,'AMPLITUDE',2,'Y');
ASSIGN,<variable_1>,<variable_2>
[/XCOORD]
[/YCOORD]
[/ZCOORD];
<variable_1> is assigned the same value as <variable_2> and will get the
same type as the first one. The maximum length of <variable_1> and
<variable_2> is 32 characters. <variable_2> can be an expression or have
any of the following types:
INTEGER
DECIMAL
STRING
POINT_2D
LINE_2D
ARC_2D
CONTOUR_2D
CIRCLE_2D
VECTOR_2D
SPLINE_2D
TEXTFILE_2D
TEXT_2D
SYMBOL_2D
NOTE_2D
HATCH_2D
EXTRACT
RANGE
TABLE
POINT_3D
VECTOR_3D
CONNECTIONPOINT_3D
CONE_3D
CYLINDER_3D
GENERALCYLINDER_3D
PARALLELEPIPED_3D
POLYGON_3D
SPHERESEG_3D
TOROID_3D
ROTATIONAL_3D
XCOORD
If <variable2> is of type POINT_2D or POINT_3D, then <variable1> can
be assigned the x coordinate of <variable2>. This variable will get type
DECIMAL.
YCOORD
If <variable2> is of type POINT_2D or POINT_3D, then <variable1> can
be assigned the y coordinate of <variable2>. This variable will get type
DECIMAL.
ZCOORD
If <variable2> is of type POINT_3D, then <variable1> can be assigned
the z coordinate of <variable2>. This variable will get type DECIMAL.
ATTRIBUTE,<attr_no>
/ATTRDATA=(<variable>,<attribute>)....;
<attr_no> is the attribute number (> 0) and must be given within ' ' if it is addressed
with an alias name. If <attr_no> is a true number or a variable, it shall not be
given within ' '. The maximum length of <attr_no> as an alias is 26 characters and
as a variable 32 characters.
ATTRDATA=(<variable>,<attribute>)....
<variable> is the variable name given as an alias or using the default names.
These are I1 - I100 for the integers, R1 - R50 for the reals and S1 - S12 for the
strings. <variable> shall always be given within ' '. The maximum length of
<variable> as an alias is 26 characters and as a variable 32 characters.
<attribute> is the data to be stored in the attribute as an integer, real or string
(max 26 characters). <attribute> must be given within ' ' if it is a string but not
if it is a true number or a variable. The maximum length of <attribute> as a
variable is 32 characters.
CALL,<macro_name>
[,<arg_1>[,<arg_2>....[,<arg_25>]....]];
<macro_name> is the name of the submacro. The maximum length of
<macro_name> is 32 characters. Only upper case letters and _ are allowed
characters. <arg_1>,<arg_2>, ....,<arg_25> are the arguments to the
submacro. They cannot be expressions but must be variables. Any type is allowed. It
is important to notice that if a parameter in the submacro is changed, the
corresponding argument in the calling macro will also be changed. Thus, it is of great
advantage if an argument is used for either input or output.
CHANGEDRAW,<obj_type>,<obj_name>
/COMPID=(<comp_id>)
/MARKINGCOLOUR=(<marking_colour>)
/SUBCOMPID=(<subcomp_id>)
/VIEW=(<view_id>);
<obj_type> is a keyword describing the type of the object. The following keywords
exist:
PANEL plane and curved panel objects
CWAY cableway object
CABLE cable objects
EQUIP equipment objeACT
The object type must be a STRING constant.
<obj_name> is the name of the object to be changed, and has the type STRING.
<comp_id> is the id of a component of the type INTEGER, and is only used in the
case of changing a single component.
<marking_colour> is the new colour of the object. It has the type STRING. The
maximum length of <marking_colour> is 32 characters. If DEFAULT is assigned
as <marking_colour>, the geometry will be redrawn in the default colour. In a
modelling view the default colour is determined by the model and in a diagram view
the default colour is determined by the General Diagram default file and, if applicable,
pipe specification.
See Drafting_Appendices for valid colours
<subcomp_id> is used in the same manner as <comp_id>, but for
subcomponents. It has the type INTEGER.
<view_id> is the id of the view in which to change the object, and has the type
INTEGER. If not given, the appearance of the object is changed in all views of the
current drawing.
CIRCLE,<circ_name>,<circ_cent>,<circ_rad>;
<circ_name> is the name of the arc and will be assigned the type CIRCLE_2D.
The maximum length of <circ_name> is 32 characters.
<circ_cent> is the centre point of the circle with type POINT_2D.
<circ_rad> is the radius of the circle. It has the type DECIMAL.
Structure:
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(N,<circ_name>,'NSEG')
/STRUCTURE=(X,<circ_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<circ_name>,'AMPLITUDE',2,'Y');
COLOUR,<col>;
<col> is the new modal colour. It has the type STRING. The maximum length of
<col> is 32 characters.
See Drafting_Appendices for valid colours.
Empty String means the background colour.
CONE,<cone_name>,<rad_1>,<rad_2>
/COORDCONE=(<cl_pnt_1>,<cl_pnt_2>);
<cone_name> is the name of the cone and will be assigned the type CONE_3D.
The maximum length of <cone_name> is 32 characters.
<rad_1> and <rad_2> are the radii of the bottom and top circles respectively with
type DECIMAL.
COORDCONE=(<cl_pnt_1>,<cl_pnt_2>)
<cl_pnt_1> and <cl_pnt_2> are the centre line starting and ending points,
respectively. They have the type POINT_3D.
Structure:
PNT(1:3) (POINT_3D)
VEC(1:3) (VECTOR_3D)
BASE (DECIMAL)
TOP (DECIMAL)
Example:
GET/STRUCTURE=(X,<cone_name>,'PNT',1)
/STRUCTURE=(Z,<cone_name>,'VEC',3)
/STRUCTURE=(R1,<cone_name>,'BASE')
/STRUCTURE=(R2,<cone_name>,'TOP');
CONNECTIONPOINT,<conn_name>,<conn_type>,<conn_no>,
<conn_pnt>,<conn_vect>,<conn_desc>;
<conn_name> is the name of the connection point and will be assigned the type
CONNECTIONPOINT_3D. The maximum length of <conn_name> is 32 characters.
<conn_type> is the connection type of type INTEGER. Only types between 1 and 9
are valid.
<conn_no> is the connection number of type INTEGER. Only numbers between 1
and 199 are valid.
<conn_pnt> is the connection point defining the position. It has the type
POINT_3D.
<conn_vect> is the connection vector defining the direction. It has the type
VECTOR_3D.
<conn_desc> is the connection description of type STRING. Maximum length of
<conn_desc> is 100 characters.
Structure:
CONTYPE (INTEGER)
CONNUMBER (INTEGER)
PNT(1:3) (DECIMAL)
VEC(1:3) (DECIMAL)
DESCR (STRING)
Example:
GET/STRUCTURE=(T,<conn_name>,'CONTYPE')
/STRUCTURE=(N,<conn_name>,'CONNUMBER')
/STRUCTURE=(X,<conn_name>,'PNT',1)
/STRUCTURE=(Y,<conn_name>,'VEC','Z')
/STRUCTURE=(D,<conn_name>,'DESCR');
ARCMIDPNT=(<mid_pnt>,<end_pnt>)
<mid_pnt> and <end_pnt> are the mid and ending points of the arc. They
have the type POINT_2D. The starting point is defined by <start_pnt> or by
the ending point of the previous segment.
ARCRADIUS=(<end_pnt>,<rad>)
<end_pnt> is the ending point of the arc with the type POINT_2D. The starting
point is defined by <start_pnt> or by the ending point of the previous
segment.
<rad> is the arc radius when the arc is defined by giving two points + radius. It
has the type DECIMAL.
ARCAMPLITUDE=(<end_pnt,<ampl>)
<end_pnt> is the ending point of the arc with the type POINT_2D. The starting
point is defined by <start_pnt> or by the ending point of the previous
segment.
<ampl> is the arc amplitude when the arc is defined by giving two points +
amplitude. It has the type DECIMAL.
CONTOUR=<cnt_name>
<cnt_name> is the name of the contour and has the type CONTOUR_2D. If
<cnt_name> is not the first segment in the contour, the starting point of
<cnt_name> will be ignored. No check is made whether this point coincides with
the ending point of the previous segment.
LINE=<line_name>
<line_name> is the name of the line and has the type LINE_2D. If
<line_name> is not the first segment in the contour the starting point of
<line_name> will be ignored. No check is made whether this point coincides
with the ending point of the previous segment or not.
LINEEND=<end_pnt>
<end_pnt> is the ending point of the line with the type POINT_2D. The starting
point is defined by <start_pnt> or by the ending point of the previous
segment.
LINEANGLE=(<len>,<ang>)
<len> is the length of the line and <ang> is the angle of the line, both with type
DECIMAL. The starting point is defined by <start_pnt> or by the ending point
of the previous segment.
LINEOFFS=<offs>
<offs> is the offset from the current point. It has the type STRING with at most
72 characters. The following formats are valid:
du, dv (e.g. 100,50) or
length, angle (e.g. 100,45D) or
length, verbal direction (e.g. 100,N).
Verbal directions can be North, South, West, East, Right, Left, Up or Down. Only
the first letter is relevant. If the string ends with a 'U' or a 'V', the u axis or the v axis
will be locked. Angles must be followed by D (degrees) or R (radians).
The strings must only contain digits, a '-' or a '.'. '-' is only valid in the first position.
Between the strings, it is allowed to have a couple of ' ' and ',' but at least one,
either a ' ' or a ','. If one of the letters mentioned above is at a valid position, the
rest of the string is ignored. Spaces in the beginning or the end of the string are
removed.
SPLINE=<spl_name>
<spl_name> is the name of the spline and has the type SPLINE_2D. If
<spl_name> is not the first segment in the contour, the starting point of
<spl_name> will be ignored. No check is made whether this point coincides with
the ending point of the previous segment or not.
Structure:
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(N,<cnt_name>,'NSEG')
/STRUCTURE=(X,<cnt_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<cnt_name>,'AMPLITUDE',2,'Y');
CURRENT[/SUBPICTURE=(<view_name>,<subview_name>)
[/VIEWSCALE=<view_scl>]]
[/SUBVOLUME=<subvol_no>];
SUBPICTURE=(<view_name>,<subview_name>)
[/VIEWSCALE=<view_scl>]
<view_name> is the name of the view. It has the type STRING. The maximum
length of <view_name> is 26 characters. If <view_name> does not exist a new
view and a new subview are created. The subview will get the name
<subview_name>.
<subview_name> is the name of the subview. It has the type STRING. The
maximum length of <subview_name> is 26 characters. If <subview_name>
does not exist a new subview is created.
<view_scl> is the scale to be used when a new view is created. It has the type
DECIMAL. If this attribute is not given then the view scale will be the same as the
drawing scale (given in the NAME statement).
A new component is always created when a macro is run. This is the case even if the
CURRENT statement is not present.
SUBVOLUME=<subvol_no>
<subvol_no> is the number of the subvolume. It has the type INTEGER. If
<subvol_no> does not exist it is created.
CYLINDER,<cyl_name>,<rad>
/COORDCYL=(<cl_pnt_1>,<cl_pnt_2>;
<cyl_name> is the name of the cylinder and will be assigned the type
CYLINDER_3D. The maximum length of <cyl_name> is 32 characters.
<rad> is the radius of the cylinder with type DECIMAL.
COORDCYL=(<cl_pnt_1>,<cl_pnt_2>)
<cl_pnt_1> and <cl_pnt_2> are the centre line starting and ending points,
respectively. They have the type POINT_3D.
Structure:
PNT(1:3) (DECIMAL)
VEC(1:3) (DECIMAL)
BASE (DECIMAL)
Example:
GET/STRUCTURE=(X,<cyl_name>,'PNT',1)
/STRUCTURE=(Y,<cyl_name>,'VEC','Y')
/STRUCTURE=(R,<cyl_name>,'BASE');
DECLARE,<variable>,<type>;
<variable> is the name of the variable whose type is to be declared. The
maximum length of <variable> is 32 characters.
<type> is the type of <variable>. It has the type STRING and the whole type
name must be given. The following types are available:
INTEGER
DECIMAL
STRING
POINT_2D
LINE_2D
ARC_2D
CONTOUR_2D
CIRCLE_2D
VECTOR_2D
SPLINE_2D
TEXTFILE_2D
TEXT_2D
SYMBOL_2D
NOTE_2D
HATCH_2D
EXTRACT
RANGE
TABLE
POINT_3D
VECTOR_3D
CONNECTIONPOINT_3D
CONE_3D
CYLINDER_3D
GENERALCYLINDER_3D
PARALLELEPIPED_3D
POLYGON_3D
SPHERESEG_3D
TOROID_3D
ROTATIONAL_3D
The default type is DECIMAL.
DELAY,<del_time>;
<del_time> is the delay time in seconds. It has the type DECIMAL.
DISTANCE,<variable_1>,<variable_2>
<variable_1> is assigned the same value as <variable_2> and will get the
same type as the first one. The maximum length of <variable_1> and
<variable_2> is 32 characters. <variable_2> can be an expression, an
integer constant or a decimal constant.
When the DISTANCE statement is used <variable_1> will be scaled with the
current scale. This is not the case when the ASSIGN statement is used.
DRAWING_NAME, <name_drawing>;
This statement assigns the name of current drawing to <name_drawing> which is
a string parameter. If there is no current drawing, the statement prompts the user to
supply the name as text either in input window or on terminal.
ELSE;
This statement must be used together with the IF statement.
ENDIF;
The ENDIF statement terminates the IF statement.
ENDLOOP;
The ENDLOOP statement terminates the LOOP statement.
ENDMACRO;
The ENDMACRO statement terminates the MACRO statement.
ENDWHILE;
The ENDWHILE statement terminates the WHILE statement.
EXTRACTION,<dex_name>,<dex_str>;
<dex_name> is the name of the data extraction variable and has the type EXTRACT.
The maximum length of <dex_name> is 32 characters.
<dex_str> is the data extraction string and has the type STRING. For further
information, see documentation in User's Guide Data Extraction.
GENERALCYLINDER,<gencyl_name>,<cnt_name>,<thick>,
<pnt_1>,<pnt_2>,<pnt_3>;
<gencyl_name> is the name of the general cylinder and will be assigned the type
GENERALCYLINDER_3D. The maximum length of <gencyl_name> is 32
characters.
<cnt_name> is the name of a 2D contour (with type CONTOUR_2D) which has
previously been defined.
<thick> is the thickness of the general cylinder and has the type DECIMAL.
<pnt_1> is the origin of the general cylinder.
<pnt_2> and <pnt_3> defines together with <pnt_1> the orientation in space.
The u vector is given by <pnt_2> and <pnt_1> and the v vector by <pnt_3> and
<pnt_1>.
<pnt_1>, <pnt_2> and <pnt_3> all have the type POINT_3D.
Structure:
PNT(1:3) (DECIMAL)
UVEC(1:3) (DECIMAL)
VVEC(1:3) (DECIMAL)
THICK (DECIMAL)
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:)
GET/STRUCTURE=(PX,<gencyl_name>,'PNT',1
/STRUCTURE=(N,<gencyl_name>,'NSEG')
/STRUCTURE=(X,<gencyl_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<gencyl_name>,'AMPLITUDE',2,'Y');
GET
[/INTEGER=(<prompt>,<int>)]
[/DECIMAL=(<prompt>,<dec>)]
[/STRING=(<prompt>,<str>)]
[/DISTANCE=(<prompt>,<dist>)]
[/POINT_2D=(<prompt>,<pnt>)]
[/POINT_3D=(<prompt>,<pnt>)]
[/EXTRACT=(<variable>,<status>,<dex_name>,<arg_1>
[,<arg_2]...[,<arg_10>]..]])]
[/RANGE=(<rng_name>,<status>,<dex_name>[,<arg_1>
[,<arg_2]...[,<arg_10>]..]])]
[/STRUCTURE=(<variable>,<struct_name>,<arg_1>
[,<arg_2]...[,<arg_10>]..]])];
[/MODEL_NAME=(<prompt>, <status>, <name_model>,
<name_component>)];
[/VIEW_ID=(<prompt>, <get_viewid>)];
<prompt> is a text displayed at the workstation before entering any values. It
has the type STRING and the maximum length is 100 characters. <prompt> has
the same meaning for the following attributes to the GET statement.
INTEGER=(<prompt>,<int>)
<int> is the integer value which has been given as input at the workstation.
DECIMAL=(<prompt>,<dec>)
<dec> is the decimal value which has been given as input at the workstation.
STRING=(<prompt>,<str>)
<str> is the string value which has been given as input at the workstation.
DISTANCE=(<prompt>,<dist>)
<dist> is a distance which has been given as input at the workstation. By
default, the <dist> is given as the distance between two cursor positions (or any
other point mode) but it is possible to key in <dist> by answering REJECT at
the first cursor position. <dist> has the type DECIMAL.
It is important to use DISTANCE and not DECIMAL when a distance is wanted,
because the current scale is taken care of in DISTANCE but not in DECIMAL.
POINT_2D=(<prompt>,<pnt>)
<pnt> is a point which has been given as input at the workstation. The default
point mode is cursor position but it is possible to use any of the other available
modes. <pnt> has the type POINT_2D.
POINT_3D=(<prompt>,<pnt>)
<pnt> is a point which has been given as input at the workstation. The default
point mode is cursor position but it is possible to use any of the other available
modes. <pnt> has the type POINT_3D.
EXTRACT=(<variable>,<status>,<dex_name>,<arg_1>[,<arg_
2>]... [,<arg_10>]..]]) Optional function.
<variable> is the name of the variable to be assigned. It can have the type
INTEGER, DECIMAL or STRING. The maximum length of <variable> is 32
characters.
<status> is a variable giving the status of <variable>. It can have the
following INTEGER values:
0<variable> not defined
1<variable> defined
Before using <variable>, there must always be a test on <status> to
ensure that <variable> is defined. Otherwise the macro will be aborted.
<dex_name> is the name of the data extraction variable and has the type
EXTRACT. The maximum length of <dex_name> is 32 characters.
<arg_1>[,<arg_2>]...[,<arg_10>]..]] are the arguments
corresponding to the data extraction keywords, from the top level down to the
bottom level. These arguments can have the type INTEGER, DECIMAL or
STRING.
RANGE=(<rng_name>,<status>,<dex_name>[,<arg_1>[,<arg_2
>]... [,<arg_10>]..]]) Optional function.
<rng_name> is the name of the range which was the result of the extraction. It
has the type RANGE. The maximum length of <rng_name> is 32 characters.
The range can for instance contain the resulting object names.
<status> is a variable giving the status of <rng_name>. It can have the
following INTEGER values:
0<rng_name> not defined
1<rng_name> defined
HATCH,<hatch_name>,<hatch_cnt>,<hatch_type>
[/HATCHANGLE=<hatch_angle>]
[/HATCHDISTANCE=<hatch_dist>]
[/USERDEFINED=(<hatch_page>,<hatch_number>]
[/ISLAND=<island_cnt>];
<hatch_name> is the name of the hatch pattern and has the type HATCH_2D. The
maximum length of <hatch_name> is 32 characters.
<hatch_type> is the type of hatch pattern. It has the type INTEGER. The following
types are available:
1 normal, positive angle
2 normal, negative angle
3 cross-hatching
4 user defined
HATCHANGLE=<hatch_angle>
<hatch_angle> is the angle of the hatch pattern lines. It has the type
DECIMAL. The default angle is 60 degrees.
HATCHDISTANCE=<hatch_dist>
<hatch_dist> is the distance between the hatch pattern lines. It has the type
DECIMAL. The default distance is 5 mm.
USERDEFINED=<hatch_page>,<hatch_number>
<hatch_page> is the page number (1-999) in the standard book for user
defined hatch patterns. It has the type INTEGER.
<hatch_number> is the standard number (1-8) within the page
<hatch_page> in the standard book for user defined hatch patterns. It has the
type INTEGER.
/ISLAND=<island_cnt>
<island_cnt> is the island contour where the hatch pattern shall be removed.
It is of the type CONTOUR_2D or TEXT_2D.
Structure:
TYPE (INTEGER)
ANGLE (DECIMAL)
DISTANCE (DECIMAL)
PAGE (INTEGER)
NUMBER (INTEGER)
NSEG (INTEGER)
ISLANDS (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(T,<hatch_name>,'TYPE'
/STRUCTURE=(A,<hatch_name>,'ANGLE')
/STRUCTURE=(D,<hatch_name>,'DISTANCE')
/STRUCTURE=(P,<hatch_name>,'PAGE')
/STRUCTURE=(M,<hatch_name>,'NUMBER')
/STRUCTURE=(N,<hatch_name>,'NSEG')
/STRUCTURE=(I,<hatch_name>,'ISLANDS')
/STRUCTURE=(X,<hatch_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<hatch_name>,'AMPLITUDE',2,'Y');
- The IF Statement
IF,<cond>;
<cond> is the condition to be tested. It has the type
BOOLEAN.
LAYER,<lay_no>;
<lay_no> is the layer number (> 0) and must be given within ' ' if it is addressed with
an alias name. If <lay_no> is a true number or a variable, it shall not be given within
' '. If <lay_no> refers to a layer class, it must be preceded by # and directly followed
by the class number or the class name. In this case, <lay_no> shall be given within
' '.
The maximum length of <lay_no> as an alias is 26 characters and as a variable 32
characters.
LINE,<line_name>,<stp_pnt>
[/LINEEND=<end_pnt>]
[/LINEANGLE=(<len>,<ang>)]
[/LINEOFFS=<offs>];
<line_name> is the name of the line and has the type LINE_2D. The maximum
length of <line_name> is 32 characters.
<stp_pnt> is the starting point of the line with the type POINT_2D.
LINEEND=<end_pnt>
<end_pnt> is the ending point of the line with the type POINT_2D.
LINEANGLE=(<len>,<ang>)
<len> is the length of the line and <ang> is the angle of the line, both with type
DECIMAL.
LINEOFFS=<offs>
<offs> is the offset from the current point. It has the type STRING with at most
72 characters. The following formats are valid:
du, dv(e.g. 100,50) or
length, angle(e.g. 100,45D) or
length, verbal direction (e.g. 100,N).
Verbal directions can be North, South, West, East, Right, Left, Up or Down. Only
the first letter is relevant. If the string ends with a 'U' or a 'V', the u axis or the v axis
will be locked. Angles must be followed by D (degrees) or R (radians).
The strings must only contain digits, a '-' or a '.'. '-' is only valid in the first position.
Between the strings, it is allowed to have a couple of ' ' and ',' but at least one,
either a ' ' or a ','. If one of the letters mentioned above is at a valid position, the
rest of the string is ignored. Spaces in the beginning or the end of the string are
removed.
Structure:
STARTPNT(1:2) (DECIMAL)
ENDPNT(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(X,<line_name>,'STARTPNT',1)
/STRUCTURE=(Y,<line_name>,'ENDPNT','Y'
LINETYPE,<lin_type>
[/LINEWIDTH=<lin_wid>];
<lin_type> is the modal line type to be used. It has the type INTEGER. Default
line type is 1 (solid). The types 1 - 5 are available.
LINEWIDTH=<lin_wid>
<lin_wid> is the modal line width to be used. It has the type INTEGER. Default
line width is 1 (thin). The types 1 - 3 are available.
LOOP,<loop_var>,<range>;
<loop_var> is the loop variable and the type is dependent on how <range> is
given.
<range> can be given in three ways:
<start_value>:<end_value>
or
<start_value>:<end_value> :: <step_value>
or
<range>
where <range> has the type RANGE.
In the to first cases <loop_var> can have the type INTEGER or DECIMAL. If
<range> has the type RANGE then <loop_var> can also have type STRING.
When <step_value> is omitted, it is by default put to 1.
<start_value>, <end_value> and <step_value> have the type
DECIMAL.
MACRO,<macro_name>
[,<arg_1>[,<arg_2>....[,<arg_25>]....]];
<macro_name> is the name of the macro. The maximum length of
<macro_name> is 32 characters. Only upper case letters, digits and _ are allowed
characters. <arg_1>,<arg_2>, ....,<arg_25> are the arguments to the
macro. They cannot be expressions but must be variables. All types given in the
ASSIGN statement are allowed.
NAME,<dwg_name>
[/DWG]
[/FORM=<form_name>]
[/PICT]
[/SCALE=<dwg_scale>]
[/VOLUME=(<xmax>,<ymax>)];
<dwg_name> is the name of the drawing/subpicture/ volume to be created and
stored on a data bank. If the NAME statement is omitted, <macro_name> will be
used. <dwg_name> has the type STRING and the maximum length is 32 characters.
If the drawing/subpicture/volume given by <dwg_name> already exists on the data
bank, the geometry created by the macro will be added to the existing object.
DWG
This attribute is used to specify that a drawing is to be created.
FORM=<form_name>
<form_name> is the name of the form to be used, if any. <form_name> has
the type STRING and the maximum length is 32 characters.
PICT
This attribute is used to specify that a subpicture is to be created.
SCALE=<dwg_scale>
<dwg_scale> is the drawing/subpicture scale to be used. The default scale is
1:50. <dwg_scale> has the type DECIMAL.
VOLUME=(<xmax>,<ymax>)
<xmax> and <ymax> are the x and y extensions for the volume to be created.
They have the type DECIMAL.
NOTE,<note_name>,<start_pnt>,<ref_cnt>,<note_text>
[/NOTESYMBOL=<note_symb>]
[/REFSYMBOL=<ref_symb>];
<note_name> is the name of the note and has the type NOTE_2D. The maximum
length of <note_name> is 32 characters.
<start_pnt> is the starting point of the reference lines of the note. It has the type
POINT_2D.
<ref_cnt> is the reference lines of the note. It has the type CONTOUR_2D. This
contour must have been defined previously.
<note_text> is the text in the note (with type TEXT_2D) which has previously
been defined.
NOTESYMBOL=<note_symb>
<note_symb> is the number of the note symbol. It has the type INTEGER. The
default note symbol is number 31.
REFSYMBOL=<ref_symb>
<ref_symb> is the number of the reference symbol. It has the type INTEGER.
The default reference symbol is number 21.
Structure:
TEXT (STRING)
NOTESYMB (INTEGER)
REFSYMB (INTEGER)
PNT(1:2) (DECIMAL)
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(NS,<note_name>,'NOTESYMB')
/STRUCTURE=(RS,<note_name>,'REFSYMB')
/STRUCTURE=(SX,<note_name>,'PNT',1)
/STRUCTURE=(N,<note_name>,'NSEG')
/STRUCTURE=(X,<note_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<note_name>,'AMPLITUDE',2,'Y');
PARALLELEPIPED,<para_name>
[/COORDPARA=(<corn_1>,<corn_2>,<corn_3>)]
[/CENLINPARA=(<cl_pnt_1>,<cl_pnt_2>,<corn>)];
<para_name> is the name of the parallelepiped and has the type
PARALLELEPIPED_3D. The maximum length of <para_name> is 32 characters.
COORDPARA=(<corn_1>,<corn_2>,<corn_3>)
<corn_1> is the origin of the parallelepiped and the lower right corner when
looking in the direction of the centre line. <corn_2> is the upper right corner at
the end surface when looking in the same direction. <corn_3> is then, in the
same way, the upper left corner at the end surface.
<corn_1>, <corn_2> and <corn_3> all have the type POINT_3D.
COORDPARA=(<cl_pnt_1>,<cl_pnt_2>,<corn>)
<cl_pnt_1> is the starting point of the centre line and <cl_pnt_2> is the
ending point of the centre line.
<corn> is the upper left corner at the end surface when looking in the direction of
the centre line.
<cl_pnt_1>, <cl_pnt_2> and <corn> all have the type POINT_3D.
Structure:
PNT(1:3) (DECIMAL)
UVEC(1:3) (DECIMAL)
VVEC(1:3) (DECIMAL)
LENGTH (DECIMAL)
Example:
GET/STRUCTURE=(X,<para_name>,'PNT',1)
/STRUCTURE=(Y,<para_name>,'UVEC',2)
/STRUCTURE=(Z,<para_name>,'VVEC','Z')
/STRUCTURE=(L,<para_name>,'LENGTH');
POINT_2D,<pnt_name>,<x>,<y>;
<pnt_name> is the name of the point and has the type POINT_2D. The maximum
length of <pnt_name> is 32 characters.
<x> and <y> are the x and y coordinates of the point, both with type DECIMAL.
If only one of the coordinates of a previously defined point are to be changed, the
other one is simply omitted.
Structure:
PNT(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(X,<pnt_name>,'PNT',1)
/STRUCTURE=(Y,<pnt_name>,'PNT','Y');
POINT_3D,<pnt_name>,<x>,<y>,<z>;
<pnt_name> is the name of the point and has the type POINT_3D. The maximum
length of <pnt_name> is 32 characters.
<x>, <y> and <z> are the x, y and z coordinates of the point, all with type DECIMAL.
If only one of the coordinates of a previously defined point shall be changed, the
others are simply omitted.
Structure:
PNT(1:3) (DECIMAL)
Example:
GET/STRUCTURE=(X,<pnt_name>,'PNT','X')
/STRUCTURE=(Y,<pnt_name>,'PNT',2)
/STRUCTURE=(Z,<pnt_name>,'PNT','Z');
POLYGON,<pol_name>,<stp_pnt>
/LINEPOLYGON=<end_pnt>....;
<pol_name> is the name of the polygon and has the type POLYGON_3D. The
maximum length of <pol_name> is 32 characters.
<stp_pnt> is the starting point of the polygon with the type POINT_3D.
LINEPOLYGON=<end_pnt>....
<end_pnt> is the ending point of the polygon segment with the type
POINT_3D.
Structure:
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:3) (DECIMAL)
AMPLITUDE(1:3) (DECIMAL)
Example:
GET/STRUCTURE=(N,<pol_name>,'NSEG')
/STRUCTURE=(X,<pol_name>,'ENDPNT',N,1)
/STRUCTURE=(Y,<pol_name>,'AMPLITUDE',2,'Y');
PRESENT,<var_name>;
<var_name> is the name of the variable which is to be presented. It can have any of
the following types:
POINT_2D
LINE_2D
ARC_2D
CIRCLE_2D
CONTOUR_2D
SPLINE_2D
SYMBOL_2D
TEXT_2D
TEXTFILE_2D
NOTE_2D
TABLE
CONNECTIONPOINT_3D
CONE_3D
CYLINDER_3D
PARALLELEPIPED_3D
POLYGON_3D
ROTATIONAL_3D
TOROID_3D
SPHERESEG_3D
GENERALCYLINDER_3D
The maximum length of <var_name> is 32 characters.
PUT,<var_name>;
<var_name> is the name of the variable which contents is to be written. It can have
any type. The maximum length of <var_name> is 32 characters.
RANGE,<rng_name>
[/FILENAME=<file_name>];
<rng_name> is the name of the range and has the type RANGE. The maximum
length of <rng_name> is 32 characters.
FILENAME=<file_name>
<file_name> is the file where the range is stored. It has the type STRING. The
file contains a number of integer numbers OR decimal numbers OR strings, one
on each line.
ROTATIONAL,<rot_name>,<cnt_name>,<pnt>,<vec>;
<rot_name> is the name of the rotational primitive and will be assigned the type
ROTATIONAL_3D. The maximum length of <rot_name> is 32 characters.
<cnt_name> is the name of a 2D contour (with type CONTOUR_2D) which has
previously been defined.
<pnt> is the origin of the 2D contour in space. It has the type POINT_3D.
<vec> is the vector around which <cnt_name> is rotated. It has the type
VECTOR_3D.
Structure:
PNT(1:3) (DECIMAL)
VEC(1:3) (DECIMAL)
NSEG (INTEGER)
SEGPARTS(1:NSEG)
ENDPNT(1:2) (DECIMAL)
AMPLITUDE(1:2) (DECIMAL)
Example:
GET/STRUCTURE=(X,<rot_name>,'PNT',1)
/STRUCTURE=(N,<rot_name>,'NSEG')
/STRUCTURE=(Y,<rot_name>,'AMPLITUDE',N,'Y');
SPHERESEG,<seg_name>,<rad>
/COORDSEG=(<cl_pnt_1>,cl_pnt_2>);
<seg_name> is the name of the spherical segment and has the type
SPHERESEG_3D. The maximum length of <seg_name> is 32 characters.
<rad> is the radius of the spherical segment. It has the type DECIMAL.
COORDSEG=(<cl_pnt_1>,<cl_pnt_2>)
<cl_pnt_1> is the starting point and <cl_pnt_2> is the ending point of the
centre line, both with the type POINT_3D.
Structure:
PNT(1:3) (DECIMAL)
UVEC(1:3) (DECIMAL)
RADIUS (DECIMAL)
Example:
GET/STRUCTURE=(X,<seg_name>,'PNT',1)
/STRUCTURE=(Z,<seg_name>,'UVEC',3)
/STRUCTURE=(R,<seg_name>,'RADIUS');
SPLINE,<spl_name>
[/SPLPNT=<spl_pnt>]
[/SPLTAN=(<spl_pnt>,<tang_ang>)];
<spl_name> is the name of the spline and has the type SPLINE_2D. The
maximum length of <spl_name> is 32 characters.
It is possible to define the spline with or without tangent conditions in the points in the
following way:
1)no tangent condition
2)tangent condition in the start point
3)tangent condition in the end point
4)tangent conditions in both start and end point
5)tangent conditions in all points
SPLPNT=<spl_pnt>
<spl_pnt> is the spline point with type POINT_2D. It is used when no tangent
condition is wanted.
SPLTAN=(<spl_pnt>,<tang_ang>)
<spl_pnt> is the spline point with type POINT_2D.
<tang_ang> is the tangent angle to be used in 2) - 5) above. It has the type
DECIMAL.
Structure:
NSEG (INTEGER)
SEGPARTS(1:NSEG)
PNT(1:2) (DECIMAL)
VEC(1:2) (DECIMAL)
Example:)
GET/STRUCTURE=(N,<spl_name>,'NSEG'
/STRUCTURE=(X,<spl_name>,'PNT',N,1)
/STRUCTURE=(Y,<spl_name>,'VEC',N,2);
SPLIT,<model_name>,<delimiter>,<project>,<module>,
<subsyst_1>,<subsyst_2>,<subsyst_3>;
<model_name> is the name of the model. It has the type STRING. The maximum
length of <col> is 26 characters.
<delimiter> is the character which is used to separate the different parts of
<model_name>. It has the type STRING.
<project> is the project of <model_name> and has the type STRING.
SYMBOL,<symb_name>,<symb_no>,<symb_pnt>,<symb_ang>
[/MIRRORX]
[/MIRRORY]
[/SYMBFONT=<symb_fnt>]
[/SYMBHEIGHT=<symb_hgt>]
[/SYMBWIDTH=<symb_wid>]
[/AUTOOFF];
<symb_name> is the name of the symbol and has the type SYMBOL_2D. The
maximum length of <symb_name> is 32 characters.
<symb_no> is the number of the symbol. It has the type INTEGER.
<symb_pnt> is the origin of the symbol and has the type POINT_2D.
<symb_ang> is the symbol angle which is of type DECIMAL.
MIRRORX
With this attribute, it is possible to reflect the symbol in the x axis. It cannot be
used together with MIRRORY.
MIRRORY
With this attribute it is possible to reflect the symbol in the y axis. It cannot be used
together with MIRRORX.
SYMBFONT=<symb_fnt>
<symb_fnt> is the symbol font and has the type INTEGER. The default font is
the system font number 21.
SYMBHEIGHT=<symb_hgt>
<symb_hgt> is the symbol height and has the type DECIMAL. The symbol is
given a default height value and the symbol height can be changed with this
attribute.
SYMBWIDTH=<symb_wid>
<symb_wid> is the symbol width and has the type DECIMAL. The symbol is
given a default width value but the symbol width can be changed with this
attribute.
AUTOOFF
With this attribute it is possible to switch off the default automatic positioning of the
symbol.
Structure:
SYMBNO (INTEGER)
PNT(1:2) (DECIMAL)
ANGLE (DECIMAL)
FONTNO (INTEGER)
WIDTH (DECIMAL)
HEIGHT (DECIMAL)
MIRR (INTEGER)
AUTO (INTEGER)
Example:
GET/STRUCTURE=(S,<symb_name>,'SYMBNO')
/STRUCTURE=(X,<symb_name>,'PNT',1)
/STRUCTURE=(A,<symb_name>,'ANGLE')
/STRUCTURE=(F,<symb_name>,'FONTNO')
/STRUCTURE=(W,<symb_name>,'WIDTH')
/STRUCTURE=(H,<symb_name>,'HEIGHT')
/STRUCTURE=(M,<symb_name>,'MIRR')
/STRUCTURE=(A,<symb_name>,'AUTO');
TABLE,<tab_name>
[/ARGUMENTS=([<arg_1>[,<arg_2>....[,<arg_15>]....]])]
[/FORMAT=([<width_1>,<ndec_1>[,<width_2>,ndec_2>....
[,<width_15>,<ndec_15>]....]])]
[/FILENAME=<file_name>]
[/QUOTES]
[/NOAPPEND];
<tab_name> is the name of the table and has the type TABLE. The maximum length
of <tab_name> is 32 characters.
ARGUMENTS=([<arg_1>[,<arg_2>.... [,<arg_15>]....]])
<arg_1>,<arg_2>, ....,<arg_25> are the arguments to be put in the
table. They can have the type INTEGER, DECIMAL or STRING.
FORMAT=([<width_1>,<ndec_1>[,<width_2>,<ndec_2>....
[,<width_15>,<ndec_15>]....]])
This attribute describes the format of the table. <width_1>,<width_2>,
...,<width_15> is the width of the column for the i:th argument. It has the
type integer. The default width is 8 which will be the result if FORMAT is not given
or if the width for a variable is omitted (i.e. given as ,,). If the width is negative the
result will be positioned left-justified, otherwise right-justified.
<ndec_1>,<ndec_2>, ...,<ndec_15> is the number of decimals for the
i:th argument. It has the type integer. The default number of decimals is 3 which
will be the result if FORMAT is not given. It is of course only necessary to give the
number of decimals for arguments of type DECIMAL. In other cases it can be
omitted (i.e. given as ,,) or given as 0.
The attributes ARGUMENTS and FORMAT must be given together and with the
same number of parameters.
FILENAME=<file_name>
<file_name> is the file where the table will be presented when the PRESENT
statement is used. It has the type STRING.
QUOTES
When this attribute is given in the TABLE statement all terms will be surrounded by
' '. The resulting file can then directly be used as input to the Report Generator.
NOAPPEND
When this attribute is given in the TABLE statement the old contents in
<tab_name> will be deleted and the <tab_name> can be used for another
table. The attribute must also be given the first time <tab_name> is used.
TEXT,<txt_name>,<txt_pnt>
[/TEXTLINE=<txt_str>]
[/TEXTDECNO=<txt_dec>]
[/TEXTINTNO=<txt_int>]
[/TEXTANGLE=<txt_ang>]
[/TEXTHEIGHT=<txt_hgt>]
[/TEXTFONT=<txt_fnt>];
<txt_name> is the name of the text line and has the type TEXT_2D. The maximum
length of <txt_name> is 32 characters.
<txt_pnt> is the text origin which is the lower left corner of the text. It has the type
POINT_2D.
TEXTDECNO=<txt_dec>
<txt_dec> is a number which shall be presented as a text. It has the type
DECIMAL.
TEXTINTNO=<txt_int>
<txt_int> is a number which will be presented as a text. It has the type
INTEGER.
TEXTLINE=<txt_str>
<txt_str> is a string which will be presented as a text. It has the type STRING.
TEXTANGLE=<txt_ang>
<txt_ang> is the text angle and has the type DECIMAL. The default angle is
0.0 but the text angle can be changed with this attribute.
TEXTHEIGHT=<txt_hgt>
<txt_hgt> is the text height and has the type DECIMAL. The text is given a
default height value but the text height can be changed with this attribute.
TEXTFONT=<txt_fnt>
<txt_fnt> is the text font and has the type INTEGER. Available font numbers
are 0-99. The default font number is 0.
Structure:
TEXT (STRING)
PNT(1:2) (DECIMAL)
ANGLE (DECIMAL)
HEIGHT (DECIMAL)
Example:
GET/STRUCTURE=(T,<txt_name>,'TEXT'
/STRUCTURE=(X,<txt_name>,'PNT',1)
/STRUCTURE=(A,<txt_name>,'ANGLE')
/STRUCTURE=(H,<txt_name>,'HEIGHT');
TEXTFILE,<txf_name>,<file_name>
[/INTERLINESPACE=<intlin_space>]
[/POSLINES=(<start_pnt>,<first_line>,<last_line>)]
[/TEXTANGLE=<text_ang>]
[/TEXTHEIGHT=<text_hgt>]
[/TEXTFONT=<text_fnt>];
<txf_name> is the name of the text file variable and has the type TEXTFILE_2D.
The maximum length of <txf_name> is 32 characters.
<file_name> is the name of the file from where the text is fetched. It has the type
STRING.
INTERLINESPACE=<intlin_space>
<intlin_space> is the factor for the interline space. The interline space is
defined as the factor * the text height. It has the type DECIMAL. The default factor
is 1.5.
POSLINES=(<start_pnt>,<first_line>,<last_line>)
<start_pnt> is the origin of the first text line and the lower left corner of that
line. It has the type POINT_2D.
<first_line> is the number of the first line to be presented. It has the type
INTEGER.
<last_line> is the number of the last line to be presented. It has the type
INTEGER.
TEXTANGLE=<text_ang>
<text_ang> is the text angle and has the type DECIMAL. The default angle is
0.0 but the text angle can be changed with this attribute.
TEXTHEIGHT=<text_hgt>
<text_hgt> is the next height and has the type DECIMAL. The text is given a
default height value but the text height can be changed with this attribute.
TEXTFONT=<text_fnt>
<text_fnt> is the text font and has the type INTEGER. Available font numbers
are 0-99. The default font number is 0.
It is possible to give both absolute and relative values of the lines to be presented.
This is illustrated by the following examples:
/POSLINES=(P1,1,15) lines 1 to 15
/POSLINES=(P1,10,) next 10 lines (16 to 25)
/POSLINES=(P1,20,) next 20 lines (26 to 45)
/POSLINES=(P1,,10) previous 10 lines (16 to 25)
/POSLINES=(P1,,) the whole file
Structure:
FILENAME (STRING)
ANGLE (DECIMAL)
HEIGHT (DECIMAL)
ILSP (DECIMAL)
NDATA (INTEGER)
DATA(1:NDATA)
PNT(1:2) (DECIMAL)
FIRST (INTEGER)
LAST (INTEGER)
Example:
GET/STRUCTURE=(F,<txf_name>,'FILENAME'
/STRUCTURE=(A,<txf_name>,'ANGLE')
Example:
/STRUCTURE=(H,<txf_name>,'HEIGHT')
/STRUCTURE=(I,<txf_name>,'ILSP')
/STRUCTURE=(N,<txf_name>,'NDATA')
/STRUCTURE=(X,<txf_name>,'PNT',N,1)
/STRUCTURE=(S,<txf_name>,'FIRST',N)
/STRUCTURE=(E,<txf_name>,'LAST',N);
TOROID,<tor_name>,<rad>
/COORDTOR=(<cl_pnt_1>,cl_pnt_2>,<cl_pnt_3>);
<tor_name> is the name of the toroid and has the type TOROID_3D. The
maximum length of <tor_name> is 32 characters.
<rad> is the radius of the toroid. It has the type DECIMAL.
/COORDTOR=(<cl_pnt_1>,cl_pnt_2>,<cl_pnt_3>);
<cl_pnt_1> is the starting point, <cl_pnt_2> is the mid point and
<cl_pnt_3> is the ending point of the toroid centre line. All have the type
POINT_3D.
Structure:
STARTPNT(1:3) (DECIMAL)
ENDPNT(1:3) (DECIMAL)
AMPLITUDE(1:3) (DECIMAL)
Example:
GET/STRUCTURE=(X,<tor_name>,'STARTPNT',1)
/STRUCTURE=(Y,<tor_name>,'ENDPNT',2)
/STRUCTURE=(Z,<tor_name>,'AMPLITUDE',3);
VECTOR_2D,<vect_name>,<x>,<y>;
<vect_name> is the name of the vector and has the type VECTOR_2D. The
maximum length of <vect_name> is 32 characters.
<x> and <y> are the x and y coordinates of the vector, both with type DECIMAL.
If only one of the coordinates of a previously defined point shall be changed, the other
one is simply omitted.
Structure:
VEC(1:2) (DECIMAL)
Example:)
GET/STRUCTURE=(X,<vect_name>,'VEC',1
/STRUCTURE=(Y,<vect_name>,'VEC','Y');
VECTOR_3D,<vect_name>,<x>,<y>,<z>;
<vect_name> is the name of the vector and has the type VECTOR_3D. The
maximum length of <vect_name> is 32 characters.
<x>, <y> and <z> are the x, y and z coordinates of the vector, all with type
DECIMAL.
If only one of the coordinates of a previously defined point shall be changed, the
others are simply omitted.
Structure:
VEC(1:3) (DECIMAL)
Example:)
GET/STRUCTURE=(X,<vect_name>,'VEC',1
/STRUCTURE=(Y,<vect_name>,'VEC','Y')
/STRUCTURE=(Z,<vect_name>,'VEC','Z');
VMSJOB,<jobfilename>;
The parameter <jobfilename> is the name of the file to be executed. It has the
type STRING. The maximum length of <jobfilename> is 100 characters.
WHILE,<cond>;
<cond> is the condition to be tested. It has the type BOOLEAN.
• Example 1
This example is a macro creating some simple geometry.
!
! All macros begin with the MACRO-stmt
!
MACRO,RECTANGLE;
GET/POINT_2D=('Give first corner',P1)
/POINT_2D=('Give second corner',P3);
ASSIGN,X1,P1/XCOORD;
ASSIGN,Y1,P1/YCOORD; ! The x- and y-coordinates
ASSIGN,X2,P3/XCOORD; ! of the 2 points are needed
ASSIGN,Y2,P3/YCOORD;
POINT_2D,P2,X1,Y2; ! Create the other
POINT_2D,P4,X2,Y1; ! two corners
CONTOUR,CNT,P1
/LINEEND = P2
/LINEEND = P3 ! Create a contour
/LINEEND = P4
/LINEEND = P1;
PRESENT,CNT; ! Display the contour
!
! All macros end with the ENDMACRO-stmt
!
ENDMACRO;
In the macro RECTANGLE, the contour was created using the four 2D points. In some
cases, it might be more convenient to define a contour with lines instead. The macro above
will then look like this:
MACRO,RECTANGLE;
GET/POINT_2D=('Give first corner',P1)
/POINT_2D=('Give second corner',P3);
ASSIGN,X1,P1/XCOORD;
ASSIGN,Y1,P1/YCOORD;
ASSIGN,X2,P3/XCOORD;
ASSIGN,Y2,P3/YCOORD;
POINT_2D,P2,X1,Y2;
POINT_2D,P4,X2,Y1;
LINE,L1,P1/LINEEND=P2;
LINE,L2,P2/LINEEND=P3;
LINE,L3,P3/LINEEND=P4;
LINE,L4,P4/LINEEND=P1;
CONTOUR,CNT
/LINE = L1
/LINE = L2
/LINE = L3
/LINE = L4;
PRESENT,CNT;
ENDMACRO;
Note that the CONTOUR statement looks different now. In the first case, the start point must
be given but in the second case this point is the start point of the first line.
• Example 2
The macro SCREW below has 4 parameters. One of them, the drawing name, is given in
the MACRO statement. This parameter tells where the result of the macro shall be stored
when executed by the stand alone program. A drawing will be created using the form A3
and the scale chosen is 1:1. The NAME statement has no effect when the macro is
executed interactively at a workstation. The result is then put into the current drawing.
The macro can be found by following this link: macro_screw.txt
The figure below shows the result of the execution of the macro SCREW. The current
drawing contained the rectangle and the length of the screw was given by using the different
point modes, in this case the node mode. The start point was given with the close point
mode.
• Example 4
The macro LIST uses the TEXT and TEXTFILE statements to present a table on a drawing.
The data are stored on a file. A heading is added and a frame is drawn.
The macro can be found by following this link: macro_list.txt
The result of the macro is shown in the figure below.
Figure 9:2. The result from the execution of the macro LIST.
• Example 5
The macro ATTR shows the usage of the ATTRIBUTE statement. Note that it is possible to
give the attribute number as an alias, a number or a variable.
MACRO,ATTR;
ASSIGN,LS,105.6;
ASSIGN,DS,0.2543;
ATTRIBUTE,'CHAIR'/ATTRDATA=(I2,4)
/ATTRDATA=(R1,LS)
/ATTRDATA=(R2,DS)
/ATTRDATA=(R3,35.45)
/ATTRDATA=(S2,'I2: chair no')
/ATTRDATA=(S3,'R1-R3: chair data');
ATTRIBUTE,55/ATTRDATA=(I,3)
/ATTRDATA=(R4,1.234);
ASSIGN,ATTNO,7777;
GET/STR=('Give a string: ',STR);
ATTRIBUTE,ATTNO/ATTRDATA=('S1',STR);
ENDMACRO;
The result of a stand alone execution of the macro ATTR is shown below.
RUN SB_SYSTEM:SZ006
Present Geometry Macro:
(0) Exit
(1) Print on terminal
• Example 6
The macro LAYER shows the layer alias and layer class facilities. Note that a layer can be
given as an alias or as a number. The layer class can be given either as the class name or
the class number, each preceded by '#'.
MACRO,LAYER;
GET/STRING=('Layer alias : ',LALIAS)
/STRING=('Layer class : ',LCLASS)
/INTEGER=('Layer number: ',LNUMBER);
LAYER,'NOLL';
LAYER,'FORM';
LAYER,1001;
LAYER,'#DRA';
LAYER,'#1';
LAYER,LALIAS;
LAYER,LCLASS;
LAYER,LNUMBER;
ENDMACRO;
The result of a stand alone execution of the macro LAYER is shown below.
Present Geometry Macro:
(0) Exit
(1) Print on terminal
(2) Create 2D geometry and store on DB
(3) Create 3D volume model and store on DB
(4) Create 3D volume model + picture and store on DB
Enter activity : 1
General Component Data Bank not assigned!
Give name of macro to be run: LAYER
Layer alias :
> FORM
Layer class :
> #AAA
Layer number:
> 12
LAYER & ALIAS: 0 ZERO
LAYER & ALIAS: 300 FORM
LAYER & ALIAS: 1001 VIEW1
LAYER CLASS: 10 DRA
LAYER CLASS: 1 PIPE
LAYER & ALIAS: 300 FORM
LAYER CLASS: 11 AAA
LAYER & ALIAS: 12 DOZEN
Once more ? Y
Layer alias :
> FROM
Layer class :
> #DRAW
Layer number:
> 100
LAYER & ALIAS: 0 ZERO
LAYER & ALIAS: 300 FORM
LAYER & ALIAS: 1001 VIEW1
LAYER CLASS: 10 DRA
LAYER CLASS: 1 PIPE
Layer alias FROM not defined. Layer ignored!
• Example 7
This example illustrates the possibility of using the IF and WHILE statement to test the input
data. Such a test can be useful to avoid runtime errors.
MACRO,INPUT;
ASSIGN,CONT,1;
WHILE,CONT == 1;
GET/STR=('Key in colour',COL);
IF,COL == 'GREEN' OR COL == 'CYAN'
OR COL == 'BLUE' OR COL == 'MAGENTA'
OR COL == 'RED' OR COL == 'YELLOW'
OR COL == 'WHITE';
ASSIGN,CONT,0;
ENDIF;
ENDWHILE;
!
! When desired colour has been given the rest
! of the macro is executed.
!
ENDMACRO;
It might be more convenient to have such a parameter check as a submacro which would
look like follows.
MACRO,INPUT_COLOUR,COL;
DECLARE,COL,STRING;
ASSIGN,CONT,1;
WHILE,CONT == 1;
GET/STR=('Key in colour',COL);
IF,COL == 'GREEN' OR COL == 'CYAN'
OR COL == 'BLUE' OR COL == 'MAGENTA'
OR COL == 'RED' OR COL == 'YELLOW'
OR COL == 'WHITE';
ASSIGN,CONT,0;
ENDIF;
ENDWHILE;
ENDMACRO;
The usage of INPUT_COLOUR could be like this.
MACRO,MAIN;
DECLARE,C,STRING;
CALL,INPUT_COLOUR,C;
COLOUR,C;
!
ENDIF;
• Example 8
This example illustrates the possibility of writing a recursive macro, i.e. a macro which calls
itself as a submacro. It uses a modified version of the macro RECTANGLE given in
Appendix 2.
MACRO,RECPNT,PNT1,PNT2;
DECLARE,PNT1,POINT_2D;
DECLARE,PNT2,POINT_2D;
CALL,RECTANGLE,PNT1,PNT2;
ASSIGN,X1,PNT1/XCOORD;
ASSIGN,Y1,PNT1/YCOORD;
!
! When the condition is not fulfilled
! no further calls to RECPNT are made
! and the execution is terminated
!
IF,X1 < 250;
ASSIGN,X2,PNT2/XCOORD;
ASSIGN,Y2,PNT2/YCOORD;
POINT_2D,PNT3,X2+X2-X1,Y2+Y2-Y1;
CALL,RECPNT,PNT2,PNT3;
ENDIF;
ENDMACRO;
MACRO,RECTANGLE,P1,P3;
DECLARE,P1,POINT_2D;
DECLARE,P3,POINT_2D;
ASSIGN,X1,P1/XCOORD;
ASSIGN,Y1,P1/YCOORD;
ASSIGN,X3,P3/XCOORD;
ASSIGN,Y3,P3/YCOORD;
POINT_2D,P2,X1,Y3;
POINT_2D,P4,X3,Y1;
CONTOUR,CNT,P1
/LINEEND = P2
/LINEEND = P3
/LINEEND = P4
/LINEEND = P1;
PRESENT,CNT;
ENDMACRO;
• Example 9
This macro is supposed to be started from the General Diagrams application.
All cables without interference class and component defined will be drawn red.
All cables with both interference class and component defined will be drawn green.
All cables with either interference class or component defined will be drawn blue.
The same function for Equipments with the data room and component.
MACRO, OUTF_DIAG_COLOUR;
! Declarations
DECLARE, A1, STRING;
DECLARE, COMPNAME, STRING;
DECLARE, DELIM, STRING;
DECLARE, DWG, STRING;
DECLARE, E1, EXTRACT;
DECLARE, INDEX,INTEGER;
DECLARE, INT_C, STRING;
DECLARE, LOOPMAX, INTEGER;
DECLARE, MODNAME, STRING;
DECLARE, PROJ, STRING;
DECLARE, ROOM,STRING;
DECLARE, STAT, INTEGER;
DECLARE, SUB1, STRING;
DECLARE, SUB2, STRING;
DECLARE, SUB3, STRING;
! Initiate
ASSIGN, DELIM,'-';
! Get the drawing name
DRAWING_NAME,DWG;
! Use data extraction to see which cables that are drawn in
the diagram
ASSIGN,A1,'DRA(DWG).VIE(*).NCABLE';
EXTRACT,E1,A1;
GET/EXTRACT=(LOOPMAX,STAT,E1,DWG,,);
IF,STAT == 1;
LOOP,INDEX,1:LOOPMAX;
ASSIGN,A1,'DRA(DWG).VIE(*).CABLE(INDEX).NAME';
EXTRACT,E1,A1;
GET/EXTRACT=(MODNAME,STAT,E1,DWG,,INDEX,);
IF,STAT == 1;
! Get the cable data by using data extraction
SPLIT,MODNAME,DELIM,PROJ,CAB_SYS,CAB_NAM,SUB2,SUB3;
ASSIGN,CABLE_NAME,CAB_SYS&DELIM&CAB_NAM;
ASSIGN,A1,'CABLE(PROJ).CAB_M(CABLE_NAME).
COMP_N';EXTRACT,E1,A1;
GET/EXTRACT=(COMPNAME,STAT,E1,PROJ,
CABLE_NAME,);
IF,STAT == 0;
ASSIGN,COMPNAME,'‘;
ENDIF;
ASSIGN,A1,
'CABLE(PROJ).CAB_M(CABLE_NAME).EL_PROP.INT_C';
EXTRACT,E1,A1;
GET/EXTRACT=(INT_C,STAT,E1,PROJ,CABLE_NAME,,);
IF,STAT == 0;
ASSIGN,INT_C,'‘;
ENDIF;
! Draw cables without any data red
IF,COMPNAME == ‘' AND INT_C == ‘';
CHANGEDRAW,'CABLE',MODNAME
/MARKINGCOLOUR='RED';
ELSE;
! Draw cables with all data green
IF,COMPNAME /= ‘' AND INT_C /= ‘';
CHANGEDRAW,'CABLE',MODNAME
/MARKINGCOLOUR='GREEN';
! Draw ca bles with some date blue
ELSE;
CHANGEDRAW,'CABLE',MODNAME
/MARKINGCOLOUR='BLUE';
ENDIF;
ENDIF;
ENDIF;
ENDLOOP;
ENDIF,
! Use data extraction to see which equipments that are drawn
in the diagram
ASSIGN,A1,'DRA(DWG).VIE(*).NEQUIP';
EXTRACT,E1,A1;
GET/EXTRACT=(LOOPMAX,STAT,E1,DWG,,);
IF,STAT == 1;
LOOP,INDEX,1:LOOPMAX;
ASSIGN,A1,'DRA(DWG).VIE(*).EQUIP(INDEX).NAME';
EXTRACT,E1,A1;
GET/EXTRACT=(MODNAME,STAT,E1,DWG,,INDEX,);
IF,STAT == 1;
! Get the equipment data by using data extraction
SPLIT,MODNAME,DELIM,PROJ,EQ_NAME,SUB1,SUB2,SUB3;
ASSIGN,A1,'EQUIP(PROJ).ITEM(EQ_NAME).COMP_N';
EXTRACT,E1,A1;
GET/EXTRACT=(COMPNAME,STAT,E1,PROJ,EQ_NAME,);
IF,STAT == 0;
ASSIGN,COMPNAME,'‘;
ENDIF;
ASSIGN,A1,'EQUIP(PROJ).ITEM(EQ_NAME).ROOM';
EXTRACT,E1,A1;
GET/EXTRACT=(ROOM,STAT,E1,PROJ,EQ_NAME,);
IF,STAT == 0;
ASSIGN,ROOM,'‘;
ENDIF;
! Draw equipment items without any data red
IF,COMPNAME == ‘' AND ROOM == ‘';
CHANGEDRAW,'EQUIP',MODNAME/
MARKINGCOLOUR='RED';
ELSE;
! Draw equipment items with all data green
IF,COMPNAME /= ‘' AND ROOM /= ‘';
CHANGEDRAW,'EQUIP',MODNAME
/MARKINGCOLOUR='GREEN';
! Draw equipment items with some date blue
ELSE;
CHANGEDRAW,'EQUIP',MODNAME
/MARKINGCOLOUR='BLUE';
ENDIF;
ENDIF;
ENDIF;
ENDLOOP;
ENDIF,
ENDMACRO;
The following macro would change the colours of the equipments and cables back to be the
one defined by the default file.
MACRO, OUTF_DIAG_DEFAULT;
! Declarations
DECLARE, A1, STRING;
DECLARE, DWG,STRING;
DECLARE, E1, EXTRACT;
DECLARE, INDEX, INTEGER;
DECLARE, LOOPMAX, INTEGER;
DECLARE, MODNAME, STRING;
DECLARE, STAT, INTEGER;
! Get the drawing name
DRAWING_NAME,DWG;
! Use data extraction to see which cables that are drawn in
the diagram
ASSIGN,A1,'DRA(DWG).VIE(*).NCABLE';
EXTRACT,E1,A1;
GET/EXTRACT=(LOOPMAX,STAT,E1,DWG,,);
IF,STAT == 1;
LOOP,INDEX,1:LOOPMAX;
ASSIGN,A1,'DRA(DWG).VIE(*).CABLE(INDEX).NAME';
EXTRACT,E1,A1;
GET/EXTRACT=(MODNAME,STAT,E1,DWG,,INDEX,);
IF,STAT == 1;
CHANGEDRAW,'CABLE',MODNAME
/MARKINGCOLOUR='DEFAULT';
ENDIF;
ENDLOOP;
ENDIF;
! Use data extraction to see which equipments that are drawn
in the diagram
ASSIGN,A1,'DRA(DWG).VIE(*).NEQUIP';
EXTRACT,E1,A1;
GET/EXTRACT=(LOOPMAX,STAT,E1,DWG,,);
IF,STAT == 1;
LOOP,INDEX,1:LOOPMAX;
ASSIGN,A1,'DRA(DWG).VIE(*).EQUIP(INDEX).NAME';
EXTRACT,E1,A1;
GET/EXTRACT=(MODNAME,STAT,E1,DWG,,INDEX,);
IF,STAT == 1;
CHANGEDRAW,'EQUIP',MODNAME
/MARKINGCOLOUR='DEFAULT';
ENDIF;
ENDLOOP;
ENDIF;
ENDMACRO;
Note: The information about User Defined Simple Rules, as given in this section is only
documented for reference not to be used by AVEVA Marine customer.
When a drawing form is created it is possible to define a set of simple rules in the form for
automatic addition of information to the drawing. E.g. when a burning sketch is added to the
drawing form this feature facilitates setting of texts with information extracted from the
nesting.
The rules are defined by a number preceded by a $ sign ("$ values"). The text
corresponding to the rule number will be positioned in the drawing form as indicated by the
$ value.
A great number of rules with predefined meaning already exist already since long (e.g. rules
used in Hull Plate Nesting forms- see User's Guide Plate Nesting, Nesting System -
Application Functions SAVE FORM).
It is also possible for the customer to create new rules with the meaning as defined by him.
The rule numbers of these $ values should be in the interval 10000 - 10999. The texts
created by the user-defined rules are all defined in a Vitesse script called
_TBhook_Formula.py. When such a rule is recognised in the drawing form this Vitesse
script will be called upon. Vitesse commands corresponding to the user-defined rule will
then be evaluated in order to create a text that will be put into the drawing form.
User defined rules are supported in for example the Nesting system. When a user-defined
rule is evaluated the Vitesse script _TBhook_Formula.py is supplied with the model context
and the formula number. After the user defined Vitesse commands for the formula have
been executed, a formula value will be returned as a text string.
Another form of rules is also supported by Vitesse script _TBhook_Formula.py. Those rules
may be called user-implemented rules. They will all have a specific purpose defined in
AVEVA Marine documentation. However, the user is free to implement the rules by Vitesse
commands in _TBhook_Formula.py. The rule numbers for those predefined rules are in the
interval 5000 - 5999. User implemented rules may be supplied with extra input and may also
return extra output beside the formula value text.