Nothing Special   »   [go: up one dir, main page]

AVEVA Marine Vitesse User Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 300

AVEVA Marine

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

Date Version Comments / Remarks


September 2011 12.1.1 Issued
January 2012 Copyright added to all pages.
January 2012 12.2 The python object “KcsModel” has now a new model type value:
”space general”
January 2012 12.2 Changed Tribon to AVEVA Marine.
January 2013 12.1.SP4 New chapter in Triggers; 3.2.2 PML Triggers
February 2013 12.1.SP4 New functions added in Chapter Drafting; Identifying and
Capturing Functions, Element Type Function and Drawing
Element Functions.
Vitesse User Guide
Vitesse User Guide
Contents

Vitesse User Guide

Contents Page

Vitesse
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:1
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2
Development and Migration Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1:2

Using Vitesse in AVEVA Marine Programs. . . . . . . . . . . . . . . . . . . . 2:1


Vitesse Menu and Toolbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:1
Vitesse Log Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:3
Vitesse Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:4
Availability in Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:5

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

© Copyright 1974 to current year. i 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Contents

Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:13


Functions to Check the User Response from Vitesse UI . . . . . . . . . . . . . . . . . . . . . . . . . . 3:13
Functions used to Return from Trigger Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:16
Functions to Access Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:17
Coordinate Translation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:17
Exit Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:19
Clean Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:19
Execute Batch Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:19
Save Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:20
Get Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:20
Quit Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:21
Unclaim All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:21
Run PDMS Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:21
UI Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:22
General ............................................................. 3:22
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:22
Classes ............................................................. 3:23
Basic Input Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:23
Point Request Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:24
Message Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:25
Selection Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:27
Model Information Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:29
Application Window Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:30
Data Extraction Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:31
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:31
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:31
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:33

Python Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:1


General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:1
Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:1
Date and Time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:17
User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:19
Miscellaneous. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:25
Weld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:44
Hull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4:48

Drafting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5:1

© Copyright 1974 to current year. ii 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Contents

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

© Copyright 1974 to current year. iii 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Contents

Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1


Planar Modelling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:1
Hull Default Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2
Activate/Store/Skip/Delete/Recreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:2
Scheme Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:4
KcsPanelSchema Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:8
Panel Scheme Syntax Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:9
Copy/Move/Split/Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:10
Modify Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:11
View Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:13
Curve Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:14
Document Reference Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:15
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:17
Curved Modelling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:18
Generate Hull Objects from XML File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:18
View Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:19
Other Modelling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:22
Store/Skip/Delete/Recreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:26
Dimensioning of Curved Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:27
Customised Holes via Vitesse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:29
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:29
Interface Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:30
Customised Brackets via Vitesse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:31
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:31
Interface Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:32
Customised Notches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:32
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:32
Interface Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6:33

Weld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1
Weld Planning Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7:1

Model Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1


General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8:1

© Copyright 1974 to current year. iv 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Contents

The Geometry Macro Facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1


General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Entities of the Geometry Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:1
Additional Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:2
Operators and System Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:3
Creation of a Geometry Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:4
Execution of a Geometry Macro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:4
Stand Alone Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:4
Parameters of a Geometry Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Submacros in a Geometry Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Execution in Batch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Appendices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Syntax of the Geometry Macro Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Conventions Used in this Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:5
Statement Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:6
Statement Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:10
Example of Macros Creating 2D Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:42
Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:42
Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:44
The Possibility to Present a Text File on a Drawing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:44
Example 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:44
The Usage of Attributes in Geometry Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:45
Example 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:45
Layer Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:46
Example 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:46
The Facility of Using Conditional Statements in a Macro. . . . . . . . . . . . . . . . . . . . . . . . . . 9:48
Example 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:48
The Possibility to Write Recursive Geometry Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:49
Example 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:49
Change Colour in Drawing by Using Geometry Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:50
Example 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9:50

User Defined Simple Rules in Forms . . . . . . . . . . . . . . . . . . . . . . . 10:1


Vitesse Script Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10:1

© Copyright 1974 to current year. v 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Contents

© Copyright 1974 to current year. vi 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Introduction

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.

© Copyright 1974 to current year. 1:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Introduction

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.

1.3 Development and Migration Guidelines


By applying accepted program development principles when creating Vitesse programs, a
number of benefits can be achieved. AVEVA takes a great effort to provide compatibility in
the Vitesse area between different releases of the system. However, in some cases minor
changes might have to be done, for example functions might become obsolete and be
replaced by new functions.
To minimise the migration effort in such cases, we recommend that Vitesse developers
encapsulate the functionality into their own functions. This can for example be done by
creating Python modules that are later used by higher level application functions. If such a
strategy is implemented, any changes to the Vitesse interfaces in coming releases can be
applied to custom developed functions with little effort.
There are also other advantages to this approach. One possibility is that additional
functionality can be added in one place. If the Vitesse developer for instance would like to
put all messages given to the user by the message_confirm or message_noconfirm
functions into a log file, this functionality could be easily added into the encapsulation
module, and would immediately be in effect in all programs calling this module. Another
possibility is to create higher lever functions that perform several tasks and has more
functionality than is offered by a single Vitesse function.
By applying these and other commonly accepted program development principles, the
Vitesse program development can be made more efficient, easily maintainable and robust.
The information given in this text only provides a few tips, we highly recommend to also

© Copyright 1974 to current year. 1:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Introduction

refer to commonly available literature on software development principles to get a further


knowledge in this area and ensure an effective result.

© Copyright 1974 to current year. 1:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Introduction

© Copyright 1974 to current year. 1:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

2 Using Vitesse in AVEVA Marine Programs

2.1 Vitesse Menu and Toolbar


The Vitesse menu can be found under Tools / Vitesse in Hull Design and Marine Drafting.

Figure 2:1. Vitesse menu

The Vitesse toolbar can be accessed from the View-Toolbars menu in Hull Design and
Marine Drafting.

Figure 2:2. Vitesse Toolbar.

© Copyright 1974 to current year. 2:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

The functions in menu and toolbar are the following:


1. Run Vitesse script from file browser.
2. Edit the recent Vitesse script selected in the combo-box.
3. Re-run the recent Vitesse script selected in the combo-box.
4. Combo-box containing the latest executed scripts, script name is automatically added
when script is run from file browser. Select and click on script to bring it to the top of list,
and then either use edit button or re-run button for this script. To delete a script from the
list, press the Delete key while pointing the mouse to one of the script names in the list.
If two or more scripts having the same name have been run from different directories,
they will be suffixed by (1), (2) and so on. Let the mouse hover over the script name to
display a tooltip containing the full file path of the script.
5. Activate debugger. This executes a script having a predefined name that can invoke a
debugger. A debugger capable of being used together with Vitesse must support an
Embedded Python Interpreter. An example of a debugger that works together with the
system and that can be connected to this button is Wing that can be downloaded from
following website: archaeopteryx.com.
See also Vitesse Options.
Vitesse log. When this button is pressed, a dialog showing log messages from Vitesse
calls is displayed. See Vitesse Log Window.
6. Reload Python modules. This will clear all Python buffers so that modules changed on
disk will be re-loaded next time they are imported.
7. Vitesse options, only available from the menu. See Vitesse Options.

© Copyright 1974 to current year. 2:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

2.2 Vitesse Log Window

Figure 2:3. Vitesse Log Window

In the upper list box, there is a log of:


1. Scripts started
2. Triggers executed
3. Vitesse functions called, with their name, input parameters, return values and any
exceptions.
4. When reload is performed
In the lower list box, only exceptions are listed. To position yourself in the top list on the
function call that caused the exception, double click the exception in the lower list box. This
can be useful to find exceptions raised during lengthy executions.
There are also buttons to clear the contents of the log window and to close the window.
See also Vitesse Options for logging options.

© Copyright 1974 to current year. 2:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

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.

2.3 Vitesse Options

Figure 2:4. Vitesse Options Dialog

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.

© Copyright 1974 to current year. 2:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

2.4 Availability in Applications


The following link holds a table that illustrates the availability of the Vitesse interfaces in the
system applications: vitesse_access.xls

© Copyright 1974 to current year. 2:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Using Vitesse in AVEVA Marine Programs

© Copyright 1974 to current year. 2:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

3 Utilities

3.1 Batch Vitesse

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:

marhdes -proj=TTP -username=SYSTEM -pass=XXXXXX -mdb=/TTP -appl=planar -


script c:\temp\test.py

echo “Vitesse script finished, continuing with next task

where the option appl can take one of the following:

curved - Curved Modelling


jig - Interactive Jig Pillars
nesting - Plate Nesting
panelline - Panel Line Control
planar - Planar Modelling
structural - Structural Design

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.

© Copyright 1974 to current year. 3:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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.

3.2.2 PML Triggers


There is PML based trigger mechanism meant to replace the legacy Vitesse trigger
functionality. The PML triggers operate on the same events as the Vitesse triggers and are
named as the Vitesse triggers but with underscores removed and with "pre"/"post"
appended as suffix to the trigger name. E.g. the Vitesse trigger trig_draft_init.py

© Copyright 1974 to current year. 3:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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.

Example of PML trigger

define function !!trighullppanstorepost(!panelName is


STRING) is STRING
!panel = !!MyGetPanel.panel(!panelName)
!statusDefinitions[1] = /PanelStatus
!statusValues = !panel.attribute('STVVAL',
!statusDefinitions)
if (!statusValues.unset()) then
!!MyStatMgr.confirmUnset()
return 'ABORT'
endif
!statusValue = !statusValues[1].name
if (!statusValue eq '/PanelApproved') then
!!MyStatMgr.confirmApproved()
return 'ABORT'
else
!!MyStatMgr.confirmNotApproved()
return 'OK'
endif
endfunction

3.2.3 Drafting Triggers

Init Drafting Pre-Trigger


Event: Every time a Drafting based program is started.
Type: Pre
Name: trig_draft_init
Input Parameters: None
Allowed return values: kcs_util.trigger_ok()
kcs_util.trigger_abort()

© Copyright 1974 to current year. 3:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Override functionality: None.


Notes: None.

Init Drafting Post-Trigger


Event: Every time a Drafting based program is started.
Type: Post
Name: trig_draft_init
Input Parameters: None
Allowed return values: kcs_util.trigger_ok()
Override functionality: None.
Notes: This trigger is used by some of the standard functionality.
User additions can be done to this triggers, but the existing
implementation should be left intact for the standard
functionality to work properly.
The Vitesse API kcs_gui is designed to be used within
this trigger.
See kcs_ex_gui1.py, kcs_ex_gui2.py, and
kcs_ex_gui3.py for examples.

New drawing pre-trigger


Event: File / New
Type: Pre
Name: trig_draft_dwg_new
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 prompted to indicate
name of the drawing frame.

New drawing post-trigger


Event: File / New
Type: Post
Name: trig_draft_dwg_new
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger only executes after new drawing has been
successfully created. If an error occurs during creation, the
trigger will not be executed.

© Copyright 1974 to current year. 3:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Open drawing pre-trigger


Event: File / Open
Type: Pre
Name: trig_draft_dwg_open
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 prompted to indicate
name of the drawing to open.

Open drawing post-trigger


Event: File / Open
Type: Post
Name: trig_draft_dwg_open
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger only executes after drawing has been
successfully opened. If an error occurs during opening, the
trigger will not be executed.

Close drawing pre-trigger


Event: File / Close
Type: Pre
Name: trig_draft_dwg_open
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 drawing will be close.

Close drawing post-trigger


Event: File / Close
Type: Post
Name: trig_draft_dwg_close
Input Parameters: None
Allowed return values: Standard for Post-Trigger

© Copyright 1974 to current year. 3:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Note: This trigger only executes after drawing has been


successfully closed. If an error occurs during closing, the
trigger will not be executed.

Save drawing pre-trigger


Event: File / Save
Type: Pre
Name: trig_draft_dwg_save
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 drawing will be save.

Save drawing post-trigger


Event: File / Save
Type: Post
Name: trig_draft_dwg_save
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger only executes after drawing has been
successfully saved. If an error occurs during saving, the
trigger will not be executed.

Save As drawing pre-trigger


Event: File / Save As
Type: Pre
Name: trig_draft_dwg_save_as
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 drawing will be save.

Save As drawing post-trigger


Event: File / Save As
Type: Post
Name: trig_draft_dwg_save_as
Input Parameters: None

© Copyright 1974 to current year. 3:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Allowed return values: Standard for Post-Trigger


Note: This trigger only executes after drawing has been
successfully saved. If an error occurs during saving, the
trigger will not be executed.

Print drawing pre-trigger


Event: File / Print
Type: Pre
Name: trig_draft_dwg_print
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 drawing will be print.

Print drawing post-trigger


Event: File / Print
Type: Post
Name: trig_draft_dwg_print
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger will be executed if the interactive command is
completed without errors.

Insert Model pre-trigger


Event: Insert / Model
Type: Pre
Name: trig_draft_insert_model
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
model.

Insert Model post-trigger


Event: Insert / Model
Type: Post
Name: trig_draft_insert_model

© Copyright 1974 to current year. 3:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Input Parameters: None


Allowed return values: Standard for Post-Trigger
Note: This trigger will be executed if the insertion of model will
end with success.

Model Info pre-trigger


Event: Tools / Inquiry / Model
Type: Pre
Name: trig_draft_model_info
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
model.

Model Info post-trigger


Event: Tools / Inquiry / Model
Type: Post
Name: trig_draft_model_info
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger will be executed if the model info will be
obtained successfully.

Model Info property edit pre-trigger


Event: Tools / Inquiry / Model / Edit
Type: Pre
Name: trig_draft_property_edit
Input Parameters: Name Type Description
Model object Model Model information
Value string First value
Value string Last value
Allowed return values: kcs_util.trigger_ok()
Note: This trigger will be fired when the Edit function is selected
in the dialogue.

Verify drawing pre-trigger


Event: Tools / Inquiry / Verify
Type: Pre

© Copyright 1974 to current year. 3:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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.

Verify drawing post-trigger


Event: Tools / Inquiry / Verify
Type: Post
Name: trig_draft_dwg_verify
Input Parameters: None
Allowed return values: Standard for Post-Trigger
Note: This trigger will be executed if the geometry info will be
obtained successfully.

Insert Model Filter Pre-Trigger


Event: When the user clicks the "Filter" button in the Insert/Model
dialogue.
Type: Pre
Name trig_draft_insert_model_filter
Input Parameters: Name Type Description
Model object Model First model
information
Model object Model Last model
information
Allowed return values: Name Type Description
kcs_util.trigger_ok If
() kcs_util.trigger_ok
(), a number of
kcs_util.trigger_ab
model classes
ort()
could also be
returned (see
below).
Model objects List of Models Python list of all
models to be
included.
Override functionality: None.
Note: See kcs_ex_att3.py for an example.

© Copyright 1974 to current year. 3:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

3.2.4 Hull Planar Modelling Triggers

Panel store pre-trigger


Event: Storing of panel.
Type: Pre.
Name: trig_hull_ppan_store
Input Parameters: Name Type Description
Panel name String Name of panel to store.
Allowed return values: Standard for Pre-Trigger.
Override functionality. If kcs_util.trigger_override() is returned the
panel will not be stored.
Note: This trigger fires before storing a panel.

Panel store post-trigger


Event: Storing of panel.
Type: Post.
Name: trig_hull_ppan_store
Input Parameters: Name Type Description
Panel name String Name of panel to store.
Allowed return values: Standard for Post-Trigger.
Note: This trigger fires after storing a panel.

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.

3.2.6 Registering trigger functions


It is possible to register triggers dynamically instead of using external trigger files. The main
advantages are:
• Registering/unregistering can be done dynamically during execution of user
application.
• All needed triggers can be defined in one python module.
When using dynamic registration it is necessary to have a callable object defined. This
object will be called when the trigger is invoked. A callable object means here a function

© Copyright 1974 to current year. 3:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

register_trigger(name, type, function)


This function registers new user trigger. It is only possible to register triggers that don't
return any other additional values than return code. See General in Triggers chapter.
Input Parameters:
Name string Name of trigger. The same name as used for
trigger file. See General in Triggers chapter.
type constant kcs_util.kcsPOST_TRIGGER or
kcs_util.kcsPRE_TRIGGER
function Callable Trigger function.
object
Returned value:
None.
Exceptions:
kcs_ArgumentError Argument Error.
kcs_ValueError Given function argument is not a callable
object, trigger name not found or trigger type
invalid.

unregister_trigger(name, type, function)


This function un-registers user trigger.
Input Parameters:
Name string Name of trigger. The same name as used for
trigger file. See General in Triggers chapter.
Type constant kcs_util.kcsPOST_TRIGGER or
kcs_util.kcsPRE_TRIGGER
Function Callable Trigger function.
object
Returned value:
None.
Exceptions:
kcs_ArgumentError Argument Error.
kcs_ValueError Given function not found, or not callable or
invalid trigger type.
kcs_ElementNotFound Trigger function was not registered.

get_registered_triggers ()
This function returns registered triggers as a dictionary.
Input Parameters:
None.
Returned value:

© Copyright 1974 to current year. 3:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

[0] dictionary All defined triggers are stored in a dictionary.


Exceptions:
kcs_GeneralError General Error.

Example:

Module: Triggers.py

import kcs_util

# callable objects that will be used by triggers


def NewDrawingPreTrigger():
# user code

def OpenDrawingPreTrigger():
# user code

# function for trigger registration


def RegisterTriggers():
kcs_util.register_trigger("trig_draft_dwg_new",
kcs_util.kcsPRE_TRIGGER, NewDrawingPreTrigger)
kcs_util.register_trigger("trig_draft_dwg_open",
kcs_util.kcsPRE_TRIGGER, OpenDrawingPreTrigger)

# clean up registered triggers


def UnregisterTriggers():
kcs_util.unregister_trigger("trig_draft_dwg_new",
kcs_util.kcsPRE_TRIGGER, NewDrawingPreTrigger)
kcs_util.unregister_trigger("trig_draft_dwg_open",
kcs_util.kcsPRE_TRIGGER, OpenDrawingPreTrigger)

3.3 Utility Interface

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.

© Copyright 1974 to current year. 3:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

3.3.2 Exception Handling


The Vitesse Utility interface uses exception handling. This means that if a run time error
occurs an exception is set. The exception can be caught using the "try - except" construct of
the Python language. The type of error can then be examined by checking the value of
kcs_util.error. The exception is also displayed in the Vitesse Log window which is
available by the Vitesse Log Window command and can optionally be written to the log file.
The meaning of the exception can be found in the description of the corresponding function.
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_util

env = 'SB_PYTHON'
try:
cur_value = kcs_util.TB_environment_get(env)
except:
print kcs_util.error

3.3.3 Functions to Check the User Response from Vitesse UI


These function are used to check the resulting "User Response" in all Vitesse UI functions.
After a call of such a UI function, a completed user input will yield the user response ok(), if
nothing else is stated. Otherwise the cause of user interruption could be checked against
any other function below. Note that the "check" functions below do not cover all possible
user responses from a UI function.

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

© Copyright 1974 to current year. 3:13 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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:

© Copyright 1974 to current year. 3:14 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

[0] integer The value of NO


Exceptions:
None

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

© Copyright 1974 to current year. 3:15 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Example:

# Example: kcs_ex_util2.py

3.3.4 Functions used to Return from Trigger Scripts

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

© Copyright 1974 to current year. 3:16 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

3.3.5 Functions to Access Environment Variables

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

3.3.6 Coordinate Translation Functions

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

© Copyright 1974 to current year. 3:17 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

tra_coord_ship (Ucoord, Vcoord, Name)


Get a coordinate in the ship coordinate system, from an earlier made indication in the
picture. If the name of a panel is given, the point is calculated in the plane of the panel. If
the name is empty, the plane of the view closest to the point given is used.
Input parameters:
Ucoord real U-coordinate of the point
Vcoord real V-coordinate of the point
Name string Name of panel defining the definition plane
Returned value:
[0] integer Result:
0 = success,
otherwise failure
[1] real the resulting point, X-coordinate
[2] real the resulting point, Y-coordinate
[3] real the resulting point, Z-coordinate
Exceptions:
None

tra_coord_pan (Ucoord, Vcoord, Name)


Get a co-ordinate in the panel co-ordinate system from an earlier made indication in the
picture. The name of the panel has to be supplied, as the point is expressed in the local
co-ordinate system of that panel.
Input parameters:
Ucoord real U-coordinate of the point
Vcoord real V-coordinate of the point
Name string Name of panel defining the definition plane
Returned value:

© Copyright 1974 to current year. 3:18 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

[0] integer Result


0 = success
otherwise failure
[1] real the resulting point, X-coordinate
[2] real the resulting point, Y-coordinate
[3] real the resulting point, Z-coordinate
Exceptions:
None

3.3.7 Exit Program

exit_program()
The function terminates the program.

Note: The program is not terminated until the Python script is finished

(This function is necessary for Batch Vitesse)


Input parameters:
None.
Output parameters:
None.
Returned value
None.
Exceptions:
None.

3.3.8 Clean Workspace

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

3.3.9 Execute Batch Programs

Run_job(applicationName, inputFile, bRunInBackground)


The function executes the specified application.
Input Parameters:

© Copyright 1974 to current year. 3:19 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

applicationName string Name of application (from MarJob.xml)


inputFile string Name of input file
bRunInBackground integer Controls whether the function should wait
until the application is terminated.
Output Parameters:

Returned values:
[0] Integer Response
[1] JobId The resulting job id.
Exceptions:
kcs_ArgumentError Invalid parameter value
kcs_ValueError Could not execute specified application

3.3.10 Save Work

save work()
The function performs savework.
Input Parameters:
None
Output parameters:

Returned value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:

3.3.11 Get Work

get work()
The function performs getwork.
Input Parameters:
None
Output Parameters:

Returned value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:

© Copyright 1974 to current year. 3:20 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

3.3.12 Quit Work

quit_work()
The function performs quitwork.
Input Parameters:

Output Parameters:

Returned Value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:

3.3.13 Unclaim All

unclaim_all()
The function performs unclaim all.
Input Parameters:

Output Parameters:

Returned Value:
[0] integer Result
> 0 = success
< 0 = failure
Exceptions:

3.3.14 Run PDMS Command

run_pdms_command(cmd)
The runs a pdms command.
Input Parameters:
cmd string The command to execute
Output Parameters:

© Copyright 1974 to current year. 3:21 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

3.4.2 Exception Handling


The Vitesse UI interface uses exception handling. This means that if a run time error occurs
an exception is set. The exception can be caught using the “try - except” construct of the
Python language. The type of error can then be examined by checking the value of
kcs_ui.error. The exception is also written to the Vitesse log. The meaning of the exception
can be found in the documentation of the corresponding function.

© Copyright 1974 to current year. 3:22 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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.

3.4.4 Basic Input Functions

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)

© Copyright 1974 to current year. 3:23 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

3.4.5 Point Request Functions

point2D_req(Message, Point <Status>, <Buttons>))


The function presents a message to the user and lets him define a 2D point in the current
drawing. The initial point definition mode is "cursor position".
U/V locking
U/V locking can easily be implemented in the 2D point selection. If the lock buttons are
enabled (see documentation of Class KcsButtonState.ButtonState class), the function will
return one of the following response codes if the user has pressed any lock button:
• kcs_util.u_lock()
• kcs_util.v_lock()
• kcs_util.unlock()
Handling these codes allows the user to take up special actions like draw help locking
lines, change cursor type before next point2d_req call etc.
By default 2D lock buttons are disabled so it is required to give the Buttons parameter if
you want to enable them.
Use Point2DLockReq function defined in kcs_ex_ui1.py as example of handling u/v
locking with point2D_req. It draws help locking lines and adjusts result point to locked
coordinate.
Input parameters:
Message string The message to the user (max 512
characters)
Status Stat_point2D Point definition mode and cursor type. This
_req parameter is optional.
Buttons ButtonState Controls visibility of buttons and u/v lock
handling. This parameter is optional
Output parameters:
Point Point2D The resulting 2D point

© Copyright 1974 to current year. 3:24 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Returned value:
[0] integer User response
[1] Point2D The resulting 2D point
Exceptions:
kcs_ValueError Invalid parameter value
kcs_DrawingNotCurrent No drawing was current

point3D_req(Message, InitStatus, Point)


The function presents a message to the user and lets him define a 3D point in the
drawing. The optional InitStatus parameter guides some initial conditions for the point
definition.
Input parameters:
Message string The message to the user (max 512
characters)
InitStatus Stat_point3D Initial conditions (optional)
_req
Output parameters:
Point Point3D The resulting 3D point
InitStatus Stat_point3
D_req Resulting lock and initial point definition
status (optional)
Returned value
[0] integer User response
[1] Point3D The resulting 3D point
Exceptions:
kcs_ValueError Invalid parameter value
kcs_DrawingNotCurrent No drawing was current

Example:

# Example: kcs_ex_ui1.py

3.4.6 Message Functions

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

© Copyright 1974 to current year. 3:25 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

Figure 3:1. Example of a message that has to be confirmed.

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

message_debug (Message, <Color>,<Bold>,<Underline>)


The function displays a message in the Vitesse Log Window
Input Parameters:

© Copyright 1974 to current year. 3:26 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Object Message String representation of given python object


will be send to log window.
Integer or Tuple <Color> Text colour. The parameter can be defined as
integer colour value or tuple representing (R,
G, B) values.
Integer <Bold> Bold text. When parameter is different then 0
the text is displayed using bold font.
Integer <Underline> Underline text. When parameter is different
then 0 the text is displayed with underline.
Returned value:
None
Exceptions:
None

3.4.7 Selection Functions

choice_select(Title, Header, Actions)


The function presents a box with a list of actions and lets the user select one of these.
Input parameters:
Title string The title of the box (max 132 characters)
Header string The header of the list (max 512 characters)
Actions Stringlist List of actions (max 132 characters for each
action and max 20 actions)
Returned value:
[0] integer User response
[1] integer The chosen action
Exceptions:
kcs_ValueError Invalid parameter value

Figure 3:2. Box created with choice_select.

string_select(Title, Header, Prompt, Alternatives)


The function presents a box with a list of strings and lets the user select one of these.
Input parameters:

© Copyright 1974 to current year. 3:27 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Title string The title of the box (max 132 characters)


Header string The header of the list (max 512 characters)
Prompt string The prompt (max 512 characters)
Alternatives Stringlist List of alternatives (max 132 characters for
each alternative)
Returned value:
[0] integer User response
[1] integer The selected alternative
Exceptions:
kcs_ValueError Invalid parameter value

Figure 3:3. Example on a box created with string_select.

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

© Copyright 1974 to current year. 3:28 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

3.4.8 Model Information Functions

model_info()

© Copyright 1974 to current year. 3:29 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

3.4.9 Application Window Functions

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.

© Copyright 1974 to current year. 3:30 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

Input parameters:
None.
Output parameters:
None.
Returned value
None.
Exceptions:
None.

3.5 Data Extraction Interface

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

© Copyright 1974 to current year. 3:31 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

= 5 box type result


= 6 real vector 2D type
>10 real vector nD type. Subtracting 10 from the
result gives the number of elements in the
vector.
= -1 End of result tree.

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

© Copyright 1974 to current year. 3:32 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

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

1. Make data extraction statements available in the Vitesse program.


2. Initialise sum variable.
3. Ask user to key in name of hull block to calculate weight for. This command is further
explained in the user interface section.
4. Build up the data extraction string.
5. Do the actual data extraction.
6. Check the outcome of the extraction command.
7. Loop to pick up all the values from the data extraction result tree.
8. Add the weight from this panel to the total sum.

© Copyright 1974 to current year. 3:33 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Utilities

9. Simply print out the sum accompanied with a simple explanation.

© Copyright 1974 to current year. 3:34 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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]

© Copyright 1974 to current year. 4:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

decimals integer Number of decimals to round to


SetFromPoint (p) Set point as a copy of other point
p Point2D Point to copy coordinates from
SetFromMidpoint Update the point to be the midpoint of two other
(p1, p2) points
p1 Point2D First point
p2 Point2D Second point
SetCoordinates(x,y) Update point coordinates. Parameters are defined
as attributes above.
Class protocols:
__repr__ Used to return string representation of Point2D object
__cmp__ Used to compare two Point2D objects

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)

© Copyright 1974 to current year. 4:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

TangentAtPoint Vector2D Method returns a vector which is a tangent to


(pntExt, pntRef) circle through point pntExt and the tangent point
closest to approximate point pntRef selected by
the user.
pntExt Point2D A point outside the circle
pntRef Point2D A point on the circle defining tangent vector
variant
Class protocols:
__repr__ Used to return string representation of Circle2D object.

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

© Copyright 1974 to current year. 4:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__cmp__ Used to compare two Polygon2D objects


__len__ Used to return the length of polygon (number of points in Polygon
attribute)
__getitem__ Implements sequence type evaluation of self[key] to Point2D
__setitem__ Implements sequence type assignment of Point2D to self[key]

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

© Copyright 1974 to current year. 4:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

point Point2D Point at end of line


AddArc (point, amplitude) Add an arc segment to the contour
point Point2D Point at the end of the arc
amplitude real Amplitude at the midpoint of segment
SetPoint (point) Reset the contour to one point
point Point2D Start point of the contour
IsPoint () integer Checks if contour is a point:
1 - Contour is a point
0 - Contour is not a point
IsClosed () integer Check whether the contour is closed:
1 - Contour is closed
0 - Contour is not closed
IsInside (point) integer Check whether the point is inside the contour:
1 - The point is inside the contour
0 - The point is outside or on the contour or the contour
is not closed.
point Point2D Point to test
IsPointOnContour integer Check whether the given point is on contour:
(point) 1 - The point is on the contour
0 - The point is not on the contour.
point Point2D Point to test

GetPointOnContour (point) Get a point on contour, which is nearest to the


given point. New point is returned in input
variable.
point Point2D Input/output point
GetCenterPoint Point2D Get the center point of a segment given at input
(start, end,
amplitude)
start Point2D Start point of the segment
end Point2D End point of the segment
amplitude real Amplitude of the segment
Distance (point) real Get the distance between given point on contour
and the end point of the contour measured along
contour
point Point2D Point on contour, whose distance to end point is to
be calculated
Length() real Get the length of contour
Area() real Get the area inside contour
Direction() integer Get the direction (orientation) of the contour:
-1 - Contour is clockwise
-1 - Contour is anticlockwise
Class protocols:
__repr__ Used to return string representation of Contour2D object.

© Copyright 1974 to current year. 4:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__add__ Returns a sum of two contours, for example:


contC = contA + contB
Now contC is a new instance of Contour2D representing the sum of
contA and contB where contA and contB are also instances of
Contour2D.
__sub__ Returns a subtraction of two contours, for example:
contC = contA - contB
Now contC is a new instance of Contour2D representing the
subtraction of contA and contB where contA and contB are also
instances of Contour2D.
__mul__ Returns a common part of two contours, for example:
contC = contA * contB
Now contC is a new instance of Contour2D representing the
common part of contA and contB where contA and contB are also
instances of Contour2D.

Class KcsContourOperations. BooleanOperations:


The ContourOperations class holds information about two 2D dimensional#
contours, which will be used to perform operations on.
Attributes:
__contour1 Contour2D First contour
__contour2 Contour2D Second contour
__segments1 list Segments list of first contour
__segments2 list Segments list of second contour
Methods:
BooleanOperati Creates an instance of the class
ons(constructor)
INPUT:
Contour2D First contour
Contour2D Second contour
ConvertContour Converts contour segments to the following representation:
(start point, end point, center point, amplitude)
INPUT:
Contour2D Contour to convert
GetInsideSegm Gets all segments that are inside the other contour.
ents
INPUT:
list List of segments converted by ConvertContour
GetOuterSegme Gets all segments that are outside the other contour
nts
INPUT:
list List of segments converted by ConvertContour

© Copyright 1974 to current year. 4:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

GetConditionalS Gets all segments that are in both contours.


egments
INPUT:
list List of segments converted by ConvertContour
IsOuterSegment Checks if segment is an outer segment.
INPUT:
list Segment converted by ConvertContour
IsOuterPoint Checks if point is an outer point.
INPUT:
Point2D Point
ChooseNextSeg Chooses next segment used for adding contours.
ment
INPUT:
list Segment converted by ConvertContour
list List of priority segments converted by
ConvertContour
list List of secondary segments converted by
ConvertContour
DifferNextSegm Chooses next segment used for subtracting contours.
ent
INPUT:
list Segment converted by ConvertContour
list List of priority segments converted by
ConvertContour
list List of secondary segments converted by
ConvertContour
CompositeCont Adds contours
our
INPUT:
list List of intersection points
ChooseDifStart Chooses another start point when creating more than one contour.
Point
INPUT:
list list of already used segments converted by
ConvertContour
list list of segments converted by ConvertContour
CommonContou Finds common part(s) of two contours
r
INPUT:
list list of intersection points
DifferContour Subtracts contours.
list list of intersection points

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

© Copyright 1974 to current year. 4:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

End Point2D The end point


Amplitude Vector2D The amplitude vector
Cff real The form factor. It controls the shape of the conic
and should be 0 <= Cff < 1. In mathematical terms,
a value < 0.5 will yield a ellipse, a value > 0.5 a
hyperbola, while a value of exactly 0.5 will yield a
parabola.
Constructor:
Conic2D (stp, This constructor will create instance of Conic2D class. Parameters are
endp, ampl, cff) defined as above.
Methods:
None
Class protocols:
__repr__ Return string representation of Conic2D object

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

© Copyright 1974 to current year. 4:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

p Point3D Point to copy coordinates from


SetFromMidpoint Update the point to be the midpoint of two other
(p1, p2) points
p1 Point3D First point
p2 Point3D Second point
SetCoordinates(x, Update point coordinates. Parameters are defined
y,z) as attributes above.
Transform (tra) Transform the point using a transformation matrix
tra Transformation Transformation matrix
3D
Class protocols:
__repr__ Used to return string representation of Point3D object
__cmp__ Used to compare two Point3D objects

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.

© Copyright 1974 to current year. 4:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

ProjectOnLine(line3D) Projects vector on Line3D


ProjectOnVector(v1) Projects vector on another 3D vector v1.
ProjectOnPlane(plane) Projects vector on Plane3D.
Rotate(angle, v1) Rotates vector by given angle (in radians) around
another vector.
Round(decimals) Rounds vector components to given number of
decimals.
ScalarComponentOnLine(line) Performs scalar projection on Line3D.
SetComponents(x, y, z) Sets vectors components.
SetFromCrossProduct(v1, v2) Sets vectors components from cross product of
another two vectors v1 and v2.
SetFromPoints(p1, p2) Sets vectors components from start and end 3D
points p1 and p2.
SetFromVector(v1) Sets vectors components from another 3D vector
v1
SetFromVectorDifference(v1, v2) Sets vectors components to difference of another
two 3D vectors: v1-v2.
SetFromVectorSum(v1, v2) Sets vectors components to sum of another two 3D
vectors: v1+v2.
SetLength(length) Update the vector to have a certain length.
SetToUnitVector() Update the length of vector to 1.
Transform(tra) Transforms vector by Transformation3D matrix.
Operators Operators: ==, !=, <=, <, >, >=, +, -, truth value
testing
Sequential data type protocol You can use index for accessing vector
components:
v1[0] returns X component,
v1[1] returns Y component,
v1[2] returns Z component.

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

© Copyright 1974 to current year. 4:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:13 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

line Line3D The line to intersect the plane with


point Point3D The point to be updated with result
Transform (tra) Transforms a plane using transformation matrix.
tra Transformation The transformation matrix
3D

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

© Copyright 1974 to current year. 4:14 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:15 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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:

© Copyright 1974 to current year. 4:16 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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’)

4.3 Date and Time


These python classes handle dates and time.

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

© Copyright 1974 to current year. 4:17 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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:

© Copyright 1974 to current year. 4:18 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Class constructor: This constructor will create instance of DateTime


class.
DateTime(<integer year>, <integer
month>, <integer day>, <integer
hour>, <integer minute>, <integer
second>, <integer hundredths>)
__cmp__ Used to compare two DateTime objects.
__repr__ Used to return string representation of DateTime
object.
SetDateTime(year, month, day, Sets date time.
hour, min, sec, hund)
SetDateTime(DateTime)
GetDateTime() Returns time as tuple containing seven integers:
(year, month, day, hour, minute, second,
hundredths)

Examples:
import KcsDateTime
a = KcsDateTime.DateTime(2001, 10, 19, 05, 10, 10, 00)
print a
see also:
# Example: kcs_ex_db01.py

4.4 User Interface


These python classes are of user interface type.

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:

© Copyright 1974 to current year. 4:19 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__cmp__ Used to compare two ButtonState objects.


__repr__ Used to return string representation of ButtonState object.

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.

© Copyright 1974 to current year. 4:20 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:21 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:22 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

GetDefMode() This function will return name of selected


definition mode.
Look at KcsStat_point2D_req.Point2dDefModes
dictionary for definition modes names.
SetCursorType(CursorType) This function will set cursor type to specified by
CursorType instance of
KcsCursorType.CursorType class.
GetCursorType() This function will return current cursor type as
instance of KcsCursorType.CursorType class.
SetHelpPoint(point) This function will set help point for
ModeOffsetCurrent point definition mode.
SetHelpPoint(None)
Note: that user can select mode to
ModeOffsetCurrent during selection so if
this point will be None then mode will be
greyed on point definition mode toolbar.

Use SetHelpPoint(None) to delete existing help


point.
GetHelpPoint() This function will return currently defined help
point. If no point is defined it will return python
None value.
SetScale(scale) Set scale. If None scale will be fetched from
current subpicture.
SetScale(None)
GetScale() Returns scale value.

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()

Class KcsStat_point3D_req. Stat_point3D_req()


The class holds information about some initial status when defining a 3D point, using the
point3D_req function.
Attributes:
Helpdef integer Help point defined?
= 0 No (default)
= 1 Yes
Helppnt Point3D The help point (if defined)

© Copyright 1974 to current year. 4:23 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Lockstatic integer Initial lock protected?


= 0 No (default)
= 1 Yes
Locktype integer Type of lock:
= 0 No lock (default)
=1 Lock plane
= 2 Lock line
Lockpnt Point3D A point through the plane/line (if lock)
Lockvec Vector3D A vector perpendicular to the plane /
parallel to the line (normalised) (if lock)
Initial3D integer The initial way of defining the 3D point:
= 1 Pick line (by indicating in a view)
= 2 Key in
= 3 Indicate event point (default)
= 4 Offset from current (the help point)
Initial2D integer The initial way of defining a 2D point (used by Pick
Line)
= 1 Key in (2D)
= 2 Cursor position (default)
= 3 End or node point
= 4 Existing point
= 5 Symbol connection
= 6 Auto point
= 7 Point on arc at angle
= 8 Arc centre
= 9 Point at distance along
= 10 Mid point
= 13 Intersecting point
= 20 Offset from current point
= 21 Closest segment point
= 22 Centre of gravity
= 23 Event point (2D)
Methods:
None

Examples (to enable lock line) :


status = KcsStat_point3D_req.Stat_point3D_req()
status.Locktype = 2
status.Lockpnt = KcsPoint3D.Point3D(1000.0,2000.0,1500.0)
.Lockvec = KcsPoint3D.Point3D(1.0,0.0,0.0)
status
status.Initial3D = 1
status.Initial2D = 3 ## Pick line
## End/node point

© Copyright 1974 to current year. 4:24 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:25 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:26 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Valid colours are:

"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:

© Copyright 1974 to current year. 4:27 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

LinetypeString string The name of the line type.


Alias names can be used as well as system
names. To get all linetype names use
GetLinetypes() function in KcsLinetype module. It
will return python dictionary containing pairs:
system name - alias name. There are also two
other useful functions in KcsLinetype module:
GetAliasName(name) - returns alias name for given
system name,
GetSystemName(name) - returns system name for
given alias name.
Methods:
SetName
Name

Examples:
# get system name for first alias name
aliases = KcsLinetype.GetLinetypes()
SysName = KcsLinetype.GetSystemName(aliases[0])

# create instances of Linetype class


lt1 = KcsLinetype.Linetype(SysName)
lt1_str = lt1.Name()
lt2 = KcsLinetype.Linetype()
lt2.SetName( lt1_str)

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.

© Copyright 1974 to current year. 4:28 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Valid types are:


"panel"
"boundary"
"hole"
"bracket"
"plate"
"notch"
"seam"
"stiffener"
"flange"
"pillar"
"bead"
"cutout"
"excess"
"hole/notch/cutout"
"point"
"curve"
"unknown"
PartId integer The model part ID
SubPartType string The model subpart type.
Valid types are:
""
"limit"
“crossmark”
SubPartId integer The model subpart ID
ReflCode integer Reflection code (relevant for Hull).
Valid codes are:
0 = not reflected
1 = reflected
Methods:
SetType
Type
SetName
Name
PartType
PartId
SubPartType
SubPartId
ReflCode

Class KcsModelDrawAssyCriteria. ModelDrawAssyCriteria


The class holds information about assembly that will be drawn.
Parameters and attributes:
__Name string Name of assembly object.
__Recursive integer Recursive/Parts mode flag.
__Criteria dictionary Selection criteria for model types.

© Copyright 1974 to current year. 4:29 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

kcs_draft.model_draw(criteria) .......................... # draw model

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.

© Copyright 1974 to current year. 4:30 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__Size integer Size of object given in number of blocks (1 block =


512 bytes)
Methods:
Class constructor: This constructor will create instance of Object
class.
Object()
__cmp__ Used to compare two Object instances.
__repr__ Used to return string representation of Object
instance.
SetName(string) Sets database object name.
GetName() Returns name of database object.
SetCode1(integer) Sets database object code 1.
GetCode1() Returns database object code 1.
SetCode2(integer) Sets database object code 2.
GetCode2() Returns database object code 2.
__SetSize(integer) For internal use only.
GetSize() Returns object size in blocks.
SetCreationDate(DateTime) Sets creation date.
GetCreationDate() Returns creation date as DateTime instance.

Example:
import KcsObject

a = KcsObject.Object(05, 10, 10, 00)


print a
a.SetName('SP162-2')
print a

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

© Copyright 1974 to current year. 4:31 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__Size tuple or None Size criteria. Stored as:


1. (integer, integer)
2. None
Methods:
Class constructor: This constructor will create instance of
ObjectCriteria class. All criteria are set to None so
ObjectCriteria()
all objects match criteria.
__cmp__ Used to compare two ObjectCriteria instances.
__repr__ Used to return string representation of
ObjectCriteria instance.
SetName(string) Sets name criteria or deletes it.
SetName(None)
GetName() Returns name criteria or None if not set.
SetCode1(integer) Sets code1 criteria or deletes it.
SetCode1(None)
GetCode1() Returns code1 criteria or None if not set.
SetCode2(integer) Sets code2 criteria or deletes it.
SetCode2(None)
GetCode2() Returns code2 criteria or None if not set.
SetSize(integer size) Sets size criteria:
SetSize(string type, integer size) 1. Type will be set to '='
2. Size and type selected by user
SetSize(None) 3. Criteria will be deleted
Defined types for that criteria are in:
ObjectCriteria.SignDefinition tuple.
GetSize() Returns tuple:
(string type, integer size)
or None if not defined.
SetCreationDate(DateTime start, Sets creation date criteria:
DateTime end) 1. Between dates
SetCreationDate(string type, 2. Depending on type
DateTime date) 3. No criteria

SetCreationDate(None) Defined types for that criteria are in:


ObjectCriteria.SignDefinition tuple.
GetCreationDate() Returns tuple:
1. (DateTime, DateTime)
2. (string type, DateTime)
or None if not defined.

© Copyright 1974 to current year. 4:32 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:33 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Scale real Scale value (valid only if Scale-to-fit is not


selected):
Figure 4:1. 0 - Use current value

Figure 4:2. >0 - new value for scale


printername string Initial value for PrinterName
Methods:
SetPrinterName
GetPrinterName
SetOrientation
GetOrientation
SetPrintToFile
IsPrintToFile
SetNumberOfCopies
GetNumberOfCopies
SetEffectivePrintArea
GetEffectivePrintArea
SetAutoOrient
GetAutoOrient
SetScaleToFit
GetScaleToFit
SetScale
GetScale
SetFileName
GetFileName

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:

© Copyright 1974 to current year. 4:34 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__type integer Type of transformation matrix. It is for internal use


so if any transformation methods will be added to
this class take care of setting this variable to
correct value.
0= Undefined transformation
1= Identity transformation
2= Transformation may also consist of translations.
3= Transformation may also consist of rotations.
4= Transformation may also consist of uniform
scalings.
5 = Transformation may also consist of reflections.
6 = Transformation may also consist of general
scalings.
7 = Transformation may also consist of skews
(shears).
8 = Transformation may also consist of parallel
projection.
9 = Transformation may also consist of central
projection.
__matrix list of reals Transformation matrix.
Methods:
__Set(Row, Col, Value) Sets matrix item at Row and Col to Value.
Row and Col must be value from 0 to 2.
__Get(Row, Col) Gets matrix item at Row and Col.
Row and Col must be value from 0 to 2.
__Decompose() Decomposes transformation matrix to linear
transformations as: scale, rotation, translation etc.
IdentityTransf() Initializes identity matrix.
Translate(vector2D) Performs translation about vector vector2D which
is an instance of Vector2D class.
Rotate(center, angle) Performs rotation about centre (instance of
Point2D) and angle given in radians.
Scale(factor) Performs uniform scaling by given factor.
Reflect(point2D, vector2D) Performs reflection in a given line.
Line is given by point2D and direction vector
vector2D.
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.
GetScale() Returns scale factors for x and y axis as tuple of
two reals.
GetXYShear() Returns XY shear factor.
GetTranslation() Returns translation in x and y axis as tuple of two
reals.
GetRotation() Returns rotation in radians.
GetReflection() Returns reflection factor.

© Copyright 1974 to current year. 4:35 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

kcs_draft.element_transform(handle, transformation). # transform element

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:

© Copyright 1974 to current year. 4:36 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__repr__ Returns string representation of CaptureRegion2D object.

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())

Class KcsSymbol.Symbol(fontid, symbolid)


The class holds information about symbol element.
Parameters and attributes:
__Visible integer Visibility. If 1 symbol is visible, if 0 not.
__Detectable integer Detectability. If 1 symbol is detectable, if 0 not.
__Colour Colour Colour
__LineType LineType LineType
__Layer Layer Layer
__Position Point2D Position of symbol element.
__Height real Height of symbol element.
__Rotation real Rotation of symbol element (in degrees).
__Reflection integer Reflection of symbol element.
__SymbolId integer Symbol id of symbol element.
__FontId integer Font id of symbol element.

© Copyright 1974 to current year. 4:37 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Fontid integer Initial value for __FontId attribute.


Symbolid integer Initial value for __SymbolId attribute.
Methods:
SetFontId
GetFontId
SetSymbolId
GetSymbolId
SetDetectable
IsDetectable
SetColour
GetColour
SetLineType
GetLineType
SetLayer
GetLayer
SetPosition
GetPosition
SetHeight
GetHeight
SetRotation
GetRotation
SetVisible
InVisible
SetReflectionInUAxis
IsReflectedInUAxis
SetReflectionInVAxis
IsReflectedInVAxis
SetNoReflection
IsReflected

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

© Copyright 1974 to current year. 4:38 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__Layer Layer Layer


__Position Point2D Position of text element.
__Height real Height of text element.
__Rotation real Rotation of text element (in degrees).
__Aspect real Aspect ratio of text element.
__Slanting real Slant ratio of text element.
__Font string Font of text element.
__String string String of text element.
text string Parameter which defines initial __String value.
Methods:
SetString
GetString
SetVisible
IsVisible
SetDetectable
IsDetectable
SetColour
GetColour
SetLineType
GetLineType
SetLayer
GetLayer
SetPosition
GetPosition
SetHeight
GetHeight
SetRotation
GetRotation
SetAspect
GetAspect
SetSlanting
GetSlanting
SetFont
GetFont

Example:
text = 'example text'
textElement = KcsText.Text(text)
textElement.SetVisible(1)
aspect = textElement.GetAspect()

Class KcsInterpretationObject.SymbolicView

© Copyright 1974 to current year. 4:39 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

The class holds information about symbolic view


Parameters and attributes:
__ViewName string View name
__Looking constant Looking mode. Can be one of:
• SymbolicView.LOOKING_FOR
• SymbolicView.LOOKING_AFT
• SymbolicView.LOOKING_PS
• SymbolicView.LOOKING_SB
• SymbolicView.LOOKING_TOP
• SymbolicView.LOOKING_BOT
__PlaneType constant Plane type. Can be one of:
• SymbolicView.PLANE_BY_X
• SymbolicView.PLANE_BY_Y
• SymbolicView.PLANE_BY_Z
• SymbolicView.PLANE_BY_3POINTS
• SymbolicView.PLANE_BY_PANEL
• SymbolicView.PLANE_BY_CURVE
• SymbolicView.PLANE_BY_RSO
__Origin Point3D Origin point for plane definition
__UAxis Point3D Uaxis for plane definition
__VAxis Point3D Vaxis for plane definition
__DepthBefore real Depth before
__DepthAfter real Depth after
__ObjectName string Panel, curve or RSO object name
__CompType constant Object type. Can be one of:
• SymbolicView.TYPE_PANEL
• SymbolicView.TYPE_BRACKET
• SymbolicView.TYPE_STIFFENER
• SymbolicView.TYPE_FLANGE
__CompNo integer Number of component if object type
different than
SymbolicView.TYPE_PANEL
__Reflect integer Reflection flag
__OnlyCurrent integer Only current panel flag
__LimMin Point3D Lower corner of box limits
__LimMax Point3D Upper corner of box limits
__ViewType constant View type. Can be one of:
• SymbolicView.VIEW_DESIGN
• SymbolicView.VIEW_ASSEMBLY

© Copyright 1974 to current year. 4:40 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__ShellCurveType constant Shell curve type. Can be one of:


• SymbolicView.CURVE_EXISTING
• SymbolicView.CURVE_BY_NAME
• SymbolicView.CURVE_CUT
• SymbolicView.CURVE_NONE
__DrawRSO Integer Draw RSO flag
__ShellProfiles Integer Shell profiles flag
__ShellSeams Integer Shell seams flag
__DrawPlaneViews Integer Draw plane views flag
__DrawIntersections Integer Draw intersections flag
__AutomaticSelection Integer Automatic selection flag
__DrawAsPlate Integer Draw as plate flag
__PanelsFilter List List of panels
__PanelsExclude Integer Panels exclude flag
__BlocksFilter List List of blocks
__BlocksExclude Integer Blocks exclude flag
__ShellCurves List List of shell curves
__Assemblies List List of assemblies
Methods:
SetViewName(string) Sets to set view name.
GetViewName() Returns view name.
SetPlaneByX(real) Sets plane by X coordinate. X coordinate is
stored in Origin point.
SetPlaneByY(real) Sets plane by Y coordinate. Y coordinate is
stored in Origin point.
SetPlaneByZ(real) Sets plane by Z coordinate. Z coordinate is
stored in Origin point.
SetPlaneBy3Points(Point3D, Point3D, Sets plane by giving 3 points: origin, uaxis,
Point3D) vaxis.
SetPlaneByPanel(panel, object_type, Sets plane giving panel name. Object type
reflect, onlycurrent) can be one of: see description of
__CompType attribute. Reflect and only
current are true/false flags.
SetPlaneByCurve(curve, reflect) Sets plane giving curve name. Reflect is a
true/false flag.
SetPlaneByRSO(rsoobject, compno) Sets plane giving rso object name and
component number.
GetPlaneType() Returns plane type. See description of
__PlaneType attribute for possible values.
IsReflect() Returns status of __Reflect flag.
IsOnlyCurrent() Returns status of __OnlyCurrent flag.
GetComponentNo() Returns component number.
GetComponentType() Returns component type. See description of
__CompType for possible values.

© Copyright 1974 to current year. 4:41 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

GetObjectName() Returns name of object (panel, curve,


rsoobject)
SetLooking(looking) Sets looking mode. See description of
__Looking attribute for possible values.
GetLooking() Returns looking mode. See description of
__Looking attribute for possible values.
SetDepth(before, behind) Sets depth values.
GetDepth() Returns depth as tuple: (before, behind)
SetLimits(min3d, max3d) Sets box limits by two 3D points.
GetLimits() Returns box limits as tuple of two 3D points:
(min3d, max3d)
SetViewType(viewtype) Sets view type. See description of
__ViewType attribute for possible values.
GetViewType() Returns view type. See description of
__ViewType attribute for possible values.
SetShellCurves(curvetype, curves=[]) Sets shell curves. See description
of__ShellCurveType attribute for possible
values of curve type. List of curves must be
specified only if type of curve is:
SymbolicView.CURVE_BY_NAME
GetShellCurveType() Returns curve type. See description of
__ShellCurveType attribute for possible
values.
GetShellCurves() Returns list of curve names.
SetDrawRSO(integer) Sets status of Draw RSO flag.
GetDrawRSO() Returns status of Draw RSO flag.
SetShellProfiles(integer) Sets status of Shell Profiles flag.
GetShellProfiles() Returns status of shell profiles flag.
SetShellSeams(integer) Sets status of Shell Seams flag.
GetShellSeams() Returns status of Shell Seams flag.
SetDrawPlaneViews(integer) Sets status of Draw Plane Views flag.
GetDrawPlaneViews() Returns status of Draw Plane Views flag.
SetDrawIntersections(integer) Sets status of Draw Intersections flag.
GetDrawIntersections() Returns status of Draw Intersections flag.
SetAutomaticSelection(integer) Sets Automatic Selection flag.
GetAutomaticSelection() Returns status of Automatic Selection flag.
SetDrawAsPlate(integer) Sets Draw As Plate flag.
GetDrawAsPlate() Returns status of Draw As Plate flag.
SetPanelsFilter(panels, exclude=0) Sets panels filter by list of panels name and
exclude flag.
GetPanelsFilter() Returns status of panels filter. The method
returns tuple: (list of panels names, exclude
flag)
SetBlocksFilter(blocks, exclude=0) Sets blocks filter by list of blocks name and
exclude flag.

© Copyright 1974 to current year. 4:42 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

GetBlocksFilter() Returns status of blocks filter. The method


returns tuple: (list of blocks names, exclude
flag)
SetAssemblies(assemblies) Sets assemblies list. Valid only for
ASSEMBLY view.
GetAssemblies() Returns list of assemblies.

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)

© Copyright 1974 to current year. 4:43 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:44 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Parameters and attributes:


__JointName string Name of joint
__JointComment string Joint comment
__WeldType string Weld type
__JointLength real Joint length
__SuspensionLeng real Suspension length
th
__Assembly1 string Assembly name for first part
__Assembly2 string Assembly name for second part
__Part1 string First part
__Part2 string Second part
__Type1 integer Type for first part
__Type2 integer Type for second part
__Welds list of Weld Weld data
Methods:
Class constructor: This constructor will create an instance of
WeldedJoint class
WeldedJoint()
SetJointName(string) Sets welded joint name
GetJointName() Returns welded joint name
SetJointComment(string) Sets welded joint comment
GetJointComment() Returns welded joint comment
SetWeldType(string) Sets weld type. Use one of the following types:
'fillet', 'butt'.
GetWeldType() Returns weld type
SetJointLength(real) Sets welded joint length
GetJointLength() Returns welded joint length
SetSuspensionLength(real) Sets welded joint suspension length
GetSuspensionLength() Returns welded joint suspension length
SetAssemblyName(int, string) Sets assembly name for the given part
GetAssemblyName((int) Returns assembly name for the given part
SetPartName(int, string) Sets name of the given part
GetPartName(int) Returns name of the given part
SetPartType(int) Sets type of the given part
GetPartType(int) Returns type of the given part
GetNumberWelds() Returns number of welds in welded joint
SetWeld(int, Weld) Sets the given weld
GetWeld(int) Returns the given weld
AddWeld(Weld) Adds the weld

© Copyright 1974 to current year. 4:45 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:46 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

SetLegLength(real) Sets weld leg length


GetLegLength() Returns weld leg length
SetLayers(int) Sets number of weld layers
GetLayers() Returns number of weld layers
SetPosition(string) Sets weld position
GetPosition() Returns weld position
SetTestProcedure(string) Sets weld test procedure
GetTestProcedure() Returns weld test procedure
SetProcess(string) Sets weld process
GetProcess() Returns weld process
SetStandardProcess(string) Sets weld standard process
GetStandardProcess() Returns weld standard process
SetStartSuspension(real) Sets start suspension
GetStartSuspension() Returns start suspension
SetEndSuspension(real) Sets end suspension
GetEndSuspension() Returns end suspension
SetConnectionAngle(real) Sets connection angle
GetConnectionAngle() Returns connection angle
SetRotationAngle(real) Sets rotation angle
GetRotationAngle() Returns rotation angle
SetInclinationAngle(real) Sets inclination angle
GetInclinationAngle() Returns inclination angle
SetTorchVector(Vector3D) Sets torch vector
GetTorchVector() Returns torch vector
SetBevelCode(int,real) Sets bevel code for the given part
GetBevelCode(int) Returns bevel code for the given part
SetThickness(int,real) Sets thickness for the given part
GetThickness(int) Returns thickness for the given part

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)

© Copyright 1974 to current year. 4:47 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:48 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

TraceFilter [ string ] List of names of shell profiles whose traces will be


included/excluded (depends on TraceExclude
flag).
TraceExclude integer Except flag
SectionFilter [ string ] List of names of shell profiles whose sections will
be included/excluded (depends on SectionExclude
flag).
SectionExclude integer Except flag
SelectCurves dictionary Curve Name/LineType dictionary (name : line
type). Line type must be defined in system.
Constructor:
BodyPlanViewO This constructor will create instance of BodyPlanViewOptions () class.
ptions()
Methods:
SetSection (image, frame) Sets longitudinal section image and frame.
image constant Longitudinal section image type (IMAGE_THICK,
IMAGE_MOULD or IMAGE_FULL)
frame integer Longitudinal section frame
GetSection () (constant, Gets section image and frame (image, frame)
integer)
SetColours (long, seam, frame) Sets longitudinal, seam and frame colours.
Available colour strings are defined in
KcsBodyPlanViewOptions.COLOURS table.
long colour Longitudinal colour
seam colour Seam colour
frame colour Frame colour
GetColours () (Colour, Colour, Gets longitudinal, seam and frame colours (long,
Colour) seam, frame)
Class protocols:
__repr__ Used to return string representation of BodyPlanViewOptions() object.

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:

© Copyright 1974 to current year. 4:49 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

SetNameMapping Sets Dictionary It defines names of panels to copy and names


(Dictionary) used to change after copy operation.
Panel Names.
Example call of Method:
SetNameMapping({'oldPanel' :
'newPanel'})
Where:
• OldPanel – is name of copied panel
• NewPanel – is name of panel created by
copy function.
SetBlockName Sets Block for It defines name of block where panel will be
(string) copied Panel copied.

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:

© Copyright 1974 to current year. 4:50 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

SetPrincipalPlane (integer, integer, Sets Principal Plane by giving cord, relpos,


string) cordval. Example call:
SetPrincipalPlane(coordinate,
relativePosition,
coordinateValue)
Where:
coordinate – is coordinate definition, which
defines plane of moving operation. See
parameters and attributes definition.
relativePosition – is flag which defines if
coordinateValue is relative position or absolute.
See parameters and attributes definition.
CoordinateValue – is, regarding to
relativePosition flag, absolute coordinate value
or relative coordinate value i.e. ‘1000’ or ‘FR1’ .
SetThreePoints (Point3D, Point3D, Sets three points by giving: origin, uaxis, vaxis
Point3D)
Defines moving operation by three points.
SetThreePoints(Origin, Uaxis,
Vaxis)
Where:
Origin, Uaxis, Vaxis – are Point3D
definitions in UVW coordinate system.
SetPlaneObject(string) Sets Plane Object by giving: name
Set moving operation by plane object where
name is plane object name used to move panel.

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

© Copyright 1974 to current year. 4:51 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:52 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__Develop integer Set the develop option for the hole.


1 – true
0 – false
__IsArbitrary integer Set the hole arbitrary, i.e. the hole designation is
a curve.
1 - true
0 - false
__MarkType Constant Defines Marking Type
HOLE_MARK = 0
CROSS_MARK = 1
BOTH_MARK = 2
__CrossType Constant Defines Cross Type:
OVERHOLE_CROSS = 0
SMALL_CROSS = 1
SPECIAL_CROSS = 2
__MarkLen Float Defines Marking Length
Methods:
SetOriginAlongLine (Pt1, Pt2 ) Defines the origin of a hole in a curved panel,
when defined "along line".
The (limited) line is defined by two 3d points.
The origin will be the intersection point of the line
and the panel.
Pt1 (Input). The start point of line intersecting
the curved panel.
Pt2 (Input). The end point of the intersecting
line.
SetOriginAlongAxis(Axis, Pt1, Defines the origin of a hole in a curved panel,
HasApprox) when defined "along axis".
The (infinite)line is defined by two coordinates.
The origin will be the intersection point of the line
and the panel. An approximate coordinate must
be given. "Axis" selects which coordinate if "Pt1"
is the approximate one.
Axis (Input). Selects the approximate
coordinate
Pt1 (Input). The coordinates.
SetOriginAsStored(Axis, Pt1) 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. You may given an approximate
coordinate in case of multiple intersection with
the surface. Approx is: (axis+coordinate value)

© Copyright 1974 to current year. 4:53 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

SetDirection(Dir) In case of an asymmetrical hole, this selects the


direction of the U-axis of the hole. "Dir" is either
a vector or a point. Interpreted as a vector if the
length <= 1.0 If dir is a point the system will form
a vector from origin the point. The vector will
then be projected into the tangent plane of the
panel ( in the origin of the hole ).
Dir (Input). Point defining the direction of the
U-axis of the hole.
SetArbitrary() Set the hole arbitrary, i.e. the hole designation is
a curve.
SetFictive() Set "fictive" form the hole, ( A fictive hole will not
be burnt, only marked.)
SetDevelop() Set the develop option for the hole.
SetMarkingType(type) Defines Marking Type
SetCrossType(self, type) Defines Cross Type
SetMarkLength(self, value) Defines Marking Length
GetOriginAlongLine(self) Gets the origin of a hole in a curved panel, when
defined along line
GetOriginAlongAxis(self) Gets the origin of a hole in a curved panel, when
defined along axis
GetOriginAsStored(self) Gets the origin of a hole in a curved panel
GetDirection(self) Gets Direction
GetDesign(self) Gets Design
IsFictive(self) Gets Fictive flag
IsDevelop(self) Gets Develop Flag
IsArbitrary(self) Gets Arbitrary Flag
GetMarkType(self) Gets Mark Type
GetCrossType(self) Gets Cross Type
GetMarkLen(self) Gets Mark Len

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.

© Copyright 1974 to current year. 4:54 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:55 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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.

© Copyright 1974 to current year. 4:56 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

_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.

© Copyright 1974 to current year. 4:57 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

_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

© Copyright 1974 to current year. 4:58 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

GetEnd1,GetEnd2 Get Connection


GetEndCut
GetCalcFrom
GetCalcWebAngle
GetParameter
GetType
SetCalcFrom
SetCalcWebAngle
SetParameter
SetTyp
GetExcess
GetFlaBevel
GetInclAngle
GetInclAngleType
GetOffset
GetOffsetFrom
GetWebBevel
SetConnection
SetExcess
SetFlaBevel
SetInclAngle
SetInclAngleType
SetOffset
SetOffsetFrom
SetWebBevel
GetFilletWeldDepth
GetGPS_1
GetGPS_2
GetGPS_3
GetGPS_4
GetPerpendicular
GetPosno
GetPosnoPrefix
GetPosnoSuffix
GetProfileParameter
GetProfileType
GetQuality
GetShrinkage
GetSurfaceTreatment
GetTraceBevel

© Copyright 1974 to current year. 4:59 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

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

© Copyright 1974 to current year. 4:60 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__StemLimitsCode Point3D Defines Limits Code. Can be one of:


PLANE_BY_SEAMS = 1
PLANE_BY_X = -1
PLANE_BY_Y = -2
PLANE_BY_Z = -3
__StemLimitsSeam [] If defined by Seams, list of seams.
s
__StemLimitsCoor Point3D Defines Limits Coordinate.
dinate
__UpperLimitsCod Constant Defines Limits Code. Can be one of:
e PLANE_BY_SEAMS = 1
PLANE_BY_X = -1
PLANE_BY_Y = -2
PLANE_BY_Z = -3
__UpperLimitsSea [] If defined by Seams, list of seams.
ms
__UpperLimitsCoor Point3D Defines Limits Coordinate.
dinate
__LowerLimitsCod Constant Defines Limits Code. Can be one of:
e PLANE_BY_SEAMS = 1
PLANE_BY_X = -1
PLANE_BY_Y = -2
PLANE_BY_Z = -3
__LowerLimitsSea [] If defined by Seams, list of seams.
ms
__LowerLimitsCoor Point3D Defines Limits Coordinate.
dinate
__SideCode Constant Defines Side Code. Can be one of:
SIDE_PORT = 0
SIDE_STARBOARD = 1
__bExceptPanels Integer Except Flag
__SelectPanels [] Include/Exclude List
__bExceptBlocks Integer Except Flag
__SelectBlocks [] Include/Exclude List
__bExceptSeams integer Except Flag
__SelectSeams [] Include/Exclude List
__bExceptLongitud integer Except Flag
inals
__SelectLongitudin [] Include/Exclude List
als
__bExceptTransver Integer Except Flag
sals
__SelectTransvers [] Include/Exclude List
als

© Copyright 1974 to current year. 4:61 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

__SelectCurves Dictionary Select Curves Dictionary


Methods:
SetShelXViewName (string) Sets View Name
SetDevelopedFromX (Point3D) Sets plane defined by X coordinate
SetDevelopedFromY (Point3D) Sets plane defined by Y coordinate
SetDevelopedFromZ (Point3D) Sets plane defined by Z coordinate
GetShellXViewName Gets View Name
SetSternLimits Sets Limits defined by plane X, Y or Z) or seams
and coordinate or seams list.
GetSternLimits Gets Stern Limits (code and coordinate or seam
list)
SetStemLimits Sets Limits defined by plane X, Y or Z) or seams
and coordinate or seams list.
GetStemLimits Gets Stem Limits (code and coordinate or seam
list)
SetUpperLimits Sets Limits defined by plane X, Y or Z) or seams
and coordinate or seams list.
GetUpperLimits Gets Upper Limits (code and coordinate or seam
list)
SetLowerLimits Sets Limits defined by plane X, Y or Z) or seams
and coordinate or seams list.
GetLowerLimits Gets Lower Limits (code and coordinate or seam
list)
SetSideCode Sets Side Code.
GetSideCode Gets Side Code.
SetSelectPanels Sets select panels list.
GetPanels Gets select panels list
SetExceptPanels Sets except panels flag
SetSelectBlocks Sets select blocks list.
GetBlocks Gets select blocks list
SetExceptBlocks Sets except blocks flag
SetSelectLongitudinals Sets select longitudinals list.
GetLongs Gets select longitudinals list
SetExceptLongitudinals Sets except longitudinals flag
SetSelectTransversals Sets select transversals list.
GetTrans Gets select transversals list
SetExceptTransversals Sets except transversals flag
SetLineTypes Sets dictionary with curves names and types
(name : type)
GetCurves Gets dictionary with curves names and types.

Class KcsSplitPanOptions.SplitPanOptions
The class holds information about Split Panel Options
Parameters and attributes:

© Copyright 1974 to current year. 4:62 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

Plane3D Plane3D Cutting Plane used to split panel


PanelMapping […] List of items defining new panels after split
operation. Each item is an dictionary containing
following keys:
‘Name’ - panel name
‘Block’ – block name
‘SymmetryCode’ – symmetry code string
Constructor:
SplitPanOptions This constructor will create an instance of SplitPanOptions class
()
Methods:
AddPanelMapping Define panel name, block and symmetry code for
(PanelName, Block, Symmetry) new panels generated by split operation. The
function should be called once for each new panel.
PanelName String New panel name
Block <String> Panel block. If not defined panel block is remained.
Symmetry <String> Panel symmetry code. Possible values: ‘S’, ‘P’,
‘SP’, ‘SBPS’. Default value is ‘SBPS’.
Class protocols:
__repr__ Used to return string representation of SplitPanOptions object.

© Copyright 1974 to current year. 4:63 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Python Classes

© Copyright 1974 to current year. 4:64 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Drafting

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.2 Exception Handling


The Vitesse Drafting interface uses exception handling. This means that if a run time error
occurs an exception is set. The exception can be caught using the "try - except" construct of
the Python language. The type of error can then be examined by checking the value of
kcs_draft.error. The exception is also displayed in the Vitesse Log window which is
available by the Vitesse Log Window command and can optionally be written to the log file.
The meaning of the exception can be found in the description of the corresponding function.

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.

5.4 Drawing Functions


This section describes functions that handle drawings on object level. The default data bank
for drawings is the Drawing Data Bank, SB_PDB.

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.

dwg_new(DwgName, <FormName>, <DwgType>)


The function creates a new drawing and makes it the current one. The optional
FormName gives the name of the drawing form.
Input Parameters:
DwgName string Name of drawing (maximum 25 characters)
<FormName> string Name of drawing form (optional)

5:2 12 Series
Vitesse User Guide
Drafting

<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:
None
Exceptions:
kcs_DbError Databank error
kcs_DrawingCurrent A drawing is already current
kcs_DrawingExist A drawing named DwgName already exists in the
data bank
kcs_FormLocked The drawing form is locked in the data bank.
kcs_FormNotFound The drawing form was not found in the data bank.
kcs_NameError Invalid name of drawing
kcs_NameOccupied The name DwgName or FormName is used by
the system.
kcs_CouldNotOpenDatabank Not possible to open databank. Probably
because of wrong user database name or id.
kcs_VolumeCurrent A volume is already current.

dwg_open(DwgName, <DwgType>, <OpenMode>, <DwgRevision>),


<EnvelopeMode>)
The function opens an existing drawing and makes it the current one. It is possible to
specify a Drawing Type, an Open Mode and a Drawing Revision Name.
Input Parameters:
DwgName string Name of drawing

5:3 12 Series
Vitesse User Guide
Drafting

<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. 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.
<OpenMode> constant Drawing Open Mode. It can be one of the
following constants:
• kcs_draft.kcsOPENMODE_READONLY
• kcs_draft.kcsOPENMODE_READWRITE
This parameter is optional. If it is not given, the
drawing will be opened in read-write mode.
<DwgRevision> string Drawing Revision Name. This parameter is valid
only in case of TDM usage. If an empty string is
given, the latest revision of the drawing will be
opened. To open the Base Revision, use the
kcs_draft.kcsBASE_REVISION constant.
This parameter is optional. If not given the latest
revision of drawing will be opened.
<EnvelopeMode> constant Drawing views envelope mode. It can be one of
the following constants:
• kcs_draft.kcsENVELOPE_NONE
• kcs_draft.kcsENVELOPE_INITIAL
• kcs_draft.kcsENVELOPE_PERMANENT
This parameter is optional. If it is not given, the
drawing views will be opened without envelope.
Returned value:
None
Exceptions:
kcs_Error General error
kcs_DbError Databank error
kcs_DrawingCurrent A drawing is already current
kcs_DrawingLocked The drawing is locked in the databank.

5:4 12 Series
Vitesse User Guide
Drafting

kcs_DrawingNotFound The drawing was not found in the databank.


kcs_NameOccupied The name is used by system.
kcs_VolumeCurrent The volume mode is active.
Kcs_RevisionNotFound The revision not found for given drawing.
Kcs_CouldNotOpenDatabank Not possible to open databank. Probably
because of wrong user database name or id.

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

dwg_reference_show (show, <views>)


This function expands or collapses drawing references in current drawing.
Input Parameters:
show true/false Boolean value. If true then reference will be
expanded otherwise collapsed.
<views> List, tuple of Handles to views that should be expanded/
ElementHandle collapsed. This parameter is optional. If not given
or instance of then all reference views will be considered.
ElementHandle
.
Returned value:
None.
Exceptions:
kcs_ArgumentError Argument Error
kcs_DrawingNotCurrent There is no current drawing.

5:5 12 Series
Vitesse User Guide
Drafting

kcs_HandleInvalid Given handle is not a valid handle.


kcs_ValueError Given handle is not an instance of
ElementHandle.
kcs_DrawingNotFound Reference drawing not found.
kcs_DrawingLocked Reference drawing locked.
kcs_ReferenceDrawingInvalid Reference drawing invalid.
kcs_DrawingEmpty Reference drawing empty.

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

<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 also be
specified by
1. constant
kcs_draft.kcsDWGTYPE_USER_DEFINED
and database indexe.g.
kcs_draft.kcsDWGTYPE_USER_DEFINED
+2
2. logical databank names: e.g. "SB_PDB002"
Returned value:
None
Exceptions:
kcs_DbError Data bank error
kcs_DrawingLocked The drawing is locked in the data bank.
kcs_DrawingNotFound The drawing is not found in the data bank.
kcs_CouldNotOpenDatabank Not possible to open databank. Probably
because of wrong user database name or id.

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

options PrintOptions Python class describing print options.


Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_PrinterNotFound Selected printer not found.
kcs_PrintError Print error: e.g. wrong file name for print-to-file
printing.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.

dwg_dxf_export(FileName, <ACVersion>, <Mode>, <nElemVisibility>,


<nLayerVisibility>)
The function exports the current drawing to a 2D DXF file.
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.
<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 ext 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_ValueError Version is not valid.

5:9 12 Series
Vitesse User Guide
Drafting

kcs_Error Internal error. Drawing can not be exported.

dwg_dxf_import(FileName, DrawingName, <MapFileName>)


The function imports the drawing from a 2D DXF file. No drawing must be current before.
Input Parameters:
FileName string Name of file to be opened. If no extension is
given, the default extension .dxf will be used.
<MapFileName> string Name of file with import map definition. This
parameter is optionally. Default import map is
defined in dxfimport.def file located in
directory described by SBGD_DEF.
The format of this file is as follows:
It is divided in three sections:
One for mapping layers, one for mapping
linetypes and one for mapping fonts. These
sections have specified headers ([LAYERS],
[LTYPES], [FONTS]) followed by pairs of DXF
objects and corresponding Drafting objects to be
used, every value in a new line. The example
here shows how such mapping file could look
like.
[LAYERS]
dxflayer1
34
dxflyer2
55
[LTYPES]
BYLAYER
SYSTEM32
DrawingName string Name for new drawing that will be created.
Returned value:
None.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingIsCurrent There is current drawing.
kcs_DoesNotExist Source file doesn’t exist.
kcs_ValueError For some reasons file can not be opened or
illegal drawing name.
kcs_NameOccupied Drawing name is already in use.
kcs_Error Internal error. Drawing can not be imported.

Example
#Example:kcs_ex_draft32.py

dwg_dxf_2d3d_export(FileName, ViewSubviewsList, Paper, Margins <DetailLevel>,


<ACVersion>, <Mode>, <nElemVisibility>, <nLayerVisibility>)

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

kcs_ValueError This exception is generated if:


• detail level or version is not valid
• for some reasons output file can't be
opened. For example file on read only drive.
kcs_Error Internal error. Drawing cannot be exported.

dwg_dxf_3d_export(FileName, ViewSubviewsList, <DetailLevel>, <ACVersion>,


<Mode>)
The function exports all models in the given views and subviews to a 3D DXF Facet
format.
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 List of views and/or subviews handles. Specified
Element views/subviews must be model views/subviews.
Handle
<DetailLevel> integer Level of dxf file detail. It can be one of the
following:
1 - Low detail
2 - Medium detail
3 - High detail (default)l
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 R1314 - 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.
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:12 12 Series
Vitesse User Guide
Drafting

kcs_ValueError This exception is generated if:


• detail level or version is not valid
• for some reasons output file can’t be
opened. For example file on read only drive.
kcs_Error Internal error. Drawing can not be exported.

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.

User defined drawing types


Any of user defined drawing types are equal to:
kcsDWGTYPE_USER_DEFINED + database
index
where index starts from 1. It means that
each type which has a value higher than
kcsDWGTYPE_USER_DEFINED is a user
defined drawing type.
Exceptions:
kcs_Error General error
Example:
#kcs_ex_draft01.py

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:

These are examples on how to use the drawing functions.

# Example: kcs_ex_draft1.py
# Example: kcs_ex_draft27.py
# Example: kcs_ex_draft30.py

5.5 Functions for Modal Properties


This chapter describes functions to access different modal properties used in the Drafting
system. See also the functions for Functions for Default Values access.

5.5.1 General Properties

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

5.5.2 Hatch Pattern


Functions for setting the modal hatch pattern type.

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

5.5.3 Note and Position Number Symbols


Functions for accessing modal properties for notes and position numbers.
See Creating Note and Position Number symbols in Drafting User's Guide for further
information..

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

5.5.4 Text Attributes


This section describes text attributes functions.

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

[0] real The text rotation angle, in degrees


Exceptions:
None

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.

Note: that the validity of given font is not checked here.


Input Parameters:
Vfont integer The text vector font
Returned value:
None
Exceptions:
None

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

5.5.5 Symbol Attributes


This section describes symbol attribute functions.

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

[0] real The symbol height


Exceptions:
None

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

5.6 Functions for Default Values


Refer to Marine Drafting, Model Viewing and General Drafting for general information about
the Default handling in Drafting.
This chapter describes functions to access the default settings in Drafting, see also Drafting
Default File Keywords.

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.7 View Functions


This chapter describes functions to create and handle views in the current drawing.

view_new(ViewName, <Uvect>, <Vvect>)


The function creates a new view in the current drawing. The projection plane is defined by
two non-parallel 3D vectors. The cross product of these vectors defines the direction
towards the viewer.
Input Parameters:
ViewName String The name of the view (max 25 characters). An
empty string is accepted. If view name is not empty
and there is another view with such name exception
will be raised.
Uvect Vector3D The u-vector defining the projection plane (optional;
default the x-axis)
Vvect Vector3D The v-vector defining the projection plane (optional;
default the y-axis)
Returned value:
[0] ElementHan Handle to the created view.
dle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_NameOccupied There is already view with specified name.

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

view_reflect(ViewHandle, Reflect, Centre)


The function reflects a view in a given line.
Input Parameters:
ViewHandle integer Handle to the view
Reflect integer The reflection line:
1 = the u-axis through given centre
2 = the v-axis through given centre
Centre Point2D Centre of reflection (optional; default the centre of
the circumscribed rectangle of the view)
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to given view

view_rotate(ViewHandle, RotAngle, Centre)


The function rotates a view around a given centre.
Input Parameters:
ViewHandle integer Handle to the view
RotAngle real The rotation angle, in degrees
Centre Point2D Centre of rotation (optional; default the centre of the
circumscribed rectangle of the view)
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_scale(ViewHandle, ScaleFac, Centre)


The function scales a view around a given centre.
Input Parameters:
ViewHandle integer Handle to the view
ScaleFac real The scale factor (relative)
Centre Point2D Centre of scaling (optional; default the centre of the
circumscribed rectangle of the view)
Returned value:
None
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to given view

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

point_transform(ViewHandle, ModelPnt, DwgPnt)

5:28 12 Series
Vitesse User Guide
Drafting

The function transforms a 3D point to a 2D point in a given view.


Input Parameters:
ViewHandle integer Handle to the view
ModelPnt Point3D The 3D point
Output Parameters:
DwgPnt Point2D The resulting 2D point
Returned value:
[0] Point2D The resulting 2D point
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to given view

view_symbolic_new(ViewName, LocPoint, Uvect, Vvect, Forward, Backward, box)


view_symbolic_new(SymbolicView)
The function creates a new symbolic view in the current drawing. The projection plane is
defined by two non-parallel 3D vectors. The cross product of these vectors defines the
direction towards the viewer. An instance of the KcsInterpretationObject.SymbolicView
class can also be used.
Input Parameters:
ViewName string The name of the view (max 25 characters). An
empty string is accepted. If view name is not empty
and there is another view with such name exception
will be raised.
LocPoint Point3D Location (origin) of view projection.
Uvect Vector3D The u-vector defining the projection plane.
Vvect Vector3D The v-vector defining the projection plane.
Forward real Forward depth of slice for projection in relation to
plane defined by location.
Backward real Backward depth of slice for projection in relation to
plane defined by location and vectors.
box Box Axis parallel restriction box for display of models.
Any model items or parts of model items outside this
box will not be drawn when using the model_draw
function.
Returned value:
[0] ElementHan Handle to the created view.
dle
Exceptions:
kcs_DrawingNotCurrent No drawing was current.
kcs_ValueError Invalid U and V vectors.
kcs_NameOccupied There is already view with specified name.
kcs_ArgumentError Invalid arguments list.
kcs_Error General error. View can not be created.
kcs_ObjectNotFound Can't create interpretation object.

5:29 12 Series
Vitesse User Guide
Drafting

kcs_ViewNotFound View can't be created.

view_projection_get (ViewHandle, Transf3D)


The function retrieves the defined projection for a given view.
Input Parameters:
ViewHandle ElementHan Handle to view
dle
Transf3D Transformati Instance of
on3D KcsTransformation3D.Transformation3D class
Returned value:
[0] Transf3D Instance of
KcsTransformation3D.Transformation3D class
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_PythonMethodNotFound Method in Transformation3D python class not
found.

view_projection_set(ViewHandle, uVector, vVector, <DefaultDrawCode>)


The function sets the projection of a given view.
Input Parameters:
ViewHandle ElementHan Handle to view
dle
uVector Vector3D U-Vector
vVector Vector3D V-Vector
<DefaultDrawCode integer If DefaultDrawCode==, the draw codes stored in the
> model subview are used. If DefaultDrawCode=1
(default), the default draw codes are used.
Returned value:
None
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 View given by handle is not a model view.

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

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_PythonMethodNotFound Method in Transformation3D python class not
found.

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

5.8 Model Handling Functions


This chapter describes functions handling models in the current drawing.

model_draw(model, <viewhandle>)

model_draw(AssemblyCriteria, <viewhandle>)
This function draws whole model object, part or assembly. Valid model types are: plane
panel, pipe, cable way, shell profiles, equipment, struct, hull curve, placed volume and
ventilation. In case of plane panels parts like: holes and cutouts cannot be separately
drawn.
Input Parameters:

5:32 12 Series
Vitesse User Guide
Drafting

model Model Instance of KcsModel.Model class (name, type


and part).
AssemblyCriteria ModelDrawAss Instance of KcsModelDrawAssyCriteria class.
yCriteria
viewhandle ElementHandl Optional parameter. Handle to model view where
e model should be placed. If not given model will be
placed in all model views.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid arguments.
kcs_ValueError Invalid parameter value
kcs_HandleInvalid Given handle is not valid.
kcs_DrawingNotCurrent No drawing was current
kcs_ModelViewNotFound No model view is found.
kcs_Error Specified model or assembly cannot be drawn.

model_delete(Model, <ViewHandle>)
The function deletes a given model in given view in the current drawing.
Input Parameters:
Model Model The model to delete (type & name)
ViewHandle 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

model_colour_set(Model, Colour, <ViewHandle>)


The function changes the colour of a model in given view in the current drawing.
Input Parameters:
Model Model The model (type & name
Colour Colour The colour
ViewHandle 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 found in the drawing

5:33 12 Series
Vitesse User Guide
Drafting

kcs_ColourInvalid Invalid colour

model_layer_set(Model, Layer, <ViewHandle>)


The function changes the colour of a model in given view in the current drawing.
Input Parameters:
Model Model The model (type & name
Layer Layer The layer
ViewHandle 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 found in the drawing
kcs_ColourInvalid Invalid colour

model_properties_get(handle, model)
This function returns the properties of a model or part (subpicture on subview or
component level or geometry handle)
Input Parameters:
handle 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

kcs_ArgumentError Arguments types are not valid.


kcs_DrawingNotCurrent No drawing is current.
kcs_ValueError Model name and type are to long strings.
kcs_GeneralError General error.

Example:

# Example: kcs_ex_draft19.py
# Example: kcs_ex_draft33.py

5.9 Functions for Creation of Basic Geometric Entities


This section describes functions to create geometric entities (elements) in the current
drawing. These functions take an instance of a "geometric" class as input. For further
information about such geometric classes, see the documentation of General.
Each function returns a handle to the created entity, used for identification in subsequent
processing of the entity (e.g. the delete function).

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

Conic Conic2D The conic segment definition


Returned value:
[0] integer Handle to the created entity
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value

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.10 Functions for Creation of Texts


This section describes functions to create text entities (elements) in the current drawing.
Each function returns a handle to the created entity, used for identification in subsequent
processing of the entity (e.g. the delete function).

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

5.11 Functions for Creation of Symbols


This section describes functions to create symbol entities (elements) in the current drawing.
Each function returns a handle to the created entity, used for identification in subsequent
processing of the entity (e.g. the delete function).

symbol_new(Font, SymbNo, Pos)

symbol_new(Symbol)
The function creates a symbol, with modal attributes, in the current drawing.
Input Parameters:
Font integer Font number.
SymbNo integer Symbol number.
Pos Point2D Position of the symbol.
Symbol KcsSymbol Instance of KcsSymbol.Symbol class.
Returned value:
[0] integer Handle to the created symbol.
Exceptions:
kcs_FontInvalid Invalid font id
kcs_SymbolInvalid Invalid symbol id.
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current
kcs_Error General error.
kcs_PythonLibraryNotFound Program can't find python library.
kcs_PythonMethodNotFound Python module error.

Example:

# Example: kcs_ex_draft12.py

# Example: kcs_ex_draft24.py

# Example: kcs_ex_draft25.py

general_restr_symbol_new(Parent, StartPt, EndPt, Soft )


The function creates a new general restriction symbol primitive.

5:39 12 Series
Vitesse User Guide
Drafting

Parent ElementHan Parent subview handle. The created component will


dle belong to given subview.
StartPt Point2D Starting point of symbol
EndPt Point2D Ending point of symbol
Soft boolean If true restriction symbol will be generated using
spline. Otherwise contour will be used.
Returned value:
[0] ElementHan Handle to the created component.
dle
Exceptions:
ks_DrawingNotCurrent No drawing was current
kcs_HandleInvalid nvalid handle of subview.
kcs_ArgumentError Invalid arguments list.
kcs_ValueError Distance between points is to short.
kcs_Error General error. General restriction symbol can't be
created.

5.12 Functions for Creation of Drawing Components


This chapter describes functions that create drawing components, such as dimensionings
and notes. Each function returns a handle to the created component, used for identification
in subsequent processing of the component (e.g. the delete function).

5.12.1 Dimensioning Components


It is possible to create four different kinds of 2D dimensionings: Linear, Angle, Diameter and
Radius. See AVEVA Marine Drafting, Model Viewing and General Drafting for layout details.
See also Hull Drafting, Appendices for default keywords ruling the layout.

dim_linear_new(Measpnts, Type, Dir, Pos)


The function creates a linear 2D dimensioning component, given a number of points. The
dimension lines will be parallel to Dir and pass through the point Pos.
Input Parameters:
Measpnts Polygon2D Polygon containing the measure points
Type integer Type of measure:
1 = Normal
2 = Chain
3 = Staircase
Dir Vector2D The direction of the measure
Pos Point2D The location of the measure
Returned value:
[0] integer Handle to the created component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value

5:40 12 Series
Vitesse User Guide
Drafting

kcs_OwnerNotFound No structural owner to the dimensioning


component could be derived
kcs_MeasureNotCreated Failure creating the dimensioning component

dim_angle_new(Line1, Line2, ArcPos, TextPos)


The function creates an 2D angular dimensioning component, given two non-parallel
lines.
Input Parameters:
Line1 Rline2D The first line
Line2 Rline2D The second line
ArcPos Point2D The location of the measure arc
TextPos Point2D The location of the measure text
Returned value:
[0] integer Handle to the created component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_LinesParallel The two lines are parallel
kcs_OwnerNotFound No structural owner to the dimensioning
component could be derived
kcs_MeasureNotCreated Failure creating the dimensioning component

dim_diameter_new(CircleOrArc, Pos1, Pos2)


The function creates a 2D diameter dimensioning component, given a circle or an arc.
Note: Pos1 and Pos2 are optional.
• If neither Pos1 nor Pos2 are not given, the reference line will start at:
• if arc object: the middle of the arc
• if circle object: the middle of the upper right quadrant of the circle
The reference line will aim towards the centre of the arc or the circle
• If Pos1, but not Pos2, is given, the reference line is defined by Pos1 and the centre
of the arc or the circle. If Pos1 is a point inside the circle or the imagined circle
defined by the arc, the reference line will aim away from the centre; otherwise it will
aim towards the centre.
• If both Pos1 and Pos2 are given a "knuckled" measure is created. The reference line
will pass through Pos1 and the horizontal line will pass through Pos2.
Input Parameters:
CircleOrArc Circle2D/ Object containing the arc/circle to be measured
Arc2D
Pos1 Point2D The location of the measure (optional)
Pos2 Point2D The location of the horizontal part in a "knuckled"
measure (optional)
Returned value:
[0] integer Handle to the created component
Exceptions:

5:41 12 Series
Vitesse User Guide
Drafting

kcs_DrawingNotCurrent No drawing was current


kcs_ValueError Invalid parameter value
kcs_OwnerNotFound No structural owner to the dimensioning
component could be derived
kcs_MeasureNotCreated Failure creating the dimensioning component

dim_radius_new(CircleOrArc, Pos1, Pos2)


The function creates a 2D radius dimensioning component, given a circle or an arc.
Note: Pos1 and Pos2 are optional.
• If neither Pos1 nor Pos2 are not given, the reference line will start at:
• if arc object: the middle of the arc
• if circle object: the middle of the upper right quadrant of the circle
The reference line will aim towards the centre of the arc or the circle.
• If Pos1, but not Pos2, is given, the reference line is defined by Pos1 and the centre
of the arc or the circle. If Pos1 is a point inside the circle or the imagined circle
defined by the arc, the reference line will aim away from the centre; otherwise it will
aim towards the centre.
• If both Pos1 and Pos2 are given a "knuckled" measure is created. The reference line
will pass through Pos1 and the horizontal line will pass through Pos2
Input Parameters:
CircleOrArc Circle2D/ Object containing the arc/circle to be measured
Arc2D
Pos1 Point2D The location of the measure (optional)
Pos2 Point2D The location of the horizontal part in a "knuckled"
measure (optional)
Returned value:
[0] integer Handle to the created component
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value
kcs_OwnerNotFound No structural owner to the dimensioning
component could be derived
kcs_MeasureNotCreated Failure creating the dimensioning component

dim_linear_new(polygon3D, type, projDir, locPoint2D, witnDir, <modelsubview>,


<basepoint>)
The function creates a new 3D linear dimension.
Input Parameters:
polygon3D Polygon3D 3D polygon which contains 3D points for
dimensioning.
type integer Type of dimension:
1 Normal
2 Chain
3 Staircase
projDir Vector3D Projection direction vector.

5:42 12 Series
Vitesse User Guide
Drafting

locPoint2D Point2d 2D point in drawing where the coordinate dimension


should be placed.
witnDir Vector3D Direction vector for witness lines.
modelsubview ElementHan Handle to a subview where dimension will be
dle placed. It must be a model subview (optional).
basepoint integer Index of measure point (0 based) which will be used
to define dimension element plane. This parameter
is optional. If no index is given the first point will be
used.
Returned value:
[0] integer Handle to created dimension component.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current.
kcs_SubviewNotFound Subview not found.
kcs_MeasureNotCreated Dimension element not created.
kcs_Error General error.

dim_point_3d(point3D, locPoint, height, rotation, annotation, <modelsubview>)


The function creates a new point 3D dimension.
Input Parameters:
point3D Point3D 3D point for which the coordinates should be
displayed.
locPoint Point2d 2D point in drawing where the coordinate dimension
should be placed.
height real Height of dimension text.
rotation real Rotation of dimension box.
annotation string Annotation text. If empty no annotation will be
added.
modelsubview integer Handle to a subview where dimension will be
placed. It must be a model subview (optional).
Returned value:
[0] integer Handle to created dimension component.
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current.
kcs_SubviewNotFound Subview not found.
kcs_MeasureNotCreated Dimension element not created.
kcs_Error General error.
kcs_HandleInvalid Invalid handle to given subview.

dim_shell_new(Viewhandle,From, Along, To, <Type>, <Colour>)

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

5.12.2 Hatch Components

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

kcs_DrawingNotCurrent No drawing was current


kcs_ValueError Invalid parameter value
kcs_HandleInvalid Invalid handle to contour
kcs_AmplitudeTooBig The amplitude in at least one segment was too big
kcs_OwnerNotFound No structural owner to the hatch pattern component
could be derived

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

5.12.3 Note and Position Number Components

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

kcs_ValueError Invalid parameter value


kcs_SymbolError The modal note symbol was not found
kcs_OwnerNotFound No structural owner to the resulting note component
could be derived

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

5.12.4 Other Drawing Components

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

cross_new(Parent, String, Line1, Line2)


The function creates a new cross primitive.
Parent ElementHan Parent subview handle. The created cross
dle component will belong to given subview.
String Text Instance of Text class. Members of Text class like:
Visible, Detectable, Colour, Layer, Position are
ignored.
Line1 Rline2D First line for cross symbol.
Line2 Rline2D Second line for cross symbol.
Returned value:
[0] ElementHan Handle to the created cross component.
dle
Exceptions:
ks_DrawingNotCurrent No drawing was current.
kcs_ValueError Values of input parameters are invalid. For example:
lines are parallel.
kcs_ArgumentError Invalid arguments list.
kcs_Error General error. Cross component can't be created.
kcs_HandleInvalid Invalid handle of subview

ruler_new(Parent, StartPt, TickLen, FirstTick, LastTick, LabelTick, TextProp)


The function creates a new ruler primitive.
Parent ElementHan Parent subview handle. The created component will
dle belong to given subview.
StartPt Point2D Starting point of ruler
TickLen Real Distance between ticks
FirstTick Integer First ruler tick value
LastTick Integer Last ruler tick value
LabelTick Integer Value which identifies to which ticks add label with
tick value. The labelled tick is determined by
dividing total number of ticks by LabelTick value.
TextProp Text Class defining properties of ruler label texts. The
following properties are used: font, test height,
rotation, aspect ratio, slanting.
Returned value:
[0] ElementHan Handle to the created component.
dle
Exceptions:
ks_DrawingNotCurrent No drawing was current.
kcs_HandleInvalid Invalid handle of subview.
kcs_ArgumentError Invalid arguments list.
kcs_Error General error. Ruler component can't be created.

5:47 12 Series
Vitesse User Guide
Drafting

position_ruler_new (Act, View, StartPt, EndPt)


This function creates different kinds of rulers in model view and generates the complete
dimensioning components automatically.
Act integer Ruler type:
1 - Base Line
2 - Center Line
3 - Fram Ruler
4 - Longitudinal Horizontal Ruler
5 - Longitudinal Vertical Ruler
View ElementHan View handle. The created component will belong to
dle given view.
StartPt Point2D Starting point of ruler.
EndPt Point2D Ending point of ruler.
Returned value:
[0] ElementHan Handle to the created measure component.
dle
Exceptions:
kcs_DrawingNotCurrent No drawing was current.
kcs_ArgumentError Invalid arguments list.
kcs_HandleInvalid Invalid handle to view.
kcs_RulerTypeInvalid Invalid ruler type. Creation not possible in given
view,
kcs_ValueError Invalid point.
kcs_BasicLineToCloseToViewPlan The base line plane is too close to the view plane.
e
kcs_CenterLineToCloseToViewPla The center line plane is too close to the view plane.
ne

5.13 Property Changing and Retrieving Functions


This chapter describes functions that change properties of arbitrary entities in the current
drawing

Layer Functions
There is a possibility to use the Drafting layer show/hide mechanism in Vitesse. The user
can specify layers to show (other layers will be hidden) or layers to hide other layers will be
visible). It is not allowed to specify layers to hide and show at the same time.
To reset the layers show/hide mode, the function layer_show_all() should be used..

layer_show(layer)

layer_show(layersList)
The function will show layer (layers). It will set show mode if it is not selected yet. If
application is in show mode than this layer will be added to previously selected layers. If
hide mode is active it will be reset and than changed to show mode.
Input Parameters:

5:48 12 Series
Vitesse User Guide
Drafting

layer Layer Instance of KcsLayer. Layer class.


layersList [Layer, …] List of KcsLayer. Layer class instances.
Returned value:
None
Exceptions:
kcs_ArgumentError Argument type is not valid.
kcs_DrawingNotCurrent No drawing is current.

layer_hide(layer)

layer_hide(layersList)
The function will hide layer (layers). It will set hide mode if it is not selected yet. If
application is in hide mode than this layer will be added to previously selected layers. If
show mode is active it will be reset and than changed to show mode.
Input Parameters:
Layer Layer Instance of KcsLayer. Layer class.
layersList [Layer, …] List of KcsLayer. Layer class instances.
Returned value:
None
Exceptions:
kcs_ArgumentError Argument type is not valid.
kcs_DrawingNotCurrent No drawing is current.

layer_show_all()
The function will reset layers show/hide mode. All layers will be visible.
Input Parameters:
None
Returned value:
None
Exceptions:
kcs_ArgumentError This function requires no arguments.
kcs_DrawingNotCurrent No drawing is current.
kcs_GeneralError General error.

Properties Get Functions


This chapter describes functions used to get properties of text, symbol and contour. The
properties get functions described in this chapter use the Text, Symbol and Contour2D
classes to get properties of element. These classes hold information about a text, symbol
and contour..

element_layer_get(handle, layer)
The function will return element layer.
Input Parameters:

5:49 12 Series
Vitesse User Guide
Drafting

handle ElementHan Handle to element.


dle
layer Layer Instance of Layer class.
Returned value:
[0] Layer Instance of Layer class.
Exceptions:
kcs_ArgumentError Argument types are not valid.
kcs_DrawingNotCurrent No drawing is current.
kcs_HandleInvalid Given handle is not valid.
kcs_PythonMethodNotFound Python method not found. Check your KcsLayer
implementation file.

element_layer_set(handle, layer)
The function will set layer of element given by handle.
Input Parameters:
handle 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

kcs_ValueError Invalid parameter value.


kcs_HandleInvalid Given handle is not valid or was not found in
drawing.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.
kcs_PythonLibraryNotFound Program can't find python library.
kcs_PythonMethodNotFound Python module error.

element_colour_set(Handle, Colour)
The function changes the colour of an arbitrary entity.
Input Parameters:
Handle integer Handle to the entity
Colour Colour The colour
Returned value:
None
Exceptions:
kcs_ValueError Invalid parameter value
kcs_DrawingNotCurrent No drawing was current
kcs_HandleInvalid Invalid handle to given entity
kcs_ColourInvalid Invalid colour

Example:

# Example: kcs_ex_draft26.py
# Example: kcs_ex_draft23.py

reference_move ()
This function moves reference symbol together with associated text to a new location.
Input Parameters:
Handle 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

5.14 Identifying and Capturing Functions


Identify Functions
This chapter describes functions to identify the nearest element in the current drawing,
based on a given drawing coordinate or name (identification by name is only for views,
subviews and components).

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

kcs_NotFound Entities not found.


kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.

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

kcs_DrawingNotCurrent No drawing was current.


kcs_Error General error.

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

kcs_Error General error.

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

region CaptureRegion2D Region in drawing.


Returned value:
[0] List of Handles to captured labels.
KcsElementHandle
Exceptions:
kcs_ValueError Invalid parameter value.
kcs_NotFound Entities not found.
kcs_DrawingNotCurrent No drawing was current.
kcs_Error General error.

Example:

# Example: kcs_ex_draft20.py
# Example: kcs_ex_draft21.py
# Example: kcs_ex_draft22.py

5.15 Deleting Functions

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

delete_by_area (handles, act, contour)


This function deletes everything inside or outside specified area.
Input Parameters:
handles List or tuple Handles of elements that should be considered.
of element
handles

5:63 12 Series
Vitesse User Guide
Drafting

act Constant kcs_draft.kcsDEL_INSIDE or


kcs_draft.kcsDEL_OUTSIDE
contour Contour2D Contour defining deletion area
Returned value:
None.
Exceptions:
kcs_ArgumentError Argument Error
kcs_ValueError Handle invalid or not an instance of ElementHandle
class.
kcs_DrawingNotCurrent There is no current drawing.
kcs_GeneralError General error

5.16 Highlighting Functions


This section describes functions to highlight certain geometric entities in the current
drawing. All such functions return a handle to the highlighted entity, used when turning off
the highlighting by the function highlight_off.

Example:

hl_handle = arc_highlight(arc)
<do something>
highlight_off(hl_handle)

arc_highlight(Object)

The function highlights a circular arc.


Input Parameters:
Object Arc2D The arc definition
Returned value:
[0] KcsElementH Handle to the highlighted entity
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_ValueError Invalid parameter value

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

kcs_DrawingNotCurrent No drawing was current


kcs_ValueError Invalid parameter value

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

Handle KcsElementH Single handle or a list of handles.


andle
Returned value:
[0] KcsElementH Handle to the highlighted entity/entities.
andle
Exceptions:
kcs_DrawingNotCurrent No drawing was current
kcs_HandleInvalid Invalid handle to given entity

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

5.17 Subpicture and Element Navigation Functions

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

kcs_Error General error.

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

5.18 Drawing Element Functions

element_transform(elementHandle, <transf2d>)
The function transform element by given transformation data.
Input Parameters:

5:68 12 Series
Vitesse User Guide
Drafting

elementHandle KcsElementH Handle to the element.


andle
<transf2d> Transformatio Transformation data. If not given then
n2D transformation toolbar will be displayed and the
user will be prompted to transform given element
manually.
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_HandleInvalid Invalid handle.
kcs_ValueError Invalid parameter value.
kcs_DrawingNotCurrent No drawing was current.

element_transformation_get (ElemHandle, Transf2D)


The function retrieves the defined transformation for a given element.
Input Parameters:
ElemHandle ElementHandl Handle to element
e
Transf2D Transformatio Instance of
n2D KcsTransformation2D.Transformation2D class
Returned value:
[0] Transf2D Instance of
KcsTransformation2D.Transformation2D class
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_DrawingNotCurrent No drawing was current.
kcs_HandleInvalid Given handle is invalid. (e.g. doesn't point to view)
kcs_Error General error
kcs_PythonMethodNotFound Method in Transformation2D python class not
found.

element_copy(elementHandle, <targetSubpictureHandle>)
The function copies an element and places it under the given target subpicture. If no
target subpicture is given, the new element will belong to the same subpicture as the
source element. If the element is subpicture and the target parent subpicture already has
a subpicture with this name, the name will be blanked. Space that when copying and
subsequently transforming an element, the original element will be temporarily erased
from the display. Please call the dwg_repaint() function to repaint the display so that the
original element will appear again.
Input Parameters:
ElementHandle 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

element_transformation_redefine (Handle, Transf2d)


This function redefines transformation for given element.
Input Parameters:
Handle ElementHandl Handle to element
e
Transf2d Transformatio New transformation
n2D

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_visibility_set (elementHandle, Visibility)


This function sets visibility of element specified by handle.
Input Parameters:
elementHandle KcsElementH Handle to the element.
andle
Visibility integer If Visibility = 1 element will be visible, if 0 not.
Returned value:
None.
Exceptions:
kcs_ArgumentError Argument error.
kcs_DrawingNotCurrent There is no current drawing.
kcs_HandleInvalid Given handle is not a valid handle.

element_depersist(elementHandle)
The function removes given element from PADD. Presently, only dimension components
are accepted.
Input Parameters:
elementHandle 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.

5.19 Element Type Functions


This chapter describes functions to get element type.

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

kcs_ArgumentError Invalid parameter type.


kcs_HandleInvalid Invalid handle.
kcs_DrawingNotCurrent No drawing was current.
kcs_NotFound Element not found.

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

kcs_DrawingNotCurrent Active drawing not set.


kcs_GeneralError List of result can't be created for some internal
reason.

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

kcs_GeneralError List of result can't be created for some internal


reason.

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.

5.20 Subpicture Functions


Management of subpictures
This chapter describes functions to create new subview and component, traverse
subpictures, elements tree and change current subpicture.

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

subpictureHandle KcsElementH Handle to subpicture element


andle
name String New name for subpicture
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid parameters list.
kcs_HandleInvalid Specified handle is not valid.
kcs_DrawingNotCurrent No drawing was current.
kcs_NameOccupied There is another subpicture on this level with the
same name.
kcs_CantChangeFormViewName Form view name can't be changed.

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

kcs_SubpictureNotValid Given subpicture is not valid.


kcs_NameInvalid Given subpicture has invalid name.
kcs_NameOccupied Subpicture’s name is already in use in standard
subpicture databank
kcs_NameUsedInWorkspace There is another object in the workspace with the
same name as given subpicture’s name.
kcs_DrawingNotCurrent There is no current drawing.
kcs_GeneralError General error. Subpicture can not be saved.

subpicture_insert(subpName, <parentHandle>), <databank='SBD_PICT'>)


The function inserts a subpicture from the SBD_PICT (default) or SBD_STD databank
under given parent given by handle. It is required to use the parent subpicture on the
correct level. If the given subpicture is a view no parent must be given. Only subpictures
with 001=102 are handled.

Note: The sample function SubpictureInsert defined in CommonSample.py module


takes care of missing parent subpicture creation. It extends possibilities of
subpicture_insert function allowing user to specify any subpicture handle as
parent for inserting one. It will find the correct subpicture level and create missing
subpictures if needed.
Input Parameters:
subpName string Subpicture name.
parentHandle ElementHandl Handle to parent subpicture. Should be specified
e only if subpicture stored in standard subpicture
databank is a subview or component.
Databank integer Valid types:
• kcsSBD_PICT
• kcsSBD_STD
Returned value:
[0] ElementHandl Handle to inserted subpicture.
e
Exceptions:
kcs_ArgumentError Invalid arguments list.
kcs_HandleInvalid Given handle is not valid.
kcs_SubpictureNotValid Given subpicture is not valid.
kcs_NameInvalid Given subpicture has invalid name.
kcs_NameOccupied Subpicture’s name is already in use in standard
subpicture databank
kcs_NameUsedInWorkspace There is another object in the workspace with the
same name as given subpicture’s name.
kcs_DrawingNotCurrent There is no current drawing.
kcs_GeneralError General error. Subpicture can not be saved.

5:83 12 Series
Vitesse User Guide
Drafting

Example:

#Example:
kcs_ex_draft37.py
CommonSample.py

5.21 Visual Area Functions

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

kcs_DrawingNotCurrent No drawing was current.


kcs_ArgumentError Invalid parameter type.
kcs_Error General error.
kcs_PythonMethodNotFound Python Rectangle2D class method not found.

Example:

# Example: kcs_ex_draft35.py

5.22 Shading Functions

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.23 Common Sample


This module contains some useful Python functions used by samples. These functions can
be used by users as well.
Functions in the CommonSample.py module are the following:
• ReportTribonError(module, output=0)
Displays module error on selected output:
• 0 - console and command window,
• 1 - only console window,
• 2 - only command window.
• SelectView(prompt)
Allows the user to select a view in current drawing. Returns tuple: (status, viewhandle)
where status is equal to:
• 1 - view selected
• 0 - selection cancelled
• SelectSubview(prompt)

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.

The function returns:


• 1 - if subpicture was inserted successfully or,
• 0 - otherwise.
• Point2DLockReq(prompt, point, status, buttons)
This function is an extension of the Vitesse point2d_req function from kcs_ui. It has the
same input and results as point2d_req. Its main purpose is handling locking buttons. It
draws help lines and modifies result point corresponding to selected locking direction.

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.

6.2 Exception Handling


The Vitesse Hull interface uses exception handling. This means that if a run time error
occurs an exception is set. The exception can be caught using the "try - except" construct of
the Python language. The type of error can then be examined by checking the value of
kcs_hullpan.error (planar modelling) or kcs_chm.error (curved modelling).
The exception is also displayed in the Vitesse Log window which is available by the Vitesse
Log Window command and can optionally be written to the log file. The meaning of the
exception can be found in the description of the corresponding function.
The default error is kcs_Error. If no specific exception occurs, this error is set.

Note: The kcs_Error exception is a general exception and will not be further described
below.

6.3 Planar Modelling Functions


Vitesse features access to the modelling functionality in planar hull modelling. This means
that all kinds of planar panels can be created. For more information on Planar Hull
Modelling, see Hull Planar Modelling.
The module has the following features:
• function to initiate a new panel.

© Copyright 1974 to current year. 6:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

• function to activate existing panels.


• function to add/modify components to a panel by the full power of the plane panel input
scheme syntax.
• functions to change existing components: delete components, split stiffeners and
remove a seam
• function to copy, move and split one or several panels.
• functions to recreate, store and terminate panels.
The functions are made available in the Python program by the insertion of the statement
import kcs_hullpan. The functions are then referred to as kcs_hullpan.<function name>.
Before using a new function, please carefully read the function description.

6.3.1 Hull Default Functions

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

© Copyright 1974 to current year. 6:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

© Copyright 1974 to current year. 6:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

6.3.3 Scheme Handling


The exceptions kcs_InterpretationError and kcs_GenerationError are special scheme
generation exceptions that can be raised by some of the functions described below. For
these exceptions additional information can be fetched by the functions kcs_hullpan.nerr
(nerr()), kcs_hullpan.err_code (err_code(error_ind)) and kcs_hullpan.err_mess
(err_mess(error_ind)) described below.

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)

© Copyright 1974 to current year. 6:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

Activate an existing panel. As for kcs_hullpan.pan_init the belonging scheme is also


activated.
Input Parameters:
panel string giving the name of the panel
mode integer 1: create new
2: update existing
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

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:

© Copyright 1974 to current year. 6:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

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)

© Copyright 1974 to current year. 6:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

© Copyright 1974 to current year. 6:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

© Copyright 1974 to current year. 6:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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')

• Panel Scheme Syntax Dictionaries


In the hullpan module there are also two variables kcsSCHEME_STATEMENTS and
kcsSCHEME_KEYWORD_TYPES. They are both “dictionaries” and may be used to find
statements and keywords that are available in the design language of planar hull.
The kcsSCHEME_STATEMENTS dictionary contains list of statements used in planar hull
application. Each dictionary item consists of pair {Statement: Keywords} , where Statement
is a string with statement name and Keywords is a dictionary containing allowed keywords
for given statement. Each Keywords dictionary item consist of pair{ Keyword: Properties },
where Keyword string with keyword name and Properties is a dictionary containing
statement properties. The properties dictionary contains the following entries: { 'TYPE':
TypeValue } where TypeValue is an index of kcsSCHEME_KEYWORD_TYPES dictionary.
The kcsSCHEME_KEYWORD_TYPES dictionary contains description of schema keyword
types. The dictionary consist of pairs {TypeValue: TypeDescription}, where TypeValue is an
integer number, and TypeDescription is a string describing given type. The following type
codes exist:

0 Standalone keyword

1 Integer

2 Real

102 Coordinate value: real, FR- or LP-term, reference to topological point

202 Real or topological point direction

3 Orientational string: FOR, AFT, TOP, BOT, PS, SB, 1, -1

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

5 Number, string or description name. (A description name is always surrounded


by single quotes)

© Copyright 1974 to current year. 6:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

8 Description name

9 Reference to topological point

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:

© Copyright 1974 to current year. 6:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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.

6.3.5 Modify Components


This group is a number of functions that modify components in a panel. The Vitesse function
modifies the model components “directly”, i.e. NOT via the input scheme. The functionality
is similar to that of the corresponding interactive function of planar hull modelling.

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

© Copyright 1974 to current year. 6:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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_group_divide(panel_name, group, ListOfModels)


Move some components from a group into a new group.
Input Parameters:
Group integer The group to be divided.
ListOfModels List of The components to be moved from “group” to a new
instances of group.
KcsModel
Returned value:
new_group integer The number of the new group.
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:

© Copyright 1974 to current year. 6:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

component_id_translate (act, component_id)


Translate id between panel component number and picture element id.
Input Parameters:
Act integer 0 - translate panel to picture id
1 - translate picture to panel id
component_id integer Id to translate
Returned value:
Integer - Translated Id
Exceptions:
kcs_ArgumentError Invalid input parameters

6.3.6 View Handling

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

© Copyright 1974 to current year. 6:13 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

component_handle KcsElement Handle to the component in the drawing. The


Handle component handle must be in a symbolic view.
Returned value:
ViewHandle Handle to the new view
Exceptions:
kcs_ArgumentError Invalid input parameters.
kcs_DrawingNotCurrent There is no current drawing.
kcs_ValueError component_handle is invalid

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)

6.3.7 Curve Functions


This chapter describes function to identify an existing contour in the current drawing and
create a curve statement to add to the current panel

pan_curve_create( )
The function returns a curve statement to add in the current panel.

© Copyright 1974 to current year. 6:14 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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.8 Document Reference Handling

document_reference_get () =>document_reference_get (PanelName)


The function returns a list of document references associated with the panel.
Input parameters
PanelName Name of the panel to get references for
Returned value:
[0] list List of DocumentReference instances
Exceptions:

© Copyright 1974 to current year. 6:15 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

kcs_ArgumentError Invalid arguments list


kcs_ModelNotFound Panel not found
kcs_GeneralError List of result can't be created for some internal
reason

document_reference_add (docRef) =>document_reference_add (docRef,


PanelName)
The function adds a document reference to the panel object.
Input parameters
DocRef DocumentReference Instance of Python DocumentReference class
PanelName Name of the panel to add reference for
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid arguments list
kcs_ModelNotFound Panel not found

document_reference_remove (docRef) =>document_reference_remove (docRef,


PanelName)
The function removes document reference from panel object. If there are more than one
document reference, the first found will be deleted.
Input parameters
DocRef DocumentReference Instance of Python DocumentReference class
PanelName Name of the panel to remove reference for
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid arguments list
kcs_ModelNotFound Panel not found
kcs_DoesNotExist Equipment document reference doesn't exist

© Copyright 1974 to current year. 6:16 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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()

resp, position = kcs_ui.req_int('Side web position')

resp, point = kcs_ui.point2D_req('Indicate upper deck', Point2D())


if resp == kcs_util.ok():
kcs_draft.model_identify(point, upperDeck )

resp, point = kcs_ui.point2D_req('Indicate lower deck', Point2D())


if resp == kcs_util.ok():
kcs_draft.model_identify(point, lowerDeck )

kcs_hullpan.pan_init( panelName, ident)

stmt = "PAN, '" + panelName + "', SBP, DT=123, X=FR"+str(position) + ";"


kcs_hullpan.stmt_exec( 0, stmt)

stmt = "POI, NO=1, INT, " + upperDeck.Name + \


"',SID=BOT, M1=-" + str(depth) + "/ '" + hcx +str(position) + "';"
kcs_hullpan.stmt_exec( 0, stmt)

stmt = "POI, NO=2, INT, " + lowerDeck.Name + \


"', SID=TOP, M1=-" + str(depth) + "/ '" + hcx + str(position) + "';"
kcs_hullpan.stmt_exec( 0, stmt)

stmt = "BOU, '" + hcx + str(position) + "'/ '"+ upperDeck.Name + \


"'/ XYZ=P1, XTY=P2/ '" +lowerDeck.Name +"';"
kcs_hullpan.stmt_exec( 0, stmt)

kcs_hullpan.pan_store()
kcs_hullpan.pan_skip()

1. Get the position of the sideweb


2. Indicate the upper deck
3. Initiate a new panel. A scheme is created and the editor started.

© Copyright 1974 to current year. 6:17 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

4. Create a panel statement containing a name generated (automatically) elsewhere and


the given position.
5. Add the panel statement to the scheme and execute it.
6. Create a topological point statement to be used to define the boundary.
7. Create the boundary statement from a hullcurve derived from the position, the two
indicated decks and the topological points.
8. Store the panel.
9. Terminate the scheme.
The rest of the components such as seams, plates, notches, brackets, flanges and/or
stiffeners are added in the same way as the topological points and the boundary. The
topological point is very useful in Vitesse program in order to reuse input that is combined
into new geometry by referring the surrounding model items.

6.4 Curved Modelling Functions


These functions deals with generation of curved hull model objects. The functions are made
available in a Vitesse program by the insertion of the statement import kcs_chm.The
functions are then referred to as kcs_chm.<function name>. Before using a new function,
please carefully read the function description.
The kcs_chm module has the following features:
• Create curved model objects from an XML description file.
• Create various kinds of curved hull modelling views: shell expansion, body plan, curved
panel and shell profile view
• Store, delete, skip and recreate model objects.
• Split and combine shell profiles.
• Dimensioning of curved models.

6.4.1 Generate Hull Objects from XML File


You can model all curved hull objects via Vitesse by creating a input file in XML format and
then run this file. The input language of the input file is identical to that of “Batch Curved
Hull”. This input language is thoroughly described in Hull \ Curved Modelling \ User’s Guide
Batch \ Input Language of Curved Hull Modelling. It will not be further explained here.
The XML input file may be created by using methods in PyXML. PyXML is an extension to
Python that handle XML document. One features of PyXML is that it implements the DOM
interface and standard interface (defined by W3C) to handle the tree structure of an XML.
You may create a new document, add element and attributes. PyXML and DOM will not be
documented here.
For PyXML, please refer to the Python web site www.pythonlabs.com
You will find documentation on DOM on the web site of the World Wide Web Consortium,
www.w3c.org
PyXML will be delivered together with Vitesse, version M3 or later. You will also find an
example of how to use PyXML/DOM, kcs_ex_hull_XML.py

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.

© Copyright 1974 to current year. 6:18 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

6.4.2 View Handling

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:

© Copyright 1974 to current year. 6:19 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

kcs_Error Failed to create the view.


kcs_DrawingNotCurrent There is no current drawing.

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

© Copyright 1974 to current year. 6:20 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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.

© Copyright 1974 to current year. 6:21 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

Examples
# Example: kcs_ex_hullcurved_views01.py

6.4.3 Other Modelling Functions

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:

© Copyright 1974 to current year. 6:22 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

ObjToSplit Instance of KcsModel. Type and name must be


given. This is the shell profile or the shell stiffener to
split
SplittingObj Instance of KcsModel or KcsPlane3D. This object
gives the position for the split.
Returned value:
none
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error The split failed: Objects do not exist, no intersection
or other error.

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”.

© Copyright 1974 to current year. 6:23 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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.

curve_principal_create(CurveName, Plane, MinPt, MaxPt, SurfName)


Creates a shell curve or a shell seam. The curve/seam is the intersection between a
surface and a principal plane. The resulting curve will created and locked on the data
bank. Use either “kcs_chm.store” or “kcs_chm.skip” to unlock the curve.
Input Parameters:
CurveName string The name of the curve/seam. If the name is a valid
seam name a seam object is created otherwise a
hull curve is created.
Plane string A string describing the principal plane, e.g
“X=FR50+200”, “Y=LP10”, “Z=LP25-100”.
MinPt KcsPoint3D MinPt and MaxPt is the limit box for the curve/seam.
MinPt holds the minimum values of the box.
MaxPt KcsPoint3D MaxPt holds the maximum values of the box
limitbox.
SurfName string Optional parameter. The name of the surface the
should be intersected. If SurfName is omitted, the
default surface will be used

curve_planar_create(CurveName, Plane, MinPt, MaxPt, SurfName)


Creates a shell curve or a shell seam. The curve/seam is the intersection between a
surface and a plane. The resulting curve will created and locked on the data bank. Use
either "kcs_chm.store" or "kcs_chm.skip" to unlock the curve.
Input Parameters:
CurveName string The name of the curve/seam. If the name is a valid
seam name a seam object is created otherwise a
hull curve is created.
Plane KcsPlane3D A string describing the principal plane, e.g
"X=FR50+200", "Y=LP10", "Z=LP25-100".
MinPt KcsPoint3D MinPt and MaxPt is the limit box for the curve/seam.
MinPt holds the minimum values of the box.

© Copyright 1974 to current year. 6:24 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

MaxPt KcsPoint3D MaxPt holds the maximum values of the box


limitbox.
SurfName string Optional parameter. The name of the surface the
should be intersected. If SurfName is omitted, the
default surface will be used
Returned value:
Curve Instance of KcsModel
Exceptions:
kcs_ArgumentError Invalid input
kcs_Error Failed to create the curve.

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.

© Copyright 1974 to current year. 6:25 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

ClosestJigPillar(MarClosestJigPillar ClosestJigPillar, int Row,


String Column)
Returns the closest jig pin
Input Parameters:
ClosestJigPillar MarClosestJigPillar
Returned value:
Row int\double row
Column string column ("A","B", etc)
Exceptions:
Mar_InvalidSeamName Invalid seam name
Mar_InvalidFrameString Invalid frame string
Mar_IntersectionNotFound Intersection not found
Mar_InvalidPanelName Invalid panel name

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)

© Copyright 1974 to current year. 6:26 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

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

6.4.5 Dimensioning of Curved Models


These functions calculate distances between objects placed on or attached to curved panel
surface. No markup is done on view. The object types that are accepted by this function are:

© Copyright 1974 to current year. 6:27 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

• 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.

remarking_length(ObjectFrom, ObjectAlong, ObjectTo)


Function returns length between two objects along a third. For accepted object types see
Dimensioning from Hull Tools Menu.
Input Parameters:
ObjectFrom Model Object to measure from.
ObjectAlong Model Object to measure along.
ObjectTo Model Object to measure to.
Returned value:
[0] Length float The measured distance between objects.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error The dimensioning failed: Objects do not exist, no
intersection or other error.

remarking_length_ext(Activity, PanelName, ObjectFrom, ObjectAlong, ObjectTo)


This function returns length between two objects along a third with adjustments according
to set flags. In case the objects intersection point is located at a panel boundary, the
measure is optionally adjusted with bevel gap, excess, compensation and shrinkage
compensation of intersecting plate(s). For accepted object types see Dimensioning from
Hull Tools Menu.
Input Parameters:
Activity integer Sum of the following flags:
1 - bevel gap considered,
2 - excess type 1 considered,
4 - excess type 2 considered,
8 - excess type 3 considered,
16 - excess type 4 considered,
32 - excess type 5 considered,
64 - compensation considered,
128 - shrinkage considered.
PanelName string Curved panel name (intersection surface).
ObjectForm Model Object to measure from.
AbjectAlong Model Object to measure along.

© Copyright 1974 to current year. 6:28 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

ObjectTo Model Object to measure to.


Returned value:
[0] Length float The measured distance between objects.
Exceptions:
kcs_ArgumentError Invalid input.
kcs_Error The dimensioning failed: general error.
kcs_DatabankReadError Failed to read from databank.
kcs_ObjectNotFound Object not found in databank.
kcs_DevelopedPlateObjectNotFound Failed to retrieve developed plate data needed
for calculations.
kcs_ObjectNotInPanel Seam or intersection point not in the panel.
kcs_BevelError Error while calculating bevel gap, e.g. bevel
control object not found or wrong name of the
object.
kcs_Shrinkage ObjectError Error while getting data from shrinkage object.
kcs_unableToCalculate Error in calculations.

6.5 Customised Holes via Vitesse

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.

© Copyright 1974 to current year. 6:29 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

6.5.2 Interface Function


A number of functions with predefined names and parameter list must exist in the script.
These functions should never be changed regarding the input parameters and the result
values.

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:

© Copyright 1974 to current year. 6:30 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

HoleRes integer Result code. The predefined values should be


used.
0 OK
1 Unrecognized hole type
2 Wrong number of parameters
3 Unreasonable parameter values
4 Hole geometry could not be generated

6.6 Customised Brackets via Vitesse

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.

© Copyright 1974 to current year. 6:31 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

6.6.2 Interface Functions


A number of functions with predefined names and parameter list must exist in the script.
These functions should never be changed regarding the input parameters and the result
values.

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 Customised Notches

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.

© Copyright 1974 to current year. 6:32 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

6.7.2 Interface Function


A number of functions with predefined names and parameter list must exist in the script.
These functions should never be changed regarding the input parameters and the result
values.

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

© Copyright 1974 to current year. 6:33 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Hull

© Copyright 1974 to current year. 6:34 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Weld

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.

7.2 Exception Handling


The Vitesse Weld interface uses exception handling. This means that if a run time error
occurs an exception is set. The exception can be caught using the "try - except" construct of
the Python language. The type of error can then be examined by checking the value of
kcs_weld.error. The exception is also displayed in the Vitesse Log window which is available
by the Vitesse Log Window command and can optionally be written to the log file. The
meaning of the exception can be found in the description of the corresponding function.
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.

7.3 Weld Planning Functions


These functions handle functionality within AVEVA Marine Vitesse that deals with weld
planning calculations. The functions are made available in a Vitesse program by the
insertion of the statement "import kcs_weld".

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

© Copyright 1974 to current year. 7:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Weld

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

© Copyright 1974 to current year. 7:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Model Structures

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.2 Exception Handling


The Model Structures interface uses exception handling. This means that if a run time error
occurs an exception is set. The exception can be caught using the "try - except" construct of
the Python language. The type of error can then be examined by checking the value of
kcs_modelstruct.error. The exception is also displayed in the Vitesse Log window
which is available by the Vitesse Log Window command and can optionally be written to the
log file. The meaning of the exception can be found in the description of the corresponding
function.
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.

8.3 Functions

block_new(name, MinPt3d, MaxPt3d)


The function creates new hull block.
Input Parameters:
name string Name of hull block
MinPt3d Point3D Lower left corner of extension box.
MaxPt3d Point3D Upper right corner of extension box
Returned value:
None
Exceptions:
kcs_ArgumentError Invalid parameter type.
kcs_ValueError Argument value is not valid.

© Copyright 1974 to current year. 8:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
Model Structures

kcs_NameInvalid Block name is not valid. For example:


empty name.
kcs_NameTooLong Block name is too long. Max. 25
characters.
kcs_NameOccupied Block name is already in use.
kcs_Error General error. Block can not be
created.

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.

© Copyright 1974 to current year. 8:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

9 The Geometry Macro Facility

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.

The geometry is put into the current drawing or volume.

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

9.3.1 Entities of the Geometry Macro


A geometry macro used for a drawing or a sub-picture may generate the following entities:
• point

© Copyright 1974 to current year. 9:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

• 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.

9.3.2 Additional Functions


The following functions can be used in any macro:
• assign
• colour
• branching: if..
.
.
.
else
.
.
.
endif
• loop

© Copyright 1974 to current year. 9:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

• conditional loop: while..


.
.
.
endwhile
• table (formatted output)

9.3.3 Operators and System Functions

AND logical and

+ add

- change sign

& concatenate strings

% division

** exponentiation

== qual

> greater than

greater equal

< less than

less equal

* multiplication

NOT logical not

... not equal

OR logical or

- subtraction

XOR logical exclusive or

AB absolute value

ACO arcus cosine (radians)

ACOSD arcus cosine (degrees)

ASIN arcus sine (radians)

ASIND arcus sine (degrees)

ATAND arcus tangent (radians)

ATAND arcus tangent (degrees)

BYTE character whose ASCII code is the argument of BYTE

© Copyright 1974 to current year. 9:3 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

COS cosine (radians)

COSD cosine (degrees)

DEGREE angle in degrees to angle in radians

SIN sine (radians)

SIND sine (degrees)

SQRT square root

TAN tangent (radians)

TAND tangent (degrees)

SUBSTR substrings

LENGTH length of a string

INDEX position of a specified sub-string within a string

NRCHAR number of character with specified number of decimals

9.3.4 Creation of a Geometry Macro


The geometry macro is created by writing a geometry macro source text in a special macro
language. This language is similar to other languages used for input to various applications.
The syntax of the Geometry Macro Language is given in Syntax of the Geometry Macro
Language. The source text is stored in an ordinary text file with an arbitrary name (= the
name of the macro). It can thus be created using an ordinary editor. Only capital letters,
digits and _ (underscore) are allowed characters in the macro and file name.

9.3.5 Execution of a Geometry Macro


The geometry macro can be executed either from Drafting or as a stand alone program. The
following is valid for both cases.
The first time the macro is to be executed, the file name must be given, including the file
type. It is assumed that the geometry macro is stored on the directory given by the logical
variable SBB_GEO_MACRO_SRC. The interpreter will then check the syntax of the macro
in the source file (the macro is "compiled").
The result of the interpretation is given in a list file containing a list of the syntax together
with possible error messages. The name of the list file is <source_file>.LST and the
list file will be created on the directory given by the logical variable
SBB_GEO_MACRO_LST.
If the interpretation was successful, a "compiled" version of the syntax will be stored on a
directory given by the logical variable SBB_GEO_MACRO_BIN. The name of the
"compiled" version of the syntax is <source_file>.GLB. At the subsequent executions
of the geometry macro, it is sufficient to give the macro name and the "compiled" version will
be read, after which the execution will start.

• Stand Alone Program


If the Geometry Macro is run as a stand alone program, the result can be presented in a
number of different ways. The following activities are available:

© Copyright 1974 to current year. 9:4 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.3.6 Parameters of a Geometry Macro


The geometry macro can be parameterised, i.e. some parameters are given values at the
time of execution. A parameter can be an integer number, a decimal number, a text string or
a 2D or 3D position in the drawing/volume. It is possible to define a command string to each
parameter. This string will be displayed at the workstation and the operator is prompted to
give the parameter value.

• Submacros in a Geometry Macro


It is possible to call another geometry macro (submacro) from any macro. Data is
transferred from the macro to the submacro by parameters. These parameters can have
any type.
The submacro parameters will be assigned the values of the corresponding macro
parameters and the submacro will be executed. When the submacro execution is finished
the macro parameters will be assigned the values of the corresponding submacro
parameters and the execution of the macro is continued. See also The Facility of Using
Conditional Statements in a Macro.
The macro and the submacro can be the same macro so the resulting macro is recursive.
See also The Possibility to Write Recursive Geometry Macros.

9.3.7 Error Handling


During the execution of a geometry macro, an error handling system is active so that
abortions of Drafting due to macro programming errors will be prevented.
The programmer has the possibility to list any data at the workstation during execution. This
will make it easier to detect any errors in the macro programming.

9.3.8 Execution in Batch


It is possible to execute a geometry macro in batch. All input to the macro must then be
available in an ordinary text file and in exactly the same order as they are required by the
macro.
The first parameter in the file must then be the activity and the second one the name of the
macro.

9.4 Appendices

9.4.1 Syntax of the Geometry Macro Language

• Conventions Used in this Document


In this document the following conventions are used (cf. “The Interpretative Language”):
[ ]optional

© Copyright 1974 to current year. 9:5 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

< >term
....preceding expression may be repeated

• Statement Types
The input language contains the following different statement types:

ARC The ARC statement defines a 2D arc. The arc can be


used as input to the PRESENT and CONTOUR
statements.

ASSIGN The ASSIGN statement assigns a previously defined


variable to another variable which will get the same
type as the first one. However, if a 2D or a 3D point has
been defined, one of these coordinates can be
assigned to a variable with type decimal.

ATTRIBUTE The ATTRIBUTE statement is used to put attributes in


the object. The attributes contain non-geometrical data
and it is possible to store 100 integers, 50 reals and 12
strings. Both attribute numbers and the variables can
be addressed with an alias name defined in an alias file
assigned to the logical variable SBD_ALIAS.

CALL The CALL statement is used to call another macro. The


parameter types must match and the parameters can
be used for either input or output purposes. There is no
limit for the number of levels of submacros.

CHANGEDRAW The CHANGEDRAW statement is used to change the


appearance of an object, a component or a
subcomponent. This can be done either in one view or
in all views.

CIRCLE The CIRCLE statement defines a 2D circle. The circle


can be used as input to the PRESENT statement.

COLOUR The COLOUR statement sets the modal colour. Default


colour is green. If the given colour is an empty string,
the background colour will be used.

CONE The CONE statement defines a 3D cone. The cone can


be used as input to the PRESENT statement.

CONNECTIONPOINT The CONNECTIONPOINT statement defines a 3D


connection point. The connection point can be used as
input to the PRESENT statement.

CONTOUR The CONTOUR statement defines a 2D contour. The


contour can be used as input to the
GENERALCYLINDER and PRESENT statements.
CURRENT The CURRENT statement makes it possible to
structure a drawing or a volume.

© Copyright 1974 to current year. 9:6 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

CYLINDER The CYLINDER statement defines a 3D cylinder. The


cylinder can be used as input to the PRESENT
statement.

DECLARE The DECLARE statement allows the user to specify the


type of any variable. The default type is DECIMAL. The
DECLARE statements must be given directly after the
MACRO statement.
DELAY The DELAY statement makes it possible to introduce a
delay in a macro. It has only an effect when geometry is
presented at a workstation.

DISTANCE The DISTANCE statement assigns a value or a


previously defined variable to another variable. The
value is scaled with the current scale.

DRAWING_NAME The DRAWING_NAME statement assigns the name of


the current drawing to it's parameter.

ELSE The ELSE statement must be used together with the


IF statement. If the condition given in the IF
statement is not fulfilled, then the statements after the
ELSE statement will be executed.
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 The EXTRACTION statement makes it possible to use


Data Extraction to get any data item of a stored object.
This statement is optional.

GENERALCYLINDER The GENERALCYLINDER statement defines a 3D


general cylinder. The general cylinder can be used as
input to the PRESENT statement.

GET The GET statement enables the user to get a number


of variables which will be used as parameters.

HATCH The HATCH statement defines a hatch pattern in a


drawing. User defined patterns can be created. The
hatch pattern may include islands. The hatch pattern is
used as input to the PRESENT statement.

© Copyright 1974 to current year. 9:7 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

IF The IF statement tests an expression and performs a


specified action if the result of the test is true. All
statements between the IF and ENDIF statements will
be executed. If the expression is false, no action will be
taken unless the ELSE statement is given. In this case,
all statements between the ELSE and ENDIF
statements will be executed. All statements except the
MACRO and ENDMACRO statements can be given after
the IF statement. The IF statements can be nested.

LAYER The LAYER statement sets the modal layer. The


default layer is 0. The layer can be given either as a
number or as an alias if an alias file exists. The aliases
should be defined in a file assigned to the logical
variable SB_LAYER_ALIAS. In this case, geometry,
text and symbols will get the same modal layer. To give
them different layer values, it is possible to use layer
classes. The classes are defined in a file assigned to
the logical variable SBD_LAYER_CLASS.

LINE The LINE statement defines a 2D line. The line can be


used as input to the CONTOUR and PRESENT
statements.

LINETYPE The LINETYPE statement sets the modal line type.


Default line type is solid. The width can also be
changed. Default line width is thin.

LOOP The LOOP statement makes it possible to execute the


same statements a number of times. All statements
except the MACRO and ENDMACRO statements can be
given after the LOOP statement. The LOOP statements
can be nested.

MACRO The MACRO statement must be the first statement in


the macro. Parameters may be given and, in that case,
they will be given values before the execution of the
macro.

NAME The NAME statement is used to define a name on the


drawing/ subpicture/volume to be created and stored
on a data bank. If the statement is omitted, the macro
name will be used. It is also possible to give the form to
be used, if any. If the form is omitted, a drawing will be
created with no form. The scale can also be given for
drawings and subpictures.

NOTE The NOTE statement defines a note in a drawing. The


note is used as input to the PRESENT statement.

PARALLELEPIPED The PARALLELEPIPED statement defines a 3D


parallelepiped. The parallelepiped can be used as input
to the PRESENT statement.

© Copyright 1974 to current year. 9:8 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

POINT_2D The POINT_2D statement defines a 2D point. The


point is used as input to several of the other 2D
statements. It is also possible to use this statement
when any of the coordinates are to be changed.

POINT_3D The POINT_3D statement defines a 3D point. The


point is used as input to several of the other 3D
statements. It is also possible to use this statement
when any of the coordinates are to be changed.

POLYGON The POLYGON statement defines a 3D polygon. The


polygon is used as input to the PRESENT statement.

PRESENT The PRESENT statement presents the geometry


created by the macro.

PUT The PUT statement makes it possible to print any


variable data.

RANGE The RANGE statement defines a range of variables.


The range is used in the EXTRACTION and the
LOOP statements.
ROTATIONAL The ROTATIONAL statement defines a 3D rotational
primitive. The rotational primitive is used as input to the
PRESENT statement.
SPHERESEG The SPHERESEG statement defines a 3D spherical
segment. The segment is used as input to the
PRESENT statement.
SPLINE The SPLINE statement defines a 2D spline. The spline
is used as input to the CONTOUR and PRESENT
statements.

SPLIT The SPLIT statement splits a model name into project,


module and subsystems. These items can then be
used in the EXTRACT statement.

SYMBOL The SYMBOL statement defines a symbol. The symbol


is used as input to the PRESENT statement.

TABLE The TABLE statement makes it possible to present a


number of variables with a format determined by the
user. The table is used in the PRESENT statement.

TEXT The TEXT statement defines a text. The text is used as


input to the PRESENT statement.

TEXTFILE The TEXTFILE statement defines a text file. The text


file is used as input to the PRESENT statement.

TOROID The TOROID statement defines a 3D toroid. The toroid


is used as input to the PRESENT statement.

© Copyright 1974 to current year. 9:9 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

VECTOR_2D The VECTOR_2D statement defines a 2D vector. The


vector is used as input to other 2D statements. It is also
possible to use this statement when any of the
coordinates shall be changed.

VECTOR_3D The VECTOR_3D statement defines a 3D vector. The


vector is used as input to several of the other 3D
statements. It is also possible to use this statement
when any of the coordinates are to be changed.

VMSJOB The VMSJOB statement is used to execute a job code


or command VMS-file.

WHILE The WHILE statement makes it possible to execute the


same statements a number of times. The WHILE
statement tests an expression and performs a specified
action as long as the result of the test is true. All
statements between the WHILE and ENDWHILE
statements will be executed. If the expression is false,
no action will be taken. All statements except the
MACRO and ENDMACRO statements can be given after
the WHILE statement. The WHILE statements can be
nested.

• Statement Syntax
Below, the complete syntax of each statement type is described.

- The ARC Statement

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.

© Copyright 1974 to current year. 9:10 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The ASSIGN Statement

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

© Copyright 1974 to current year. 9:11 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The ATTRIBUTE Statement

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.

- The CALL Statement

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.

© Copyright 1974 to current year. 9:12 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

- The CHANGEDRAW Statement

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.

- The CIRCLE Statement

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.

© Copyright 1974 to current year. 9:13 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The COLOUR Statement

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.

- The CONE Statement

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.

© Copyright 1974 to current year. 9:14 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The CONNECTIONPOINT Statement

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.

© Copyright 1974 to current year. 9:15 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The CONTOUR Statement


CONTOUR,<cnt_name>[,<start_pnt>]
[/ARC=<arc_name>]
[/ARCMIDPNT=(<mid_pnt>,<end_pnt>)]
[/ARCRADIUS=(<end_pnt,<rad>)]
[/ARCAMPLITUDE=(<end_pnt,<ampl>)]
[/CONTOUR=<cnt_name>]
[/LINE=<line_name>]
[/LINEEND=<end_pnt>]
[/LINEANGLE=(<len>,<ang>)]
[/LINEOFFS=<offs>]
[/SPLINE=<spl_name>];
<cnt_name> is the name of the contour and will be assigned the type
CONTOUR_2D. The maximum length of <cnt_name> is 32 characters.
<start_pnt> is the starting point of the contour with type POINT_2D. If /ARC, /
CONTOUR, /LINE or /SPLINE is used for the first segment of the contour, then
<start_pnt> shall be omitted.
ARC=<arc_name>
<arc_name> is the name of the arc and has the type ARC_2D. If <arc_name>
is not the first segment in the contour, the starting point of <arc_name> will be
ignored. No check is made whether this point coincides with the ending point of
the previous segment or not.

© Copyright 1974 to current year. 9:16 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

© Copyright 1974 to current year. 9:17 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The CURRENT Statement

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.

© Copyright 1974 to current year. 9:18 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

- The CYLINDER Statement

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');

- The DECLARE Statement

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

© Copyright 1974 to current year. 9:19 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The DELAY Statement

DELAY,<del_time>;
<del_time> is the delay time in seconds. It has the type DECIMAL.

- The DISTANCE Statement

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.

- The DRAWING_NAME Statement

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.

- The ELSE Statement

ELSE;
This statement must be used together with the IF statement.

- The ENDIF Statement

ENDIF;
The ENDIF statement terminates the IF statement.

© Copyright 1974 to current year. 9:20 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

- The ENDLOOP Statement

ENDLOOP;
The ENDLOOP statement terminates the LOOP statement.

- The ENDMACRO Statement

ENDMACRO;
The ENDMACRO statement terminates the MACRO statement.

- The ENDWHILE Statement

ENDWHILE;
The ENDWHILE statement terminates the WHILE statement.

- The EXTRACTION Statement (OPTIONAL)

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.

- The GENERALCYLINDER Statement

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.

© Copyright 1974 to current year. 9:21 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The GET Statement

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.

© Copyright 1974 to current year. 9:22 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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

© Copyright 1974 to current year. 9:23 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

Before using <rng_name>, there shall always be a test on <status> to


ensure that <rng_name> 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.
STRUCTURE=(<variable>,<struct_name>,<arg_1>
[,<arg_2]...[,<arg_10>]..]])
<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.
<struct_name> is the name of the structure from which the data shall be
taken. It has the type STRING. The following structure types are available:
POINT_2D
LINE_2D
ARC_2D
CONTOUR_2D
CIRCLE_2D
VECTOR_2D
SPLINE_2D
TEXTFILE_2D
TEXT_2D
SYMBOL_2D
NOTE_2D
HATCH_2D
POINT_3D
VECTOR_3D
CONNECTIONPOINT_3D
CONE_3D
CYLINDER_3D
GENERALCYLINDER_3D
PARALLELEPIPED_3D
POLYGON_3D
SPHERESEG_3D
TOROID_3D
ROTATIONAL_3D
[<arg_1>[,<arg_2>]...[,<arg_10>]..]] are the arguments in the
structure. It is thus possible for instance to get the end coordinates for the n:th
segment in a certain contour or the total number of lines in the file used by the
TEXTFILE statement.
The arguments are described at the respective structure statement.
MODEL_NAME=(<prompt>,<status>,<name_model>,
<name_component>)
<status> is a variable giving the status of <variable>. It can have the
following INTEGER values:
0<name_model> and <name_component> not defined

© Copyright 1974 to current year. 9:24 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

1<name_model> defined, <name_component> not defined


2<name_model> and <name_component> defined
Before using either of <name_model> and <name_component>, there must
always be a test on <status> to ensure that the variable about to be used is
defined. Otherwise the macro will be aborted. Moreover, the variable must be
declared by a DECLARE statement.
<name_model> is a string assigned to by the statement. It is only valid if
<status> = 1. The parameter has the name of the model indicated by user
when the statement was executed.
<name_component> is a string assigned to by the statement. It is only valid if
<status> = 1. The parameter has the name of the model object component
indicated by user when the statement was executed.
VIEW_ID=(<prompt>,<get_viewid>)
<get_viewid> is the ID of a view which has been given as input at the
workstation. <get_viewid> has the type INTEGER.

- The HATCH Statement

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.

© Copyright 1974 to current year. 9:25 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The LAYER Statement

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

© Copyright 1974 to current year. 9:26 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The LINE Statement

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'

© Copyright 1974 to current year. 9:27 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

- The LINETYPE Statement

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.

- The LOOP Statement

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.

- The MACRO Statement

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.

- The NAME Statement

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.

© Copyright 1974 to current year. 9:28 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The NOTE Statement

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.

© Copyright 1974 to current year. 9:29 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The PARALLELEPIPED Statement

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.

© Copyright 1974 to current year. 9:30 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The POINT_2D Statement

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');

- The POINT_3D Statement

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.

© Copyright 1974 to current year. 9:31 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The POLYGON Statement

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');

- The PRESENT Statement

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

© Copyright 1974 to current year. 9:32 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The PUT Statement

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.

- The RANGE Statement

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.

- The ROTATIONAL Statement

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.

© Copyright 1974 to current year. 9:33 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The SPHERESEG Statement

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');

© Copyright 1974 to current year. 9:34 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

- The SPLINE Statement

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);

- The SPLIT Statement

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.

© Copyright 1974 to current year. 9:35 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

<module> is the module of <model_name> and has the type STRING.


<subsyst_1> is the first subsystem of <model_name> and has the type STRING.
<subsyst_2> is the second subsystem of <model_name> and has the type
STRING.
<subsyst-3> is the third subsystem of <model_name> and has the type
STRING.
All three subsystems need not be present in the model name. How many subsystems
that exist depends on the application.

- The SYMBOL Statement

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.

© Copyright 1974 to current year. 9:36 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The TABLE Statement

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.

© Copyright 1974 to current year. 9:37 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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.

- The TEXT Statement

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.

© Copyright 1974 to current year. 9:38 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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');

- The TEXTFILE Statement

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.

© Copyright 1974 to current year. 9:39 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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')

© Copyright 1974 to current year. 9:40 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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);

- The TOROID Statement

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);

- The VECTOR_2D Statement

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.

© Copyright 1974 to current year. 9:41 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

Structure:

VEC(1:2) (DECIMAL)

Example:)

GET/STRUCTURE=(X,<vect_name>,'VEC',1

/STRUCTURE=(Y,<vect_name>,'VEC','Y');

- The VECTOR_3D Statement

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');

- The VMSJOB Statement

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.

- The WHILE Statement

WHILE,<cond>;
<cond> is the condition to be tested. It has the type BOOLEAN.

9.4.2 Example of Macros Creating 2D Geometry

• Example 1
This example is a macro creating some simple geometry.

© Copyright 1974 to current year. 9:42 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

!
! 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

© Copyright 1974 to current year. 9:43 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

/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.

Figure 9:1. The result of the execution of the macro SCREW.

9.4.3 The Possibility to Present a Text File on a Drawing

• 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.

© Copyright 1974 to current year. 9:44 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

Figure 9:2. The result from the execution of the macro LIST.

9.4.4 The Usage of Attributes in Geometry Macros

• 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

© Copyright 1974 to current year. 9:45 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

(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: ATTR
ATTNO = 1111
I1 0
I2 4
R1 105.60000
R2 0.25430
R3 35.45000
S1
S2 I2: chair no
S3 R1-R3: chair data
ATTNO = 55
R1 0.00000
R2 0.00000
R3 0.00000
R4 1.23400
S1
S2
S3 3
Give a string:
> Just a test string !!!
ATTNO = 7777
S1 Just a test string !!!
Once more ? N
Give name of macro to be run:

9.4.5 Layer Handling

• 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;

© Copyright 1974 to current year. 9:46 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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!

© Copyright 1974 to current year. 9:47 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

Layer class DRAW not found. Layer ignored!


LAYER: 100
Once more ? N
Give name of macro to be run:

9.4.6 The Facility of Using Conditional Statements in a Macro

• 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.

© Copyright 1974 to current year. 9:48 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

MACRO,MAIN;
DECLARE,C,STRING;
CALL,INPUT_COLOUR,C;
COLOUR,C;
!
ENDIF;

9.4.7 The Possibility to Write Recursive Geometry Macros

• 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

© Copyright 1974 to current year. 9:49 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

/LINEEND = P4
/LINEEND = P1;
PRESENT,CNT;
ENDMACRO;

9.4.8 Change Colour in Drawing by Using Geometry Macro

• 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';

© Copyright 1974 to current year. 9:50 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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,,);

© Copyright 1974 to current year. 9:51 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

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;

© Copyright 1974 to current year. 9:52 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

! 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;

© Copyright 1974 to current year. 9:53 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
The Geometry Macro Facility

© Copyright 1974 to current year. 9:54 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
User Defined Simple Rules in Forms

10 User Defined Simple Rules in Forms

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.

10.1 Vitesse Script Example


This script is an example of _TBhook_Formula.py. The script text contains a detailed
guideline for implementation of new formulas together with some formula examples.
The example script can be found here: TBhook_Formula_py.txt

© Copyright 1974 to current year. 10:1 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.
Vitesse User Guide
User Defined Simple Rules in Forms

© Copyright 1974 to current year. 10:2 12 Series


AVEVA Solutions Limited and its subsidiaries.
All rights reserved.

You might also like