0% found this document useful (0 votes)
260 views233 pages

Macros

Macros

Uploaded by

zxy320d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
260 views233 pages

Macros

Macros

Uploaded by

zxy320d
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 233

pdf_doc 06.11.

2003 11:27 Uhr Seite 5

Macros

technical_illustration_redefined
IsoDraw Macro Language

VERSION: 6.1.04.003
RELEASE DATE: June 19, 2006

IsoDraw Macro Language 1


Introduction

A macro is a saved sequence of commands that can be executed by


IsoDraw. Macros are useful when you need to perform frequently
recurring tasks such as resizing a document before export or for complex
tasks that may include errors if performed manually.

This document will provide all of the information necessary to create,


modify and execute macros in IsoDraw.

2 IsoDraw Macro Language


IsoDraw Macro Language .................................................................. 1

Introduction ................................................................................................................................2

Language Basics ................................................................................13

Lexical Structure .....................................................................................................................13


Case Sensitivity .......................................................................................................................14
Statements and Line Breaks ..............................................................................................14
Line Continuation ..................................................................................................................15
Spaces and Tabs ......................................................................................................................15
Comments .................................................................................................................................15
Comment Sign ...................................................................................................................15
Literals ........................................................................................................................................16
Identifiers ..................................................................................................................................16
Variable Names ..................................................................................................................16
Macro and SubMacro Names .......................................................................................16
Keywords ...................................................................................................................................17
Macros ........................................................................................................................................17
SubMacros ...........................................................................................................................18
Variables .....................................................................................................................................19
Operators and Expressions .................................................................................................19
Comparison Operators ....................................................................................................19
Flow Control Statements ....................................................................................................20
If ...............................................................................................................................................21
While ......................................................................................................................................22
For ............................................................................................................................................23
Break ......................................................................................................................................24
Run ..........................................................................................................................................25
Return ....................................................................................................................................26

File Menu ...........................................................................................27

New ..............................................................................................................................................27
Open ............................................................................................................................................27
Close ............................................................................................................................................29
Save ..............................................................................................................................................29
Import Layers ...........................................................................................................................31
Save Layers ...............................................................................................................................31
Place ............................................................................................................................................31
Export ..........................................................................................................................................32
Quit ..............................................................................................................................................33

Edit Menu ...........................................................................................35

Cut ................................................................................................................................................35
Copy .............................................................................................................................................35
Duplicate ....................................................................................................................................35
Delete Selection ......................................................................................................................35
Paste ............................................................................................................................................36

3
Select All .....................................................................................................................................36
Select None ...............................................................................................................................36
Select If / SubSelect If ..........................................................................................................37
Move ............................................................................................................................................41
Align .............................................................................................................................................42
Distribute ...................................................................................................................................42
Preferences ................................................................................................................................42

Element Menu ................................................................................... 43

Arrange .......................................................................................................................................43
Convert Selection into Elements ......................................................................................43
Convert Selection into Bezier Parts ................................................................................44
Convert Selection into Polylines ......................................................................................44
Join Polylines ............................................................................................................................44
Join Beziers ...............................................................................................................................44
Generate Contour ...................................................................................................................44
Create Compound Path .......................................................................................................45
Groups .........................................................................................................................................45
Group Selection .................................................................................................................45
Ungroup Selection ............................................................................................................45
Start Group ..........................................................................................................................46
End Group ............................................................................................................................46
Mask At .......................................................................................................................................46
Release Mask ............................................................................................................................47
Lock ..............................................................................................................................................47
Unlock .........................................................................................................................................47
Transformation 3D .................................................................................................................47
Set Image Transparency .......................................................................................................47
Import Selection .....................................................................................................................48

Objects Menu .................................................................................... 49

Create Object_info .................................................................................................................49


Delete Object_info .................................................................................................................49
Create Object_attribute .......................................................................................................49
Delete Object_attribute .......................................................................................................50
Create Hotspots .......................................................................................................................51

Text Menu .......................................................................................... 53

Text ...............................................................................................................................................53
Convert Text to Paths ...........................................................................................................54

Layer Window .................................................................................... 55

Add Layer ...................................................................................................................................55


Cut Layer ....................................................................................................................................55
Copy Layer .................................................................................................................................56
Paste Layer ................................................................................................................................56
Duplicate Layer ........................................................................................................................56

4
Delete Layer ..............................................................................................................................56
Activate Layer ..........................................................................................................................57
Delete All Empty Layers .......................................................................................................57
Selected Elements to Active Layer ..................................................................................57
Selected Text to Active Layer ............................................................................................57

Window Menu ...................................................................................59

Activate Window ....................................................................................................................59


Hide ..............................................................................................................................................59
Show ............................................................................................................................................60
Zoom ...........................................................................................................................................60

Palette Window .................................................................................61

Selecting Elements ................................................................................................................61


Select Rectangle ................................................................................................................61
Select Polygon Start ........................................................................................................61
Select Polygon Points ......................................................................................................62
Select Polygon End ...........................................................................................................62
Select At ................................................................................................................................62
Transform Selection ..............................................................................................................63
Scale Selection ...................................................................................................................63
Rotate Selection ................................................................................................................64
Reflect Selection ...............................................................................................................64
Create Parallels ..................................................................................................................65
Transforming the Illustration ............................................................................................65
Set Transform .....................................................................................................................65
Restore Transform ............................................................................................................67
Absolute ................................................................................................................................67
Creating Elements ..................................................................................................................67
Create Line ...........................................................................................................................67
Append Line Segment .....................................................................................................68
Create Ellipse ......................................................................................................................68
Create Inner Thread .........................................................................................................69
Create Outer Thread .........................................................................................................69
Create Callout .....................................................................................................................70
Create Rectangle ...............................................................................................................70
Create Polygon ...................................................................................................................71
Create Bezier Curve ..........................................................................................................72
Append Bezier Segment .................................................................................................72
Create Text ...........................................................................................................................73
Change Text At ...................................................................................................................73
Set Ellipsevalues .....................................................................................................................74

Attribute Window .............................................................................75

Pens ..............................................................................................................................................75

5
Add Pen .................................................................................................................................75
Delete Pen ............................................................................................................................75
Set Active Pen .....................................................................................................................76
Set Lineoptions ...................................................................................................................76
Styles ...........................................................................................................................................77
Add Style ...............................................................................................................................77
Delete Style ..........................................................................................................................77
Set Active Style ..................................................................................................................78
Shadows .....................................................................................................................................78
Add Shadow ........................................................................................................................78
Delete Shadow ....................................................................................................................79
Set Active Shadow ............................................................................................................79
Grids .............................................................................................................................................79
Add Grid ................................................................................................................................79
Delete Grid ...........................................................................................................................80
Formats .......................................................................................................................................81
Add Format ..........................................................................................................................81
Delete Format .....................................................................................................................81
Set Active Format ..............................................................................................................82
Viewports ...................................................................................................................................82
Add Viewport ......................................................................................................................82
Delete Viewport ..................................................................................................................82
Execute Viewport ...............................................................................................................83
Add Layerstatus ..................................................................................................................83
Remove Layerstatus .........................................................................................................84
Callouts .......................................................................................................................................84
Add Callout_Style .............................................................................................................84
Delete Callout_Style .........................................................................................................84
Renumber Callouts ...........................................................................................................85

Fill Window ........................................................................................ 87

Colors ...........................................................................................................................................87
Add Color ..............................................................................................................................87
Delete Color .........................................................................................................................87

3D Commands ................................................................................... 89

3D View .......................................................................................................................................89
3D SetView ................................................................................................................................89
3D Project ..................................................................................................................................90
3D Center ...................................................................................................................................90
3D ZoomExtent .......................................................................................................................90
3D HLRMode .............................................................................................................................91
3D Mode .....................................................................................................................................91
3D Explosion .............................................................................................................................91
3D Move .....................................................................................................................................92
3D Axis ........................................................................................................................................92
3D Transform ............................................................................................................................93

6
3D Reset .....................................................................................................................................93
3D SetDist ..................................................................................................................................93
3D Hole rectangle ..................................................................................................................94
3D Hole polygon start ..........................................................................................................94
3D Hole polygon points .......................................................................................................94
3D Hole polygon end ............................................................................................................95

Further Macro Commands ...............................................................97

FWrite ..........................................................................................................................................97
FNew ............................................................................................................................................97
Log ................................................................................................................................................97
Menu ...........................................................................................................................................98
Debugging Commands ........................................................................................................99
Debug Step ..........................................................................................................................99
Debug Commands ............................................................................................................99
Debug Reset ..................................................................................................................... 100
Debug Stack ..................................................................................................................... 100
Debug Locals .................................................................................................................... 100
Debug Globals ................................................................................................................. 100
Wait Timer .............................................................................................................................. 100
Extension ................................................................................................................................ 101
Increase Text Elements ...................................................................................................... 101
Decrease Text Elements .................................................................................................... 102

Interacting with the User .............................................................. 103

Message .................................................................................................................................. 103


Get ............................................................................................................................................. 103
.................................................................................................................................................... 103
Wait Mouseclick .................................................................................................................. 104
mouseEvent.click ............................................................................................................ 104
mouseEvent.ptPix ........................................................................................................... 104
mouseEvent.ptPixGrid .................................................................................................. 104
mouseEvent.ptMM ........................................................................................................ 105
mouseEvent.ptMMGrid ................................................................................................ 105
mouseEvent.modifiers .................................................................................................. 105
Beep .......................................................................................................................................... 106

Functions ......................................................................................... 107

Trigonometric Functions .................................................................................................. 107


Other Mathematical Functions ...................................................................................... 107
Random Function ................................................................................................................ 108
String Functions .................................................................................................................. 108
Time Functions ..................................................................................................................... 111
Negation ................................................................................................................................. 112
Exists ......................................................................................................................................... 112
Return ...................................................................................................................................... 114

7
Simple Data Types ...........................................................................115

Integers ....................................................................................................................................115
Floating-Point Numbers ...................................................................................................115
Strings ......................................................................................................................................115
Booleans ..................................................................................................................................116

Complex Data Types .......................................................................117

Point ..........................................................................................................................................117
Point3 .......................................................................................................................................117
Rectangle ................................................................................................................................117
RGBColor .................................................................................................................................117
CMYKColor .............................................................................................................................118
ColorSpec ................................................................................................................................118
Fill ...............................................................................................................................................119
Mouse Event ..........................................................................................................................120
Document or ActiveDoc - The Document Object ...................................................120
document.name ..............................................................................................................121
document.path ................................................................................................................121
document.penCount .....................................................................................................121
document.active_Pen ...................................................................................................121
document.styleCount ...................................................................................................121
document.active_style .................................................................................................122
document.shadowCount .............................................................................................122
document.active_shadow ...........................................................................................122
document.gridCount .....................................................................................................122
document.active_grid ..................................................................................................122
document.formatCount ...............................................................................................122
document.active_textFormat ....................................................................................122
document.viewportCount ...........................................................................................123
document.viewports[ ] .................................................................................................123
document.calloutCount ...............................................................................................124
document.active_callout ............................................................................................125
document.layerCount ...................................................................................................125
document.layers[ ] .........................................................................................................125
document.selectedElements ......................................................................................125
document.firstSelectedElement ...............................................................................125
document.selectedParts ..............................................................................................126
document.modified .......................................................................................................126
document.grid .................................................................................................................126
document.window .........................................................................................................128
document.shadow ..........................................................................................................129
document.thread ............................................................................................................130
document.thickthin .......................................................................................................131
document.background .................................................................................................133
document.lineOptions ..................................................................................................133
document.simpleEllipsePrinting ...............................................................................134

8
document.colorCount .................................................................................................. 134
document.hatchingCount .......................................................................................... 134
document.patternCount ............................................................................................. 134
Element - The Element Object ....................................................................................... 135
element.element_id ...................................................................................................... 135
element.type .................................................................................................................... 135
element.locked ................................................................................................................ 136
element.mask ................................................................................................................... 136
element.box ...................................................................................................................... 136
element.firstChild ........................................................................................................... 136
element.lastChild ............................................................................................................ 137
element.previousSibling .............................................................................................. 137
element.nextSibling ...................................................................................................... 138
element.parent ................................................................................................................ 139
element.layer ................................................................................................................... 140
element.selected ............................................................................................................. 140
element.nextSelectedElement .................................................................................. 140
element.lineCap .............................................................................................................. 140
element.lineJoin .............................................................................................................. 141
element.miterLimit ........................................................................................................ 141
element.overPrint .......................................................................................................... 141
element.segmentCount ............................................................................................... 141
element.fill ........................................................................................................................ 141
element.group.childCount .......................................................................................... 141
element.document ........................................................................................................ 141
element.info ..................................................................................................................... 142
element.info.attributes[ ] ............................................................................................ 143
element.info.view_context ........................................................................................ 144
element.line ...................................................................................................................... 144
element.ellipse ................................................................................................................. 145
element.innerthread ..................................................................................................... 147
element.outerthread ..................................................................................................... 148
element.callout ............................................................................................................... 150
element.rect ..................................................................................................................... 154
element.polygon ............................................................................................................. 155
element.marker ............................................................................................................... 156
element.bezier ................................................................................................................. 156
element.text ..................................................................................................................... 157
element.image ................................................................................................................. 159
Layer - The Layer Object ................................................................................................... 161
layer.name ......................................................................................................................... 161
layer.screenColor ............................................................................................................ 161
layer.locked ....................................................................................................................... 162
layer.active ........................................................................................................................ 162
layer.printable .................................................................................................................. 162
layer.exportable .............................................................................................................. 162

9
layer.visible ........................................................................................................................162
layer.hasElements ...........................................................................................................162
layer.useColor ...................................................................................................................162
layer.firstChild ..................................................................................................................163
layer.lastChild ...................................................................................................................163
layer.previousSibling .....................................................................................................163
layer.nextSibling .............................................................................................................163
Preferences (Part I) - The Application Object ...........................................................163
app.version ........................................................................................................................164
app.docCount ...................................................................................................................165
app.documents[ ].name ...............................................................................................165
app.penCount ...................................................................................................................165
app.styleCount .................................................................................................................165
app.shadowCount ..........................................................................................................165
app.GridCount .................................................................................................................165
app.colorCount ................................................................................................................166
app.hatchingCount ........................................................................................................166
app.patternCount ...........................................................................................................166
app.formatCount ............................................................................................................166
app.calloutCount ............................................................................................................166
app.password ...................................................................................................................166
app.drawOffscreen .........................................................................................................166
app.useAntiAliasing .......................................................................................................167
app.showLineStyles ........................................................................................................167
app.showToolTips ............................................................................................................167
app.showRulers ...............................................................................................................167
app.showCursorInfo ......................................................................................................167
app.magnetFlags .............................................................................................................167
app.selectableFills ...........................................................................................................168
app.useIsoExtOnMac .....................................................................................................168
app.allowInternet ...........................................................................................................168
app.updatePeriod ...........................................................................................................168
app.numberOfUndos .....................................................................................................168
app.autoSave ....................................................................................................................169
app.autoSaveMinutes ...................................................................................................169
app.useEllipsesIn3DTools .............................................................................................169
app.preview .......................................................................................................................169
app.compare .....................................................................................................................170
app.options3D ..................................................................................................................171
app.project3D ...................................................................................................................171
app.dimensions ................................................................................................................172
app.grid ...............................................................................................................................175
app.window ......................................................................................................................177
app.shadow .......................................................................................................................178
app.thread .........................................................................................................................178
app.thickthin ....................................................................................................................180

10
app.polygontool .............................................................................................................. 181
app.ellipsetool ................................................................................................................. 182
app.rectangletool ........................................................................................................... 182
app.background .............................................................................................................. 182
app.lineOptions ............................................................................................................... 182
app.simpleEllipsePrinting ............................................................................................ 183
app.curMacroTransform .............................................................................................. 183
app.dtd ............................................................................................................................... 184
app.standardTxtFormat ................................................................................................ 184
app.option ......................................................................................................................... 184
app.interaction ................................................................................................................ 185
Preferences (Part II) - Data Exchange Settings ...................................................... 185
Import CGM ...................................................................................................................... 185
Export CGM ...................................................................................................................... 187
Export EPS ......................................................................................................................... 191
Import Illustrator ........................................................................................................... 191
Export Illustrator ............................................................................................................ 191
Export SVG ........................................................................................................................ 192
Import IGES ...................................................................................................................... 193
Export IGES ....................................................................................................................... 196
Import DWG ..................................................................................................................... 199
Export DWG ...................................................................................................................... 202
Import DXF ........................................................................................................................ 202
Export DXF ........................................................................................................................ 204
Import VRML .................................................................................................................... 205
Import Wavefront .......................................................................................................... 207
Export HPGL ..................................................................................................................... 208
Export TIFF ......................................................................................................................... 208
Export JPEG ...................................................................................................................... 209
Export PNG ....................................................................................................................... 210
Export BMP ....................................................................................................................... 211
Export PCX ........................................................................................................................ 212
Export CALS ...................................................................................................................... 213
Export Text ........................................................................................................................ 214
Export Object List ........................................................................................................... 215
Export Interleaf ............................................................................................................... 215
Export MIF ......................................................................................................................... 216
Export PICT ........................................................................................................................ 216
Import WMF ..................................................................................................................... 216
Export WMF ...................................................................................................................... 216
Sub Data Types ..................................................................................................................... 217
.Pens[ ] ................................................................................................................................ 217
.linestyles[ ] ....................................................................................................................... 218
.shadows[ ] ........................................................................................................................ 219
.colors[ ] .............................................................................................................................. 220
.hatchings[ ] ...................................................................................................................... 220

11
.patterns[ ] .........................................................................................................................221
.txtFormats[ ] ....................................................................................................................221
.callouts[ ] ..........................................................................................................................222
.grids[ ] ................................................................................................................................225
...............................................................................................................................................226

Appendix ..........................................................................................227

International Names ..........................................................................................................227


Writing Language independent macros ...............................................................227
Pen Names ........................................................................................................................228
Style Names ......................................................................................................................228
Shadow Names ................................................................................................................228
Color Names .....................................................................................................................228
Callout Names ................................................................................................................228

12
Language Basics
Lexical Structure

The lexical structure of a programming language is the set of basic rules


that governs how you write programs in that language. It is the lowest
syntax level of the language and specifies such things as how variable
names are written, what characters are used for comments, and how
program statements are separated from one another.

Language Basics 13
Case Sensitivity

The names of user defined macros, subMacros, variables and keywords


such as message, create line, while, etc. are case-insensitive. These lines
are equivalent:

#example 1:
message "hello, world"
MESSAGE "hello, world"
mEsSaGe "hello, world"

#######################

#example 2:
define out as string
define OUT as string

Only string constants are case-sensitive:

#CORRECT:
Save "C:\temp\output.com" "CGM"

#INCORRECT:
Save "C:\temp\output.com" "cgm"

Statements and Line Breaks

A statement is a collection of code that performs a task. It can be as simple


as a variable assignment or as complicated as a loop with several exit
points. A simple example:

define name as string


name = "Barney Gumble"
message name

The IsoDraw Macro Language uses line breaks to separate simple


statements. Code blocks like while-loops or conditional tests must be
terminated with an "end" statement.

if ( a > b) then
message "hello world"
end if

14 Language Basics
Line Continuation

Statements can be continued from one line to the next with the use of a
backslash “\”.

Create Rectangle 50.798 209.544 \


50.798 184.145 \
95.248 184.145 \
95.248 209.544

Spaces and Tabs

Every part of a statement that consists of more than one word has to be
separated by a space:

create line
append line segment
create callout

Multiple spaces have no effect on the macro. You can take advantage of
this flexible formatting to make your code more readable (by lining up
assignments, indenting, etc.):

create line 125 678 254 223


create line 658.225 568.554 874.974 336.889

Comments

Comments give useful information to people who read your code, but are
ignored by IsoDraw. Even if you are the only person who will ever read
your code it can be beneficial to include comments. It will make the code
easier to understand when reviewing it in the future.

Comment Sign

When IsoDraw encounters a hash mark (#) within the code, everything
from that hash mark to the end of the line is recognized as a comment.

Language Basics 15
#the next line draws an ellipse
create ellipse 113.34 112.99 99 23.5 27

Literals

Literals are data values that appear directly in an IsoDraw macro. The
following are examples of literals in IsoDraw:

100
off
23.987
(-27)
245,666
'Hello'
"good evening"
false

Identifiers

An identifier is used to name variables, macros and subMacros.

Variable Names

The first character of a variable name must be an ASCII letter (uppercase


or lowercase). After the initial character the underscore character (_) and
the digits 0-9 are also valid. Spaces are always invalid. Some examples of
valid variable names:

george
positionX
y9
element_description

Macro and SubMacro Names

Macro and subMacro names are case-sensitive. After the keywords


"macro" or "subMacro", letters (uppercase or lowercase), digits, special
characters and spaces are allowed in any order you choose. Some
examples of valid macro or subMacro names:

16 Language Basics
geoffrey
myLines
27 Ellipses for your pleasure
IsoDraw_4_ever
>>> !do not execute! <<<

Keywords

A keyword is a word reserved by the IsoDraw Macro Language for its own
functionality. Keywords must not be used as variable names. The following
Table lists some IsoDraw macro keywords:

macro subMacro end global


if else define while
for break to step

All command names as also keywords.

Macros

To define a macro, use the following syntax:

MACRO macroname
END MACRO

There are two optional parameters available for macros: protected and
not_in_Menu. With the keyword "protected" after the macro name you
can protect the macro from being deleted using the "Delete Macro" dialog
or being overwritten by a recording. All macros that have the optional
keyword "not_in_menu" after their name are not shown in the menu
“Macros” but can still be started through the "Run Macro" dialog.

A single macro file may contain several macros. This is useful for grouping
different macros of the same topic.
Macros can not be nested!

Some examples:

Language Basics 17
Macro Do Something
message "I’m doing something"
end Macro

##############################################

Macro littleHelper not_in_menu


#this macro does not appear in the
#menu "macros"
end Macro

##############################################

Macro necessary protected


#this macro can not be deleted using
#the menu command "Delete macro"
end Macro

##############################################

Macro bothOptions protected not_in_menu


#you can use both parameters in one macro
end Macro

SubMacros

To define a subMacro, use the following syntax:

SUBMACRO subMacroname
END SUBMACRO

There is one optional parameter: protected. With the keyword "protected"


after the subMacro name you can protect the subMacro from being
deleted using the "Delete Macro" dialog or being overwritten by a
recording.

A single macro may consist of several subMacros.


SubMacros can not be nested!

An example:

SubMacro messenger
message "Here’s your message"
end SubMacro

18 Language Basics
Variables

There are two types of variables in IsoDraw macros - local and global.
Global variables can be accessed from all loaded macros within IsoDraw
and local variables can only be accessed from within the macro they are
defined.

Global variables can be accessed from all macro files as long as they are
loaded. They have to be defined outside a macro with the keyword
"Global".

global gText as string

Macro globalsTest
gText = "Hi, I'm a global."
message gText
end Macro

Local variables have to be defined within a macro and can only be


accessed within that macro.

Macro localsTest
define myInt as integer
define myFloat as float

myInt = 21
myFloat = 2.77889

message myInt
message myFloat
end Macro

Operators and Expressions

An expression is a part of an IsoDraw macro that can be used to produce


a value. The simplest expressions are literals and variables. A literal value
evaluates to itself, while a variable evaluates to the value stored in that
variable. More complex expressions can be formed using simple
expressions and operators.

Comparison Operators

Language Basics 19
Comparison operators compare operands. The result is always either true
or false.

Operands to the comparison operators must be numeric.

The comparison operators are:

Equality (=)
If both operands are equal, this operator returns true; otherwise, it
returns false.

Inequality (<>)
If both operands are not equal, this operator returns true;
otherwise, it returns false.

Greater than (>)


If the lefthand operator is greater than the righthand operator, this
operator returns true; otherwise, it returns false.

Greater than or equal to (>=)


if the lefthand operator is greater than or equal to the righthand
operator, this operator returns true; otherwise, it returns false.

Less than (<)


if the lefthand operator is less than the righthand operator, this
operator returns true; otherwise, it returns false.

Less than or equal to (<=)


If the lefthand operator is less than or equal to the righthand
operator, this operator returns true; otherwise, it returns false.

Flow Control Statements

The IsoDraw Macro Language supports some basic flow control


statements for controlling the execution of a macro.

Conditional statements allow a macro to execute different pieces of code,


or none at all, depending on some condition. Loops support the repeated
execution of particular code.

20 Language Basics
If

The if statement checks the truthfulness of an expression. If the


expression is true it evaluates a statement. An if statement looks like:

IF (expression) THEN
statement
END IF

To execute an alternative statement if the expression is false use the else


keyword:

IF (expression) THEN
statement
ELSE
statement
END IF

For example:

if (drawLine = true) then


create line 100 100 200 300
else
message "No line created!"
end if

You can include more than one statement in an if statement:

if (selectLine = false) then


create line 100 200 300 400
create ellipse 100 500 200 35 45
message "ready"
end if

The if statement can also be nested:

Language Basics 21
IF (expression) THEN
true_statement_1
IF (expression) THEN
true_statement
ELSE
false_statement
END IF
true_statement_2
ELSE
IF (expression) THEN
true_statement
END IF
false_statement
END IF

While

One form of a loop is the while statement:

WHILE (expression)
statement
END WHILE

If the expression evaluates as true, the statement is executed and then the
expression is reevaluated. If it is true again the body of the loop is
executed and so on. The loop exits when the expression is evaluated as
false.

A simple example where 10 parallel vertical lines are printed on the screen:

define i as integer
i = 1
while (i <= 10)
create line 5*i 0 5*i 50
i = i + 1
end while

Like the if statement you can also nest the while statement:

WHILE (expression)
#do something several times
WHILE (expression)
#do something different
END WHILE
END WHILE

22 Language Basics
For

The for statement is similar to the while statement, except that it adds
counter initialization and counter manipulation expressions. A for
statement looks like:

FOR expression = expression TO expression


statement
END FOR

It is not as complicated as it looks. A simple example:

define i as integer
for i = 0 to 90
create ellipse 300 200 100 180 i
create ellipse 300 200 100 90 i
end for

Every time the loop returns to its beginning the counter (i in this case) is
increased by 1. In a for statement, the variable type must be an integer.

As an option, you can add the step command to the for statement:

define i as integer
for i = 0 to 90 step 5
create ellipse 300 200 100 180 i
create ellipse 300 200 100 90 i
end for

Language Basics 23
Although the for statement is similar to the while statement it is often
shorter and easier to read than the equivalent while loop. For example a
while loop that counts from 1 to 10 and prints the numbers in a message
window:

define number as integer


number = 1
while (number <= 10)
message "The number is now " + number
number = number + 1
end while

Here’s the corresponding for loop:

define number as integer


for number = 1 to 10
message "The number is now " + number
end for

Break

The break statement breaks the running "for" or "while" loop and
continues the macro after the next "end for" or "end while":

24 Language Basics
Macro myOutbreak
define x as integer
define y as integer
define ea as integer
x = 1
while (x <= 12)
y = 1
while (y <= 12)
ea = 11 * (x - 1) + 5 * y + 20
if (ea > 90)
break
end if
create ellipse 35*x 30*y 10 ea 30
y = y + 1
end while
x = x + 1
end while
end Macro

Run

Using the run statement inside a macro or subMacro executes another


loaded macro or subMacro. The syntax is quite simple:

RUN (Sub)macroName

Language Basics 25
SubMacro routine
message "in routine"
end SubMacro

##############################################

Macro main
message "in main"
run routine
message "back in main"
end Macro

Return

Using the Return statement inside a subMacro returns the given value
as a result to the calling macro. The syntax is:

RETURN expression

SubMacro FindPageFormat
Define s as String
Define p as Point
p.x = activeDoc.window.pageX
p.y = activeDoc.window.pageY
If ( p.x > p.y )
s = "landscape"
Else
s = "portrait"
End If
Return s
End Submacro

Macro GetPageFormat
Define format as String
format = RUN FindPageFormat
Message "The page is in the " + format + "
format"
End Macro

26 Language Basics
File Menu
With this group of commands you can directly access most of the features
from the IsoDraw File Menu.

New

The new command creates a new document. After being created this new
document will be active.

NEW "template"

The optional parameter template is used to load a template file.


Without the parameter an empty file is created.

You can define a path to a template-file or you can just give a file-name.
In this case the template folder is searched for the template file.

#creates a new and empty document


new

#tries to load a template file located


#in the standard template folder
new "myTemplate.iso"

#load a template from a server


new "\\server\isoTemplates\ci.iso

#load a template from a mac HD


new "Macintosh HD:My Files:abc.iso

##############################################

define template as string


template = "c:\templates\iso0815.iso"
new template

The new command returns a reference on the created document. The


properties of that document could be queried and set either through that
reference or through the activeDoc object (see Document or ActiveDoc -
The Document Object).

Open

File Menu 27
The open command opens a document as long as it is in a format that can
be interpreted by IsoDraw. After being opened that document is active.

OPEN "path"

The optional parameter path is used to define the path to the document
that should be loaded. You should always define relative paths. If the
parameter path is not given, the user can choose a file through the
standard open-file dialog. If there is only a path without a file name in the
path-parameter this path is the default path in the open-file dialog.

#open, without a path, opens the open-file dialog


open

#open, with a path, but without a file-name opens


the open-file dialog with the folder specified
in the path
open "D:\IsoDraw-Data"

#open a file on a Windows-PC


open "C:\Documentation\IsoDraw\engine.iso"

#open a file on a Mac


open "Macintosh HD:IsoDraw Illus:frontWheel.iso"

###########################################

define path as string


path = "\\server\Documentation\Illustrations\"
open path + "test.iso"
open path + "example.iso"

28 File Menu
Close

The close command closes the active document or all open documents.

CLOSE all_windows saveconfirm

If the keyword all_windows is given the close command closes all open
documents.

The optional saveconfirm parameter specifies how unsaved


documents will be handled. If the parameter is not given it will be handled
as the condition ask_confirm. The parameter saveconfirm can have 3
different states:

confirm_yes
All unsaved documents will be saved before closing. If a document
was not saved before, a file-save dialog will appear asking the user
for a name and path. If the user cancels this dialog the macro itself
will terminate.

confirm_no
All documents will be closed whether they were saved before or not.

ask_confirm
Before closing any unsaved document the user will be asked if he
would like to save that document. If the user cancels the dialog the
macro itself will be terminated.

close

close all_windows confirm_no

close confirm_yes

Save

The save command saves the active document in the IsoDraw or CGM
format.

SAVE "path" "version" packed

File Menu 29
The optional path parameter defines where and under what name the
document should be saved. If the parameter is not given the actual path
of the active document is taken. If the document was not saved before the
path will be requested through a dialog.

The optional version parameter is for saving the document as a version


other than the default ISO or CGM format (if CGM is set as the native
format). Possible version-strings:

"default"
Actual IsoDraw version or CGM-format if set as native in the
preferences.

"version_6"
IsoDraw 6 format

"version_5"
IsoDraw 5 format

"version_4"
IsoDraw 4 format

"version_3"
IsoDraw 3 format

"CGM"
CGM format

If the optional parameter packed is given an IsoDraw file is created


containing all the data from placed files. Only the data required for
displaying the placed file is saved. The link to the original file is broken. This
option should only be given for version 5 or higher!

#save on a Mac
save "Macintosh HD: My Files: xy.iso"

#save on a PC in CGM format


save "c:\temp\illustration.cgm" "CGM"

#save on a server - "packed"


save
"\\server\documentation\illus\V10_engine.iso"
packed

30 File Menu
Import Layers

The import layers command imports the defined layers from the
defined document.

IMPORT LAYERS "path" "layer_name"

The path parameter defines the source document’s location.

The layer_name parameter defines the name of the layer being


imported.

#importing 3 layers
import layers "c:\work\engine.iso"
"engine_mount" "motor_starter"
"motor_control_unit"

Save Layers

The save layers command saves all defined layers from the current
document as an standard IsoDraw file.

SAVE LAYERS "path" "layer-name"

The path parameter defines where and under what name the document
will be saved.

The layer-name parameter defines the layers to be saved. At least one


layer name has to be defined.

#save some layers


save layers "c:\temp\layers.iso" "Main"
"Illustration"

Place

The place command places an illustration within the current document.

PLACE "path" rectangle

File Menu 31
The optional parameter path is used to define the placed file’s path. You
should always define relative paths. If the parameter path is not given, the
user can choose a file through the standard open-file dialog.

The optional parameter rectangle defines the lower left corner and the
upper right corner of the target-rectangle. The coordinates should be
given as x1 y1 x2 y2 where the first pair defines the lower left corner (x1
y1) and the second pair defines the upper right corner (x2 y2).

#no parameters
place

#just the filename


place "c:\eDok\screw.iso"

#the filename and the cords of the placement


place "Macintosh HD:eDok:screw.iso" 112 334 179
213

Export

The export command exports the current document in the given format.

EXPORT "path" "exportformat" percentage

The path parameter is used for defining where and under what name the
document should be exported.

With the exportformat parameter you can define the format you
would like to save the file as. The following table lists the available formats
with their corresponding keys:

32 File Menu
KEY Format

AI Adobe Illustrator
BMP Bitmap
CALS_Raster Continuous Acquisition and Lifecycle Support
CGM Computer Graphics Metafile
DWG the file format of AutoCAD
DXF Drawing Exchange Format
EPSF Encapsulated PostScript File
HPGL Hewlett Packard Graphics Language
IGES Initial Graphics Exchange Standard
Interleaf a widely used publishing system
JPEG a raster format
MIF Maker Interchange Format
Objects_Text all object informations as text file
PCX a raster format
PICT PICTure format from Apple Macintosh
PNG Portable Network Graphic
SVG Scalable Vector Graphics
SVGZ compressed SVG
Text_Excerpt one of IsoDraw's own formats
TIFF Tagged Image File Format
WMF Windows Meta File

The percentage parameter defines the scaling of the image in percent.


Since it is defined as float you can enter a number with decimal digits.

#export as CGM in the original size


export "a:\plan.cgm" "CGM"

#export as TIFF scaled down 66%


export "c:\picts\results.tif" "TIFF" 66

#export as JPEG scaled down 33.33%


export "Macintosh HD:My Files:results.jpg" 33.33

Quit

The quit command quits the application.

QUIT saveconfirm

File Menu 33
The optional saveconfirm parameter specifies how unsaved
documents will be handled. If the parameter is not given it will be handled
as the condition ask_confirm. The parameter saveconfirm can have 3
different states:

confirm_yes
All unsaved documents will be saved before closing. If a document
was not saved before, a file-save dialog will appear asking the user
for a name and path. If the user cancels this dialog the macro itself
will terminate.

confirm_no
All documents will be closed whether they were saved before or not.

ask_confirm
Before closing any unsaved document the user will be asked if he
would like to have that document saved. If the user cancels this
dialog the macro itself will be terminated.

#quit
quit confirm_yes

34 File Menu
Edit Menu
With this group of commands you can directly access most of the features
from the IsoDraw Edit Menu. The commands "undo" and "redo" will not be
recorded through the IsoDraw macro recorder.

Additional commands to select elements can be found in the Selecting


Elements section of the Palette Window chapter.

Cut

With the cut command you can remove selected elements. The elements
are deleted and saved in the program’s clipboard, replacing the former
contents of the clipboard. The cut elements can be retrieved from the
clipboard at any time through the command paste.

CUT

Copy

With the copy command you can copy selected elements into the
program’s clipboard, replacing the former contents of the clipboard. You
can retrieve the copied elements from the clipboard at any time through
the command paste.

COPY

Duplicate

With the duplicate command you can paste a copy of the selected
elements into the document. To a certain degree the command is a
combination of the commands "copy" and "paste same_position".
However the selected elements are not saved into the clipboard. This has
the advantage that the old contents of the clipboard are retained.

DUPLICATE

Delete Selection

Edit Menu 35
The delete selection command deletes the current selection.

DELETE SELECTION

Paste

The paste command pastes the contents of the clipboard into the middle
of the screen window. Even after you have activated another IsoDraw file,
the elements are still pasted into the middle of the screen.

PASTE same_position maintain_attributes

The optional same_position parameter defines that the elements are


inserted at the same position from where they were cut or copied. This
applies even if you have changed the screen position. Even if you have
activated another IsoDraw file, the elements are still pasted at the precise
position where they where cut or copied from the original document.

The optional maintain_attributes parameter defines that the


standard attributes of the elements (pens, styles, shadows, colors) in the
original document will be retained when pasting.

#paste the clipboard content and retain


#the standard attributes of the elements
paste maintain_attributes

Select All

The select all command activates all the elements and groups in the
current document. Elements located on locked layers are not activated.

SELECT ALL

Select None

The select none command deactivates the selection in the current


document.

36 Edit Menu
SELECT NONE

Select If / SubSelect If

The select if command lets you select elements according to specific


criteria. This is particularly useful if you want to edit several elements with
the same attributes.

The subselect if command, like the select if command, lets you select
elements according to specific criteria. The difference between the two
commands is that subselect if selects the specified elements from an
already existing selection.

A short hint for the following syntax definition:


Every "select if" command could be replaced by a "subselect if"
command. This is the meaning of this notation: (sub)select

(SUB)SELECT IF operand_1 comparison_operator

For this notation the comparison_operator is always exists or its


negation exists not.

The operand_1 parameter can be assigned with these values:

Object_info
Object_name
Object_tip
Object_attribute

(SUB)SELECT IF operand_1 comparison_operator


operand_2

For this notation the comparison_operator is is (or optional is


equal to) or it’s negation is not (or optional is not equal to)
for the following:

If the operand_1 parameter is type the operand_2 parameter can be


assigned with these values:

"line"
"rectangle"
"polygon"

Edit Menu 37
"marker"
"ellipse"
"inner_thread"
"outer_thread"
"bezier"
"text"
"placed_file"
"image"
"callout"

If the operand_1 parameter is pen the operand_2 parameter can be


assigned with these values:

all standard pen names


"$ISO_NOPEN"

If the operand_1 parameter is linestyle the operand_2 parameter


can be assigned with these values:

all standard linestyle names

If the operand_1 parameter is shadow the operand_2 parameter can


be assigned with these values:

all standard shadow names


"$ISO_NOSHADOW"

If the operand_1 parameter is color the operand_2 parameter can


be assigned with these values:

all standard color names


"$ISO_NOFILL"
"$ISO_WHITE"
"$ISO_BLACK"

If the operand_1 parameter is hatching the operand_2 parameter


can be assigned with these values:

any "string"

If the operand_1 parameter is pattern the operand_2 parameter


can be assigned with these values:

38 Edit Menu
any "string"

(SUB)SELECT IF operand_1 comparison_operator


operand_2

For this notation the comparison_operator is is (or optional is


equal to) or it’s negation is not (or optional is not equal to)
OR contains for the following:

If the operand_1 parameter is object_id the operand_2 parameter


can be assigned with these values:

any "string"

If the operand_1 parameter is object_name the operand_2


parameter can be assigned with these values:

any "string"

If the operand_1 parameter is object_tip the operand_2


parameter can be assigned with these values:

any "string"

If the operand_1 parameter is object_attribute the operand_2


parameter can be assigned with these values:

any "string"

If the operand_1 parameter is text the operand_2 parameter can be


assigned with these values:

any "string"

If the operand_1 parameter is text_position the operand_2


parameter can be assigned with these values:

any float

If the operand_1 parameter is text_alignment the operand_2


parameter can be assigned with these values:

Edit Menu 39
"centered"
"left"
"right"
"medium"
"middle"
"top"
"bottom"
"base_line"

If the operand_1 parameter is font the operand_2 parameter can be


assigned with these values:

any "string" e.g.: "arial"

If the operand_1 parameter is font_size the operand_2 parameter


can be assigned with these values:

any float

If the operand_1 parameter is font_face the operand_2 parameter


can be assigned with these values:

"normal"
"bold"
"italic"
"bolditalic"

If the operand_1 parameter is leading the operand_2 parameter


can be assigned with these values:

any float OR
"$AUTOMATIC"

If the operand_1 parameter is kerning the operand_2 parameter


can be assigned with these values:

any float

If the operand_1 parameter is callout the operand_2 parameter


can be assigned with these values:

any "string"

40 Edit Menu
(SUB)SELECT IF object_attribute_value operand_1
comparison_operator operand_2

For this notation both operands could become any string and the
comparison_operator is is (or optional is equal to) or it’s
negation is not (or optional is not equal to) or contains.

select if object_info exists not

#both lines are identical


subselect if type is equal to "line"
subselect if type is "line"

select if object_attribute_value "positioning"


contains "left"

Move

The move command moves the current selection. Without any parameter
given the "move" - dialog is opened.

MOVE

MOVE selection x y no_elements no_patterns

MOVE copy x y connect no_elements no_patterns

If you just want to move the active selection, use the selection
parameter and if you want to move and copy the selection you have to
use the copy parameter.

The x and y parameters define the direction of the movement.

If you want to copy with connecting lines, use the optional parameter
connect.

If you want to move patterns with reference to elements, use the optional
parameter no_elements.

If you want to move only the elements, use the optional parameter
no_patterns.

Edit Menu 41
#just moving the selection
move selection 123.22 (-11.98) no_patterns

#moving and copying


move copy 77.99 22 connect

Align

The Align command aligns selected 2D elements in a specified direction.

Align direction

The direction may be “left”, “medium”, “right”, “top”, “middle” or “bottom”.

Select if Type is equal to "text"


Align left

Distribute

The Distribute command equally distributes selected 2D elements in a


specified direction.

Distribute direction

The direction may be “left”, “medium”, “right”, “top”, “middle” or “bottom”.

Select if Type is equal to "text"


Distribute left

Preferences

The preferences can be accessed through the application object. Please see
Preferences (Part I) - The Application Object and Preferences (Part II) - Data
Exchange Settings for further details.

42 Edit Menu
Element Menu
With this group of you can directly access most of the features from the
IsoDraw Element Menu. Commands to select elements can be found
within the Edit Menu chapter or within the Selecting Elements chapter.

Arrange

With the arrange command you can reorder elements, bringing them
above or below others.

Arrange direction

The parameter direction defines direction that selected elements will


be re-arranged. Allowed values are: “top”, “up”, “down” and “bottom”.
“top” specifies that the element will be above all others and “below”
specifies the opposite. “up” specifies that the order of arrangement will be
adjusted by one position towards the top and “down”, one position
towards the bottom.

Arrange top

Convert Selection into Elements

With the convert selection into Elements command you can


convert selected elements into simpler types of elements as per the table
below.

Convert Selection into elements

Elements Converts Into


Polyline Lines
Rectangle Lines
Inner Thread Ellipses (segments)
External Thread Lines and Ellipses (segments)
Polygon Lines
Dimension Already a group of basic elements
Callout Polylines, Text and Rectangle or Polyline and
Ellipses

Element Menu 43
Convert Selection into Bezier Parts

With the convert selection into Bezier Parts command you


can convert selected elements into Beziers.

Convert Selection into Bezier Parts

Convert Selection into Polylines

With the convert selection into Polylines command you can


convert selected elements into Polylines

Convert Selection into Polylines no_handles

The optional parameter no_handles defines that elements with


handles, such as Beziers will not be converted.

Join Polylines

With the join polylines command you can join selected lines and
polylines into a single polyline

Join Polylines

Join Beziers

With the join beziers command you can join selected elements into
a single Bezier.

Join Beziers convert

The optional parameter convert defines that all elements will be


converted into Beziers and joined. Without this option only Beziers will be
joined.

Generate Contour

44 Element Menu
With the generate contour command you can create a continous,
closed contour from the selected elements.

Generate Contour

Create Compound Path

With the create compound path command you can create a


connected, compound path from the selected elements.

Create Compound Path

Groups

Group Selection

With the group selection command you can create a group from all
selected elements.

GROUP SELECTION

macro all_lines_in_one_group
select if type is "line"
group selection
end macro

Ungroup Selection

The ungroup selection command lets you ungroup the group you
have selected.

UNGROUP SELECTION deep

The optional parameter deep defines that the command should ungroup
all nested groups in the selection. This is similar to using the shift key
when ungrouping manually.

Element Menu 45
Start Group

The start group command starts a group. After executing this


command every new element created through a macro command will be
added to that group unless the group is closed through an end group
command or a new group is opened with start group.

START GROUP

End Group

The end group command closes the last grouping level that was started
with start group.

END GROUP

macro nested_groups
start group
start group
Create Ellipse 254.557 195.959 30
240 35.264
Create Ellipse 197.99 195.959 30
300 35.264
Create Ellipse 226.274 244.949 30
180 35.264
end group
Create Rectangle 226.274 146.968
282.843 179.628 282.843 244.949 226.274 212.288
Create Rectangle 282.843 244.949
226.274 277.608 169.705 244.949 226.274 212.288
Create Rectangle 169.705 244.949
169.705 179.628 226.274 146.968 226.274 212.288
end group
end macro

Mask At

With the mask at command you can mask the selected element with the
element at the location specified.

MASK AT <X> <Y>

46 Element Menu
The X and Y parameters specify the location of the element which will
be used to mask the selected element.

Mask At 120 340

Release Mask

With the release mask command you can remove the selected mask.

Release Mask

Lock

With the lock command you can lock selected elements.

Lock

Unlock

With the unlock command you can unlock all elements.

Unlock

Transformation 3D

With the transformation 3D command you can switch to the 3D


transformation mode. A placed 3D element needs to be selected.

Transformation 3D

Set Image Transparency

Element Menu 47
With the set image transparency command you can toggle the
transparency setting for raster images.

Set image transparency “switch“

The switch parameter allows you to change the setting. Allowed values
are “on” and “off”.

Set image transparency on

Import Selection

With the import selection command you can import a selected,


placed element. This will break the link to the placed file.

Import Selection

48 Element Menu
Objects Menu
With this group of commands you can directly access most of the features
from the IsoDraw Object Menu.

Create Object_info

The create object_info command creates an object info for an


element.

CREATE OBJECT_INFO element

The element parameter defines the element that should get an object
info. For further information see Document or ActiveDoc - The Document
Object and Element - The Element Object.

define el as element
el = activeDoc.firstSelectedElement
create object_info el

Delete Object_info

The delete object_info command removes the object info from all
selected objects

DELETE OBJECT_INFO deep

The optional parameter deep removes the object info even in groups or
subgroups.

Create Object_attribute

Creates a new attribute to the object_info of a given element.

CREATE OBJECT_ATTRIBUTE "name" "type" element

The name parameter defines the name of the new attribute as string.

Objects Menu 49
The type parameter defines the type of the new attribute. Possible data
types are “integer”, “float”, “string” and “link” where the “link” is just a
special string.

The element parameter defines the element which should get a new
attribute to its object_info. The element must already have an object info
(see create object_info).

Macro Create Object Info

define el as element
el = create ellipse 100 100 100 90 90
create object_info el

create object_attribute "Title" "string" el


el.info.attributes["Title"].value = "IsoDraw"

create object_attribute "Stock" "integer" el


el.info.attributes["Stock"].value = 10

create object_attribute "URL" "link" el


el.info.attributes["URL"].value = "http://
www.itedo.com"

End Macro

Delete Object_attribute

This command removes an object attribute.

DELETE OBJECT_ATTRIBUTE "name" element

The name parameter defines the name of the attribute that has to be
removed.

The element parameter defines the element.

delete object_attribute "Stock" el

50 Objects Menu
Create Hotspots

The create hotspots command generates hotspots for selected text


elements.

CREATE HOTSPOTS element n numbers_only


convert_spaces

The n parameter defines the number of characters from the text element
that will be assigned as the Object Name.

The optional numbers_only parameter defines that only elements


comprissed entirely of numbers will have hotspots generated.

The optional convert_spaces parameter defines that any spaces in the


object name will be converted into “_” when used as the Object Name.

create hotspots 64 convert_spaces

This function returns an integer value. This value represents the number
of hotspots created.

Objects Menu 51
52 Objects Menu
Text Menu
With this group of commands you can directly access most of the features
from the IsoDraw Text Menu.

Text

The text command activates one text property and assigns it to all
selected text elements. All text elements created after the execution of
this command will also have these properties.

TEXT attribute value

If the attribute is font the value could assume any installed font name
as a quoted string.

text font "arial"

If the attribute is size the value could assume any float number as a
point value.

text size 12.8

If the attribute is face the value could assume the following:

normal, bold, italic, bolditalic

text face bold

If the attribute is align the value could assume the following:

as a global alignment:
centered

as a horizontal alignment:
left, medium, right

as a vertical alignment:
top, middle, bottom, base_line

text align right

Text Menu 53
If the attribute is leading the value could assume any float number as
a point value.

text leading 3.7

If the attribute is kerning the value could assume any float number.

text kerning 7

If the attribute is position the value could assume any float number as
a point value.

text position 12.7

Convert Text to Paths

The Convert Text to Paths command will convert selected text


elements in to filled Bézier paths.

Convert Text to Paths

54 Text Menu
Layer Window
With this group of commands you can directly access most of the features
from the IsoDraw Layer Menu.

Add Layer

The add layer command creates a new layer in the active document.
This layer automatically becomes the active layer, i.e. all elements which
you now generate will be assigned to this layer. The command will also
return a reference on the layer it has just created (see Layer - The Layer
Object).

ADD LAYER "name" r g b

The name parameter defines the name of the layer.

The optional r g b parameter defines the identifying color of the layer


as RGB. All three color-numbers have to defined separated by a blank to
execute the macro command correctly.

#no color given


define lyr as layer
lyr = add layer "myNewLayer"

#a new layer with an identification color


add layer "anotherLayer" 188 0 29

#a more complex example


macro AddLayers
Define i as integer
Define k as integer
For i = 1 to 8
k = 32*(i-1)
Add Layer "Layer "+i 255-k k 0
End For
End macro

Cut Layer

The cut layer command cuts the current layer and all its elements from
the currently active document and saves them in the program’s clipboard.

Layer Window 55
The cut layer can be retrieved from the clipboard at any time through the
command paste layer.

CUT LAYER

Copy Layer

With the copy layer command you can copy the active layer into the
program’s clipboard. The copied layer replaces the former content of the
clipboard. The copied layer can be retrieved from the clipboard at any time
through the command paste layer.

COPY LAYER

Paste Layer

The paste layer command pastes the content of the clipboard


(provided that the content of the clipboard is a layer) into the currently
active document. Even if you have activated another IsoDraw file.

PASTE LAYER

Duplicate Layer

With the duplicate layer command you can paste a copy of the
selected layer into the document. To a certain degree the command is a
combination of the commands "copy layer" and "paste layer". However the
selected layer is not saved to the clipboard. This has the advantage that
the old content of the clipboard is retained.

DUPLICATE LAYER

Delete Layer

The delete layer command deletes the currently active layer.

56 Layer Window
DELETE LAYER

Activate Layer

To activate an inactive layer use the activate layer command. All


elements which you now create will be assigned to the newly activated
layer.

ACTIVATE LAYER "name"

The name parameter defines the name of the layer you wish to activate.
The name is case-sensitive!

activate layer "Standard layer"

Delete All Empty Layers

With the delete all empty layers command you can automatically delete
all layers that contain no elements.

DELETE ALL EMPTY LAYERS

Selected Elements to Active Layer

This command will move all selected elements to the active layer.

Selected Elements to Active Layer

Selected Text to Active Layer

This command will move all selected text elements to the active layer.

Selected Text to Active Layer

Layer Window 57
58 Layer Window
Window Menu
With this group of commands you can directly access most of the features
from the IsoDraw Windows Menu. The commands "hide" and "show" will
not be recorded through the IsoDraw macro recorder.

Activate Window

The activate window command activates an already opened


document.

ACTIVATE WINDOW "file"

The file parameter defines the name of a document window that should
be activated. The document has to be open.

#activate a already opened document


activate window "abc.iso"

Hide

The hide command closes an IsoDraw window.

HIDE window

The window parameter defines the window that should be closed.


Possible window strings:

palette

attribute_window

layer_window

fill_window

object_window

Window Menu 59
#close the palette
hide palette

#close attribute window


hide attribute_window

Show

The show command opens an IsoDraw window.

SHOW window

The window parameter defines the window that should be opened.


Possible window strings:

palette

attribute_window

layer_window

fill_window

object_window

#open the palette


show palette

#open attribute window


show attribute_window

Zoom

The zoom command sets the view size of the active IsoDraw document.

ZOOM size

The size parameter defines the view size for the active document as
string or float. Possible values are “page”, “extent” or any integer from 0.01
to 6400 to specify a scale %.

60 Window Menu
Palette Window
With this group of commands you can directly access most of the features
from the IsoDraw Palette Window.

Selecting Elements

To select elements with the IsoDraw Macro Language you can use the
following commands. Please refer to the Edit Menu chapter for additional
commands regarding the select elements topic or the Arrange section in
the Element Menu chapter.

Select Rectangle

The select rectangle command selects all elements within the


given rectangle.

SELECT RECTANGLE x1 y1 x2 y2 with_partial direct


add

The x1 and y1 parameters define the start point and the x2 and y2
parameters define the end point of the diagonal of the rectangle.

The optional parameter with_partial defines that elements partially


within the rectangle will also be selected. If this parameter is not given
only elements completely inside rectangle will be selected.

The optional parameter direct defines that elements within a group will
be selected even if the entire group is not within the selection rectangle.

The optional parameter add defines that this new selection will be added
to an existing selection, rather than replacing it. This is similar to using the
shift key when making multiple selections manually.

select rectangle 12.45 22 (-10.23) 289

Select Polygon Start

The select polygon start command begins the process of creating


a selection polygon.

SELECT POLYGON START

Palette Window 61
Select Polygon Points

The select polygon points command allows points for the


selection polygon to be specified.

SELECT POLYGON POINTS p1 <p2>... <pn>

The p1 parameter define the start point for the polygon as point.

The optional parameters p2 to pn define additional points for theUnd


selection polygon as point.

Select Polygon End

The select polygon end command end the selection polygon


command.

SELECT POLYGON END with_partial direct add

The p1 parameter define the start point for the polygon as point.

The optional parameters with_partial defines if partially selected


elements should be selected.

The optional parameter direct defines that elements within a group will
be selected even if the entire group is not within the selection polygon.

The optional parameter add defines that this new selection will be added
to an existing selection, rather than replacing it. This is similar to using the
shift key when making multiple selections manually.

# Select everything in the lower right


Define px as Integer
Define py as Integer
px = activeDoc.window.PageX
py = activeDoc.window.PageY
Select Polygon Start
Select Polygon points 0 0 px 0
Select Polygon points px py
Select Polygon end direct

Select At

62 Palette Window
The select at command selects an element or just a part of an element
in the current document at the given coordinates.

SELECT AT x y toggle part direct group

The x and y parameters define the click-point.

You can put the optional parameters toggle, part, and direct in any
order. The parameter group is interacting with the direct option and
must be placed after it.

Parameter Is used for ... Corresponding to ...


toggle ... the multiple selection of ... selecting with the SHIFT
different elements. If one key pressed.
element was already selected
the selection is canceled.
part ... adding a line-segment or a ... selecting with the ALT key
bézier-segment to a pressed.
selection
direct ... ... selecting with the "direct
selection arrow cursor"
group ... selecting one group of a ... selecting with the CTRL key
nested group containing this pressed. Only if the cursor is
element. the "direct selection arrow
cursor"

Transform Selection

Scale Selection

If you want to scale the elements that you have selected, use the scale
selection command.

SCALE SELECTION x y m_x m_y copy no_elements


no_patterns

The x and y parameters define the corner and therefore in what direction
you want to scale the elements.

The m_x and m_y parameters define the scaling of the x- and y-axis. These
parameters will multiply the axis. I.e. every number below one is for

Palette Window 63
shrinking the selection, one does no scaling at all and everything over one
is for enlarging the selection.

The optional parameter copy is for scaling and copying the object instead
of just scaling it.

If you want to scale patterns with reference to elements, use the optional
parameter no_elements.

If you want to scale only the elements, use the optional parameter
no_patterns.

scale selection 432.2 223.33 1.5 1.5 copy

Rotate Selection

The rotate selection command rotates an object around a point.

ROTATE SELECTION x y angle copy no_elements


no_patterns

The x and y parameters define the center point you want to rotate the
selected object around.

The angle parameter defines the rotation angle.

The optional parameter copy is for rotating and copying the object
instead of just rotating it.

If you want to rotate patterns with reference to elements, use the optional
parameter no_elements.

If you want to rotate only the elements, use the optional parameter
no_patterns.

rotate selection 345.99 22.2 33.77 no_patterns

Reflect Selection

REFLECT SELECTION x y angle copy no_elements


no_patterns

64 Palette Window
The x and y parameters define the point where the center of reflection is
to lie.

The angle parameter defines the direction the reflection axis is located.

The optional parameter copy is for reflecting and copying the object
instead of just reflecting it.

If you want to reflect patterns with reference to elements, use the


optional parameter no_elements.

If you want to reflect only the elements, use the optional parameter
no_patterns.

reflect selection 111 332.666 33.5

Create Parallels

The create parallels command will generate parallel paths at a


specified distance from the original elements.

CREATE PARALLELS dist both_sides delete_original

The dist parameter defines the distance from the original element the
parallels will be drawn, in mm.

If the optional parameter both_sides is given the parallels will be


drawn on both sides of the original element.

If the optional parameter delete_original is given the original element will


be deleted after drawing the parallels.

create parallels 10.75 both_sides


delete_original

Transforming the Illustration

Set Transform

The set transform command creates a transformation matrix. This


matrix is used for all following commands until a restore command is

Palette Window 65
executed. Therefore you should always restore the transformation matrix
to normal with "restore transform" after using "set transform".

SET TRANSFORM x y angle scale

SET TRANSFORM MATRIX 2D_Matrix

The x and y parameters define the offset of the displacement.

The angle parameter defines the angle of the displacement.

The scale parameter defines the scaling of the displacement.

macro trans
define i as integer
define n as integer
define x as integer
define y as integer
set transform 300 200 0 0.5
for n = 0 to 75 step 15
set transform 0 0 n 1
for i = 90 to 360 step 90
if (i = 90)
x = 0
y = 200
end if
if (i = 180)
x = -200
y = 0
end if
if (i = 270)
x = 0
y = -200
end if
if (i = 360)
x = 200
y = 0
end if
set transform x y i 1
create line 0 0 100
0
restore transform
end for
restore transform
end for

66 Palette Window
restore transform
end macro

Restore Transform

The restore transform command removes the last transformation


matrix from the transformation chain.

RESTORE TRANSFORM

Absolute

If the absolute mode is set all transformation matrices are ignored. All
coordinates are interpreted as absolute coordinates until the absolute
mode is turned off.

ABSOLUTE on

ABSOLUTE off

Creating Elements

All create commands (ellipse, line, rectangle ...) return a reference on the
created element. The properties of this element object can be queried and
set (see Element - The Element Object).

Create Line

The create line command plots a line in your IsoDraw Document.

Palette Window 67
CREATE LINE x1 y1 x2 y2

The parameters x1 and y1 define the starting point of the line and the
parameters x2 and y2 define the endpoint of the line.

create line 189 10 20.23 200.99

Append Line Segment

The append line segment command appends a line to the last line
created by the "create line" command or by an "append line command". To
append a line for the first time there has to be a line created by the "create
line" command!
The start point for the appended line is the end point of the line plotted
by the "create line" command resp. the "append line segment" command.

APPEND LINE SEGMENT x y

The x and y parameters define the end point of the line segment.

Macro house_of_nicholas

#first create a line by a macro command


create line 100 100 200 100

#second append line segments


append line segment 200 200
append line segment 100 100
append line segment 100 200
append line segment 200 200
append line segment 150 250
append line segment 100 200
append line segment 200 100

End Macro

Create Ellipse

68 Palette Window
The create ellipse command plots an ellipse.

CREATE ELLIPSE x y radius angle value

The x and y parameters define the center of the ellipse.

The radius parameter defines the radius of the ellipse.

The angle parameter defines the ellipse angle.

The value parameter defines the ellipse value.

create ellipse 113.34 112.99 99 23.5 27

Create Inner Thread

This command creates an inner thread.

CREATE INNER THREAD x y radius angle value depth

The x and y parameters define the center of the ellipse.

The radius parameter defines the radius of the ellipse.

The angle parameter defines the ellipse angle.

The value parameter defines the ellipse value.

The optional parameter depth describes the depth of the inner thread. If
the parameter is set to -1 or missing the inner thread will be completely
filled.

Create Inner Thread 342.947 222.495 50 240 35.264

Create Outer Thread

This command creates an outer thread.

CREATE OUTER THREAD x y radius angle value depth

The x and y parameters define the center of the ellipse.

The radius parameter defines the radius of the ellipse.

Palette Window 69
The angle parameter defines the ellipse angle.

The value parameter defines the ellipse value.

The optional parameter depth describes the depth of the outer thread. If
the parameter is missing the depth of the outer thread will be set to 0.

Create Callout

The create callout command inserts a callout element into the


currently active document.

CREATE CALLOUT "style" x1 y1 x2 y2 "notation"

The parameter style defines which style is used for the callout. The given
style must be defined before using it for the command. The name of the
style is case sensitive.

The parameters x1 and y1 define the starting point of the callout and the
parameters x2 and y2 define the end point of the callout. The callout
number will appear at the coordinates of the end point. To create a callout
without a line the start and end coordinates have to be identical.

The optional parameter notation is needed for callout styles with the
scheme set to “No Scheme”. In these cases the notation will be used as the
callout text. If the scheme of the callout style is not set to “No scheme”
the notation will be ignored.

#a callout with automatic numbering


create callout "Normal" 112.39 110 290.99 100

#creating an element for later modification


define ele_07 as element
ele_07 = create callout "Normal" 112.39 110
290.99 100

#a callout with a given name


#remember: the “No scheme” style must be used
create callout "myStyle" 15 127.25 15 115 "AX_22"

Create Rectangle

70 Palette Window
The create rectangle command plots a rectangle in active
document.

CREATE RECTANGLE sp_x sp_y lr_x lr_y ep_x ep_y


ul_x ul_y rounded angle value

The parameters sp_x and sp_y define the starting point of the rectangle.

The parameter s lr_x and lr_y define the lower right corner of the
rectangle.

The parameter ep_x and ep_y define the end point of the rectangle.

The parameter ul_x and ul_y define the upper left corner of the
rectangle.

The optional parameter rounded, angle and value are used for
defining the rounded corners of the retangle. Where “rounded” is for
initiating, “value” for the ellipse value and “angle” is for the ellipse angle
of the rounding.

#a normal rectangle
create rectangle 236.881 222.495 236 132.681 314
87 314 177

#a rectangle with rounded corners


create rectangle 236 222 236.881 132.681 314
87.772 314 177.587 rounded 90 90

Create Polygon

The create polygon command plots a polygon.

CREATE POLYGON x y corners radius angle value

The x and y parameters define the center of the polygon.

The corners parameter defines how many corners (or sides) the polygon
is going to have.

Because a polygon behaves like an ellipse while being drawn, you also
have to define a radius, an angle as the ellipse angle and a value as
a ellipse value (see also create ellipse).

Palette Window 71
#drawing an octagon
create polygon 381.838 212.288 8 65 300 35.264

Create Bezier Curve

The create bezier curve command draws a bezier curve.

CREATE BEZIER CURVE point1 handle1 handle2 point2

The point1 parameter defines with its x- and y-coordinates the starting
point of the bézier curve and the starting point of the first handle.

The handle1 parameter defines with its x- and y-coordinates the


endpoint of the first handle. As a result, this also defines the length and
the heading of the first handle.

The handle2 parameter defines with its x- and y-coordinates the


endpoint of the second handle. As a result, this also defines the length and
the heading of the second handle.

The point2 parameter defines with its x- and y-coordinates the end
point of the bézier curve.

create bezier curve 100 100 150 100 150 200 200
200

Append Bezier Segment

The append bezier segment command appends a bézier curve to the


last bézier curve created by the "create bezier curve" command or by an
"append bezier segment" command. To append a bézier curve for the first
time there has to be a bézier curve created by the "create bezier curve"
command!

72 Palette Window
The start point for the appended bézier curve is the end point of the bézier
curve created by the "create bezier curve" command resp. the "append
bezier segment" command.

APPEND BEZIER SEGMENT handle1 handle2 point

The handle1 parameter defines with its x- and y-coordinates the


endpoint of the first handle. As a result, this also defines the length and
the heading of the first handle.

The handle2 parameter defines with its x- and y-coordinates the


endpoint of the second handle. As a result, this also defines the length and
the heading of the second handle.

The point parameter defines with its x- and y-coordinates the end point
of the bézier curve.

create bezier curve 100 100 150 100 150 200 200
200
append bezier segment 250 200 250 100 300 100
append bezier segment 350 100 350 200 400 200
append bezier segment 450 200 450 100 500 100

Create Text

The create text command creates a text element in the active


document.

CREATE TEXT x y "text"

The x and y parameters define the lower left corner of the text box.

The text string defines the text that is created.

create text 100 100 "The IsoDraw Macro Language"

Change Text At

Palette Window 73
The Change Text At command changes a text element at a specific
position on the current document.

CHANGE TEXT AT x y "text"

The x and y parameters define the position of the text element that will
be changed as float.

The text parameter defines the new text as string.

Change Text at 100 100 "IsoDraw 6"

Set Ellipsevalues

The Set Ellipsevalues command sets the ellipse value or “angle”


used during the creation of new ellipses.

Set Ellipsevalues angle

The angle parameter defines the desired ellipse angle between 1 and 90
as float.

Set Ellipsevalues 45

74 Palette Window
Attribute Window
With this group of commands you can directly access most of the features
from the IsoDraw Attribute Window.

Pens

Add Pen

With the add pen command you can create a new pen. The new pen will
be added to the currently active document and inherit the attributes of
the currently active pen. The new pen will be set to active.

If there is no document open, the created pen will be a new


standard pen available in all new documents.

ADD PEN "name" width

The name parameter defines the name of the pen after creation. If there
is already a pen with that name the macro command can not be executed.
It is forbidden to use the following characters within a pen name:
/ ^ ! < ( :

The optional width parameter defines the width of the pen in mm.

add pen "highlight_this"

add pen "BIG" 5.0

Delete Pen

This command deletes an existing pen from the currently active


document.

With no document open a standard pen will be deleted.

DELETE PEN "name" "substName"

The name parameter defines the name of the pen that is going to be
deleted. If no pen with that name exists the command can not be
executed.

Attribute Window 75
The substName parameter defines the name of the pen that is
substituted. If no pen with that name exists the command can not be
executed.

delete pen "BIG" "$ISO_THICK"

Set Active Pen

This command sets the active pen to the one specified.

Set Active Pen "name"

The name parameter defines the name of the pen that is going to be set
as active.

Set Active Pen "$ISO_THICK"

Set Lineoptions

The set lineoptions command lets you change the print options for
particular elements. If elements are selected when executing the
command the options are changed for these elements. If no elements are
selected when executing this command the print options for the whole
active document are changed. Every element created after executing the
command will then have these options.

SET LINEOPTIONS ends corners overprint


miter_limit

The ends option defines the type of line ends.

The corners option defines the type of line corners. This option is only
significant for Bézier paths with corner points.

The overprint option lets you choose which type


of overprinting you want to have. The values for this
option are 0 for no overprint, 1 for overprinting the
stroke, 2 for overprinting the fill and 3 for
overprinting stroke and fill.

The miter_limit lets you limit the miter corner for


sharp angles.

76 Attribute Window
set lineoptions 2 0 0 4

stands for the following setting:

Styles

Add Style

The add style command creates a new style. This new style will be
added to the currently active document. If there is already an active style
the added style will inherit the attributes of the active style. After the new
style is added to the document this style will be the new active style, used
for all following elements.

If there is no document open, the created style will be a new


standard style available in all new documents.

ADD STYLE "name" pattern

The name parameter defines the name of the new style. If there is already
a style with that name the command can not be executed. The following
characters are forbidden within a style name:
/ ^ ! < ( :

The optional pattern parameter consists of 6 floats defining the


different strokes and gaps of the patterns.
pattern = stroke1 gap1 stroke2 gap2 stroke3 gap3

add style "myStyle"

#adding a style with the optional patterns


add style "myNewStyle" 0.5 2.5 0.5 3.5 1.5 1.5

Delete Style

This command deletes an existing style out of the style list of the currently
active document.

With no document open a standard style will be deleted.

DELETE STYLE "name" "substName"

Attribute Window 77
The name parameter defines the name of the style that is going to be
deleted. If no style with that name exists the command can not be
executed.

The substName parameter defines the name of the style that is


substituted. If no style with that name exists the command can not be
executed.

delete style "myNewStyle" "Dashed"

Set Active Style

This command sets the active style to the one specified.

Set Active Style "name"

The name parameter defines the name of the style that is going to be set
as active.

Set Active Style "Dashed"

Shadows

Add Shadow

With the add shadow command you can create a new shadow. The new
shadow will be added into the currently active document and inherit the
attributes of the currently active shadow. The new shadow will be set to
active.

If there is no document open, the created shadow will be a new


standard shadow available in all new documents.

ADD SHADOW "name"

The name parameter defines the name of the shadow after creation. If
there is already a shadow with that name the macro command can not be
executed. It is forbidden to use the following characters within a shadow
name:
/ ^ ! < ( :

78 Attribute Window
add shadow "myShadow"

Delete Shadow

This command deletes an existing shadow out of the shadow list of the
currently active document.

With no document open a standard shadow will be deleted.

DELETE SHADOW "name" "substName"

The name parameter defines the name of the shadow that is going to be
deleted. If no shadow with that name exists the command can not be
executed.

The substName parameter defines the name of the shadow that is


substituted. If no shadow with that name exists the command can not be
executed.

delete shadow "myShadow" "Autom. Long"

Set Active Shadow

This command sets the active shadow to the one specified.

Set Active Shadow "name"

The name parameter defines the name of the shadow that is going to be
set as active.

Set Active Shadow "Autom. Long"

Grids

Add Grid

The add grid command creates a new grid and adds it to the currently
active document.

Attribute Window 79
If there is no document open, the new grid will be a new standard
grid available in all new documents.

ADD GRID "name" z_angle x_angle

The name parameter defines the name of the grid after creation. If there
is already a grid with that name the macro command can not be executed.
It is forbidden to use the following characters within a macro name:
/ ^ ! < ( :

The optional z_angle and x_angle parameters define the z- and x-axis.
The angles can range from 0° to 90° but totaled they should not exceed
90° (included). The y-axis is not specified as it will always be vertical.

If the angle parameters are missing the plane angle of the first two
selected lines is taken to build the grid. If only one line is selected the grid
will be build as isometric-grid (30° - 30°).

macro CreateGridArray
Define a as Integer
Define b as Integer
For a=10 to 70 step 10
For b=10 to 80-a step 10
Add Grid "[ "+a+" - "+b+ " ]" a b
End For
End For
End macro

Delete Grid

This command deletes an existing grid out of the grid list of the currently
active document.

With no document open a standard grid will be deleted.

DELETE GRID "name" "substName"

The name parameter defines the name of the grid that is going to be
deleted. If no grid with that name exists the command can not be
executed.

80 Attribute Window
The substName parameter defines the name of the grid that is
substituted. If no grid with that name exists the command can not be
executed.

delete grid "[ 10 - 20 ]" "Plane"

Formats

Add Format

With the add format command you can create a new format. The new
format will be added into the currently active document and inherit the
attributes of the currently active format. The new format will be set to
active.

If there is no document open, the created format will be a new


standard format available in all new documents.

ADD FORMAT "name"

The name parameter defines the name of the format after creation. If
there is already a format with that name the macro command can not be
executed. It is forbidden to use the following characters within a format
name:
/ ^ ! < ( :

add format "myFormat"

Delete Format

This command deletes an existing format out of the format list of the
currently active document.

With no document open a standard format will be deleted.

DELETE FORMAT "name" "substName"

The name parameter defines the name of the format that is going to be
deleted. If no format with that name exists the command can not be
executed.

Attribute Window 81
The substName parameter defines the name of the format that is
substituted. If no format with that name exists the command can not be
executed.

delete format "myFormat" "Normal"

Set Active Format

This command sets the active format to the one specified.

Set Active Format "name"

The name parameter defines the name of the format that is going to be
set as active.

Set Active Format "Normal"

Viewports

Add Viewport

With the add viewport command you can create a new viewport. The
new viewport will be added into the currently active document and inherit
the attributes of the currently active viewport. The new viewport will be
set to active.

If there is no document open, the created viewport will be a new


standard viewport available in all new documents.

ADD VIEWPORT "name"

The name parameter defines the name of the viewport after creation. If
there is already a viewport with that name the macro command can not
be executed. It is forbidden to use the following characters within a
viewport name:
/ ^ ! < ( :

add viewport "myViewport"

Delete Viewport

82 Attribute Window
This command deletes an existing viewport out of the viewport list of the
currently active document.

With no document open a standard viewport will be deleted.

DELETE VIEWPORT "name"

The name parameter defines the name of the viewport that is going to be
deleted. If no viewport with that name exists the command can not be
executed.

delete viewport "myViewport"

Execute Viewport

With the execute viewport command you can jump to a given viewport.

EXECUTE VIEWPORT "path" "name"

The path parameter must have the path and name of an existing IsoDraw
or CGM File. To activate the currently active file the path parameter can
be an empty string.

The name parameter defines the name of an existing viewport of the file
given in the path parameter resp. the currently active file. The name
parameter is case sensitive.

execute viewport "" "detail_1"

execute viewport
"c:\data\illustration\Mz445_ttr.iso" "seat"

Add Layerstatus

With this command a layer can be added to a viewport.

Add Layerstatus "layer_name" to "viewport_name"

The layer_name parameter is the name of the layer to be added.

The viewport_name parameter is the name of the viewport the layer


will be added to.

Attribute Window 83
Add Layerstatus "My_Layer" to "My_Viewport"

Remove Layerstatus

With this command a layer can be removed from a viewport.

Remove Layerstatus "layer_name" from


"viewport_name"

The layer_name parameter is the name of the layer to be removed.

The viewport_name parameter is the name of the viewport the layer


will be removed from.

Remove Layerstatus "My_Layer" from "My_Viewport"

Callouts

Add Callout_Style

With the add callout_style command you can create a new callout
style. The new callout style will be added into the currently active
document and inherit the attributes of the currently active callout style.
The new callout style will be set to active.

If there is no document open, the created callout style will be a new


standard callout style available in all new documents.

ADD CALLOUT_STYLE "name"

The name parameter defines the name of the callout style after creation.
If there is already a callout style with that name the macro command can
not be executed. It is forbidden to use the following characters within a
callout style name:
/ ^ ! < ( :

add callout_style "myCallout"

Delete Callout_Style

84 Attribute Window
This command deletes an existing callout style out of the callouts list of
the currently active document.

DELETE CALLOUT_STYLE "name" "substName"

The name parameter defines the name of the format that is going to be
deleted. If no callout style with that name exists the command can not be
executed.

The optional substName parameter defines the name of the callout style
that is substituted. If no callout style with that name exists the command
can not be executed.

delete callout_style "myCallout" "Normal"

Renumber Callouts

This command renumbers existing callouts, regardless of the setting


specified under Update for the callout style.

Renumber Callouts

Attribute Window 85
86 Attribute Window
Fill Window
With this group of commands you can directly access most of the features
from the IsoDraw Fill Window.

Colors

Add Color

With the add color command you can create a new color. The new
color will be added to the currently open document. The new color will be
set to active.

If no document is open the created color will be a new standard


color available in all new documents.

ADD COLOR "name" color

The name parameter defines the name of the color after creation. If there
is already a color with that name the macro command can not be
executed. Furthermore, it is forbidden to use the following characters
within a color name:
/ ^ ! < ( :

The optional color parameter defines the color as a colorSpec.

Macro Add Color

define red as RGBColor


red.red = 188
red.green = 0
red.blue = 29

define color_red as colorSpec


color_red.type = "rgbValues"
color_red.rgb = red

add color "RED_188_0_29" color_red

End Macro

Delete Color

Fill Window 87
This command deletes an existing color out of the color list of the
currently active document.

With no document open a standard color will be deleted.

DELETE COLOR "name" "substName"

The name parameter defines the name of the color that is going to be
deleted. If no color with that name exists the command can not be
executed.

The substName parameter defines the name of the color that is used as
substitution. If no color with that name exists the command can not be
executed.

delete color "RED_188_0_29" "Black"

88 Fill Window
3D Commands
The 3D commands can only be executed if the current active document is
opened in 3D mode, otherwise an error message will appear.

3D View

The 3D View command changes the camera angle of the 3D scene.

3D VIEW view

The view parameter defines the camera angle as integer. Allowed values
are:

X View X
Y View Y
Z View Z
Isometric_top Isometric view top
Isometric_bottom Isometric view bottom
Dimetric_1 Dimetric view 1
Dimetric_2 Dimetric view 2
Dimetric_3 Dimetric view 3
Dimetric_4 Dimetric view 4
Trimetric Trimetric view
Perspective Perspective view

3D View Dimetric_2

3D SetView

This command is included for compatibility reasons


only. It is not recommended that you use this command
for new development of macros as it may be
discontinued in the future. All features from this
command have been incorporated into the new command
“3D View”.

The 3D SetView command changes the camera angle of the 3D scene.

3D SETVIEW view

3D Commands 89
The view parameter defines the camera angle as integer. Allowed values
are 900 for “View X”, 901 for “View Y”, 902 for “View Z”, 903 for “Isometric
view top”, 904 for “Isometric view bottom”, 905 for “Dimetric View 1”, 906
for “Dimetric View 2”, 907 for “Dimetric View 3”, 908 for “Dimetric View 4”,
909 for “Trimetric View” and 910 for “Perspective View”.

3D SetView 903

3D Project

This command projects the 3D scene into the 2D IsoDraw format.

3D PROJECT alt

The alt parameter defines if the 3D mode should be exited after the
projection is created in a new IsoDraw 2D document window. Allowed
values are 0 for “creating the projection in a new document followed by
activating the 3D window again” and 1 for “creating the projection in a
new document followed by closing the 3D window”.

3D Project 1

3D Center

The 3D Center command allows you to align all the assemblies of the
drawing such that the coordinate origin is at the center point of all
assemblies.

3D CENTER

3D ZoomExtent

This command is included for compatibility reasons


only. It is not recommended that you use this command
for new development of macros as it may be
discontinued in the future. All features from this
command have been incorporated into the new command
“zoom” found in the Window Menu Chapter.

90 3D Commands
The 3D ZoomExtent command displays the entire drawing on the
screen.

3D ZOOMEXTENT

3D HLRMode

This command is included for compatibility reasons


only. It is not recommended that you use this command
for new development of macros as it may be
discontinued in the future. All features from this
command have been incorporated into the new command
“3D Mode”.

This command toggles the view between hidden lines shown and hidden
lines removed.

3D HLRMODE mode

The mode parameter defines if the hidden lines are shown. Allowed values
are 15 for “hidden lines shown” and 16 for “hidden lines removed”.

3D HLRMode 15

3D Mode

This command sets the view mode in the 3D window.

3D Mode mode

The mode parameter defines the view mode displayed. Allowed values are
“wireframe”, “HLR”, “faced” and “shaded”.

3D HLRMode wireframe

3D Explosion

3D Commands 91
The 3D Explosion command gives you the means to automatically
explode the components of a larger assembly unit along a specific axis.

3D EXPLOSION direction 3d-point

The direction parameter defines the axis and the direction you wish to
explode the assemblies. Allowed values are 1 for “direction: positive, axis:
x”, 2 for “direction: both, axis: x”, 3 for “direction: negative, axis: x”, 4 for
“direction: positive, axis: y”, 5 for “direction: both, axis: y”, 6 for “direction:
negative, axis: y”, 7 for “direction: positive, axis: z”, 8 for “direction: both,
axis: z”, 9 for “direction: negative, axis: free”, 10 for “direction: positive,
axis: free”, 11 for “direction: both, axis: z” and 12 for “direction: negative,
axis: free”.

The 3d-point parameter comes to play if the user has selected a “free”
axis for explosion. The 3d-point will define the free-axis as point3.

#exploding along the x-axis (both directions)


3D Explosion 2 0 0 0

#exploding along a free axis (positive


direction)
3D Explosion 10 0.005 0.997 0.077

3D Move

The 3D Move command moves all selected assemblies in a given direction.

3D MOVE 3d-point

The 3d-point parameter defines along which axis the drawing should be
moved as point3.

#movement along the x-axis


3D Move 200 0 0

3D Axis

The 3D Axis command sets the 3D Select axis.

92 3D Commands
3D Axis 3d-point

The 3d-point parameter defines a point through which the axis should
be created. The string “off” may also be used to remove a 3D Select axis.

#Creates a 3D Select axis on the X-Z plane


3D Axis 1 0 1

3D Transform

The 3D Transform command creates a 3D transformation on the


selected assemblies.

3D TRANSFORM 3d-matrix

The 3d-matrix parameter defines the transformation.

#stretching the drawing to double size


#along the y-axis
3D Transform 1 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0

3D Reset

The 3D Reset command removes all 3D transformations from the


selected assemblies.

3D Reset

3D SetDist

The 3D SetDist command sets the focal distance measured in


millimeters (only used in the perspective view).

3D SETDIST value

The value parameter sets the focal distance in mm as float.

3D SetDist 25.5

3D Commands 93
3D Hole rectangle

The 3D Hole rectangle command creates a 3D cut or 3D transparent


rectangle.

3D Hole rectangle point point transparent

The point parameters define the start and end points of the rectangle as
float.

The optional transparent parameter defines the rectangle as


transparent rather than a cut rectangle.

3D Hole rectangle 0 0 200 250 transparent

3D Hole polygon start

The 3D Hole polygon start command begins the definition of a 3D


cut or transparent free shape.

3D Hole polygon start transparent

The optional transparent parameter defines the free shape as


transparent rather than a cut free shape.

Macro Create 3D Cut


# Cuts a rhombus
3D Hole polygon start
3D Hole polygon points (-50) 0 0 50
3D Hole polygon points 50 0 0 (-50)
3D Hole polygon end
End Macro

3D Hole polygon points

The 3D Hole polygon points command defines a point in a 3D cut


or transparent free shape.

3D Hole polygon points point point ...

94 3D Commands
The point parameters define points on the free path as float. Many
points can be listed for a single 3D Hole polygon points command.

3D Hole polygon points (-50) 0 0 50

3D Hole polygon end

The 3D Hole polygon end command ends the definition of a 3D cut


or transparent free shape.

3D Hole polygon end

3D Commands 95
96 3D Commands
Further Macro Commands
This chapter contains additional commands available within the IsoDraw
macro language.

FWrite

The fwrite command writes a string with a new line character to the
end of a text file. If the file doesn’t exist it will be created.

FWRITE "path" "message"

The message parameter defines the message written into the file defined
by the path parameter.

define txtOut as string


txtOut = "D:\work\output.txt"
fwrite txtOut "Results:"

FNew

The fnew command creates a new text file with the name a location
specified. If the file already exists it will be overwritten.

FNEW "path" 8_bit

The 8_bit optional parameter defines that the file will be created as a 8-
Bit ASCII text file. By default the file is created as a UNICODE text file.

define txtOut as string


txtout = "C:\Temp\test.txt"
FNEW txtout
FWrite txtout "Hello World!"

Log

Within the IsoDraw working folder you can find a file named “macro.log”.
All errors and warnings which occur during the execution of a macro are
written into that file by the IsoDraw Macro Language. With the command
log you can write your own messages into the file.

Further Macro Commands 97


LOG "message"

The message parameter defines the message which is written into the
macro.log file.

log "Demo finished"

#this also works


for i=0 to 10
log i
end for

Menu

The menu command simulates the selection of an IsoDraw menu item. If


a dialog is opened by the selection it will appear and pause the macro until
closed by the user.

MENU "path" with_Shift with_Alt

The command searches for the first menu command beginning with the
complete search-string. Because menu commands differ from language
to language all macros using the menu command are language specific.

The menu command can be used to start a plugin (like IsoCompose) and
can also reach all commands from the popup menus.

You can not use the menu command to open any item from the help-
menu and you only have access to menu commands that are available at
the time the command is executed.

MENU "element info"

MENU "Start IsoCompose"

The menu comand might be extended by either one of the 2 optional


specifiers with_Shift or with_Alt to simulate a pressed Shift- or
Alt-key.

98 Further Macro Commands


Debugging Commands

Debug Step

The debug step command turns the step-by-step execution of a macro


command on or off.

DEBUG STEP on

DEBUG STEP off

macro debug
debug step on
#first create a line by a macro command
create line 100 100 200 100
#second append line segments
append line segment 200 200
append line segment 100 100
append line segment 100 200
append line segment 200 200
append line segment 150 250
append line segment 100 200
append line segment 200 100
debug step off
end macro

Debug Commands

The debug commands command allows the interactive entry of macro


commands through an input window. You can write an IsoDraw macro
Command into that input field and execute it by hitting the "ok" button.
You can leave the interactive command mode by pressing the "cancel"
button or by pressing the "ok" button with an empty input field.

DEBUG COMMANDS

Further Macro Commands 99


Debug Reset

The debug reset command termintates the execution of the current


macro, discards all variables and reloads all available macros.

DEBUG RESET

Debug Stack

The debug stack command opens a window listing the “call stack” of
.nested sub-macros.

DEBUG STACK

Debug Locals

The debug locals command opens a window listing all defined local
variables.

DEBUG LOCALS

Debug Globals

The debug globals command opens a window listing all defined global
variables.

DEBUG GLOBALS

Wait Timer

With the wait timer command you can stop the application for a given
time period. The current window will be redrawn beforehand.

WAIT TIMER ticks

The ticks parameter defines how long the application will be stopped as
an integer. One tick is 1/60 of a second.

100 Further Macro Commands


macro movement
define i as integer
define n as integer
for i = 0 to 90 step 15
create ellipse 100 200 20 180 i
create ellipse 100 200 20 90 i
end for
select all
group selection
for n=2 to 400 step 5
wait timer 1
move selection 5 1
end for
end macro

Further Macro Commands 101


Extension

With the extension command you can execute a plug-in extension


with a command line.

EXTENSION "name" "param"

The name parameter defines the filename of the extension plug-in as


string. Most likely you will use the file name extension ISP here.

The param parameter defines the command line parameters for the
plugin as string.

Please find below a sample with double-quote syntax. The target format
is SVG in this case. Note that the source and the destination folders must
exist and check the name of the batch tool in the extensions folder.

In this sample the backslash character is used for the Line Continuation.

Extension "batch6_e.isp" "-f22 " + \


"-s""C:\tmp\batch_in"" "+ \
"-d""C:\tmp\batch_out"""

Next, we have a sample with mixed quote characters. The target format is
CGM . We call a macro ‘rotate90’ on each illustration.

Extension "batch6.isp" '-s"D:\TEMP\batch\in"' \


+ ' -d"D:\TEMP\batch\out" -f10 -m"rotata90"'

102 Further Macro Commands


In the next sample we have defined the parameters for the batch tool as
string variables. This helps to avoid confusion with the quotes.

Define sPlugin As String


Define sSourceDir As String
Define sDestDir As String
Define sParam As String
Define sFormat As String

# set the name of the BatchTool


sPlugin = 'batch6_e.isp'

# set the parameter for the source folder


sSource = ' -s"d:\temp\batchin"'

# set the parameter for the destination folder


sDest = ' -d"d:\temp\batchout"'

# set the parameter for the export format


# (10 : CGM)
sFormat = '-f10'

# build the parameter string for the BatchTool


sParam = sFormat + sSource + sDest

# call the BatchTool with the paramter string


Extension sPlugIn sParam

If no file format code is specified IsoDraw will use its standard format.

Extension sPlugIn "-s" + sSourceDir + " -d" \


+ sTargetDir + " - m" + sMacroName

Further Macro Commands 103


For your convenience you will find a list of the format identifiers

# Allowed format identifiers are:


#
# 0 Standard IsoDraw format, currently IsoDraw 6
# 1 IsoDraw 4 format
# 2 IsoDraw 3 format
# 3 IsoDraw 2.6 format(not supported On Windows)
# 4 Encapsulated PostScript File format
# 5 Adobe Illustrator 1.1 format
# 6 Adobe Illustrator 88 format
# 7 Initial Graphics Exchange Standard format
# 8 Drawing Exchange Format
# 9 Hewlett Packard Graphics Language
# 10 Computer Graphics Metafile
# 11 PICTure format
# 12 Tagged Image File Format
# 13 Bitmap format
# 14 PCX format
# 15 CALS Raster
# 16 Text Excerpt
# 17 Interleaf format
# 18 Maker Interchange Format
# 19 IsoDraw 5 format
# 20 IsoDraw 5 format, packed
# 21 DWG (AutoCAD format)
# 22 Scalable Vector Graphics
# 23 JPEG format
# 24 Portable Network Graphic format
# 25 Windows Metafile format
# 26 IsoDraw 6 format
# 27 IsoDraw 6 format, packed

Increase Text Elements

With the increase text elements command you can increase the
numeric values within selected text elements and callouts by the value
specified.

INCREASE TEXT ELEMENTS value

The value parameter defines the numeric increase as integer.

104 Further Macro Commands


Increase Text Elements 5

Decrease Text Elements

With the decrease text elements command you can decrease the
numeric values within selected text elements and callouts by the value
specified.

DECREASE TEXT ELEMENTS value

The value parameter defines the numeric decrease as integer.

Decrease Text Elements 1

Further Macro Commands 105


106 Further Macro Commands
Interacting with the User
This chapter contains commands enabling the macro to interact with a
user.

Message

The message command prints a message box on the screen.

MESSAGE "text"

The text parameter defines the message which is shown in the message
box.

message "Ready!"

Get

The get command opens a dialog window to get a value from the user.

GET input_type "text"

The input_type parameter defines the input value type. The parameter
may have the following values assigned:

integer
for an integer value

float
for a float value

string
for a string value

boolean
for a boolean value

username = get string "Please enter your name!"

Interacting with the User 103


Wait Mouseclick

The wait mouseclick command stops the execution of a macro until


the user hits a mouse button.

Wait Mouseclick

The Wait MouseClick command returns a MouseEvent.

define myME as MouseEvent

myME = wait mouseClick

The MouseEvent contains information which can be accessed through the


following properties. (It is assumed that myME has already been defined
as a MouseEvent for the following samples):

mouseEvent.click

The click property returns which mouse button has been clicked.
Returning 0 means “no button pressed”, 1 means “left mouse button
pressed” and 2 means “right mouse button pressed”.

message myME.click

mouseEvent.ptPix

The ptPix property returns the mouse position as pixel coordinates


relative to the current active window. The point of origin is the upper left
corner of the active window.

message myME.ptPix.x
message myME.ptPix.y

mouseEvent.ptPixGrid

The ptPixgrid property returns the mouse position as pixel coordinates


depending on element and grid magnetism relative to the current active
window. The point of origin is the upper left corner of the active window.

message myME.ptPixGrid.x
message myME.ptPixGrid.y

104 Interacting with the User


mouseEvent.ptMM

The ptMM property returns the mouse position of the page coordinates in
millimeters. The point of origin is the lower left corner of the active page.

message myME.ptMM.x
message myME.ptMM.y

mouseEvent.ptMMGrid

The ptMM property returns the mouse position, in millimeters of the page
coordinates depending on element and grid magnetism. The point of
origin is the lower left corner of the active page.

message myME.ptMMGrid.x
message myME.ptMMGrid.y

mouseEvent.modifiers

The modifiers property returns which special keys are simultaneously


pressed with a mouse key. Returning 256 means “CRTL-Key”, 512 means
“Shift-Key” and 2048 means “Alt-Key”.

message myME.modifiers

Interacting with the User 105


macro MouseDemo

define me as MouseEvent
define pt as Point
define ms as String

me = Wait MouseClick
if (me.click = 0) then
Message "Aborted"
else
pt = me.ptPix
ms = " at pixel coordinates"
ms = ms + pt.x + "," + pt.y
If (me.click = 1) Then
ms = "Left click" + ms
Else
ms = "Right click" + ms
End if
If (me.modifiers = 512) Then
ms = ms + " with Shift-Key"
End if
If (me.modifiers = 256) Then
ms = ms + " with Ctrl-Key"
End if
If (me.modifiers = 2048) Then
ms = ms + " with Alt-Key"
End if
pt = me.ptMMGrid
Create Text pt.x pt.y ms
End if

End macro

Beep

The beep command returns an audible beep.

Beep

106 Interacting with the User


Functions
Functions are handled as expressions and may contain (in brackets)
additional expressions to evaluate as a single value.

Trigonometric Functions

All trigonometric functions in IsoDraw are degree based.

The following trigonometric functions are defined:

sin(), cos(), tan(), arcsin(), arccos() and


arctan()

Macro waveplot
define i as integer
create line 0 100 0 100
for i=1 to 720
append line segment i*0.82
sin(i)*100+100
end for
create line 0 200 0 200
for i=1 to 720
append line segment i*0.82
cos(i)*100+100
end for
end Macro

Other Mathematical Functions

The following mathematical functions are defined:

sqrt (<source>)
square root

ln (<source>)
natural logarithm

exp (<source>)
exponential function

Functions 107
abs (<source>)
absolute value

macro logplot
define i as integer
for i=1 to 300
create line i 0 i ln(i)*20
end for
end macro

Random Function

The rand() function will return a random number between 0 and the
given argument.
The random generator must be initialized with the command
randomize. With no parameter given the current time initiates the
function; with a parameter given for a repeatable randomized sequence.

macro modernArt
define i as integer
randomize
for i=0 to 100
create line rand(600) rand(420)
rand(600) rand(420)
end for
end macro

String Functions

There are some special string functions in the IsoDraw Macro Language:

eval (<source>)
Evaluates a sting as a mathematical function.

lower (<source>)
Converts the string to lowercase.

upper (<source>)
Converts the string to uppercase.

108 Functions
len (<source>)
Returns the length of a string.

left (<source>,<count>)
Returns the string’s left most characters equal to the count.

right (<source>,<count>)
Returns the string’s right most characters equal to the count.

mid (<source>,<start>,<count>)
Returns the string’s characters from the given start to the right,
equal to the count.

Macro String Characters


define str as string
str = "123456789"
message "the string is: " + str
message "the first three: " + left(str, 3)
message "the last four: " + right(str, 4)
message "the 4th to 6th: " + mid(str, 4, 3)
End Macro

find (<source>,<search>,<start>)
Returns the character position of the search term. Only searches to
the right of the start term.

stripExt (<source>)
Returns the string without an extension.

getExt (<source>)
Returns the string’s extension.

stripFileName (<source>)
Returns the string without the file name (i.e. returns the path).

getFileName (<source>)
Returns the string’s file name and extension (i.e. without the path)

Functions 109
Macro Path, Name and Extension Info
New
Save "C:\Program Files\ITEDO
Software\NameSample.iso"
message "the file's full path is: " +
$Newline + activeDoc.path
message "the file's full name is: " +
$Newline + activeDoc.name
message "the file's name minus extension
is: " + $Newline + stripExt(activeDoc.name)
message "the file's extension is: " +
$Newline + getExt(activeDoc.name)
message "the file's path without its name
is: " + $Newline + stripFileName(activeDoc.path)
End Macro

isAlpha (<source>)
Returns if the string is composed entirely of alpha characters as
boolean.

isDigit (<source>)
Returns if the string is composed entirely of digits as boolean.

isLower (<source>)
Returns if the string is composed entirely of lower case alpha
characters as boolean.

isUpper (<source>)
Returns if the string is composed entirely of upper case alpha
characters as boolean.

isSpace (<source>)
Returns if the string is composed entirely of spaces as boolean.

isAscii (<source>)
Returns if the string consists entirely of characters found in the first
128 from the ASCII character map as boolean.

isControl (<source>)
Returns is the string consists entirely of control characters (such as
TAB) as boolean.

110 Functions
isPrintable (<source>)
Returns is the string consists entirely of printable characters (i.e.
without control characters) as boolean.

isNumerical (<source>)
Returns if the string is numerical as boolean. This differs from
isDigit (e.g. -99.9 is not true as isDigit, but is true as isNumberical).

code (<source>)
Returns the first character’s code from the Ascii character map as
integer.

char (<source>)
Returns the character for the character from the Ascii character
map for the given integer value.

macro stringFunctions
define txt as string
txt = "IsoDraw Macro Language"
message txt
message len(txt)
message upper(txt)
message lower(txt)
end macro

Time Functions

There are some special functions in the IsoDraw Macro Language to


determine the time:

date ()
Returns the date as string

time (<seconds>)
Returns the time as string. Use the optional “seconds” parameter to
determine if seconds are given. Enter true to include seconds and false
to exclude them.

Functions 111
ticks ()
Returns the time in ticks as string. There are 60 ticks per second.

message "today is " + date()


message "and the time is " + time(true)

Negation

The not() function is for the logical negation. The result is either true or
false.

if ( not(a < b) ) then


#if a is greater than b
else
#if a is smaller than b
end if

Exists

Returns TRUE if the give expression is true within the context of the macro
and the defined document, layer or element does exist.

exists (expression)

112 Functions
# some examples:

if (exists (activeDoc) = false) then


message "No document opened!"

if (exists (activeDoc.firstSelectedElement) =
false) then
message "No element selected!"

if (exists (activeDoc.layers[3]) = false) then


message "Less than three layers exist!"

if (exists
(activeDoc.layers["Background"].firstChild) =
false) then
message "Background layer is empty!"

if (exists (activeDoc.firstSlectedElement.info)
= false) then
message "The first selected element has no
object info!"

if (exists (app.pens["Thick"]) = false) then


message "Pen ""Thick"" does not exist!"

Macro AddCustomPen
Define penName as String
penName = Get String "Name of your new Pen?"
if (exists (activeDoc.Pens[penName]) =
false) then
Add Pen penName
else
Message "Pen " + penName + " already
exists!"
end if
end Macro

Functions 113
Return

Parameters can be passed down to macros or submacros using a return


function.

SubMacro Fact( Integer n )


#Calculates the factorial "n!"
Define prod as integer
define i as integer
prod = 1
for i = 1 to n
prod = prod*i
end for
return prod
End Submacro

Macro Calculate Factorial


Define n as integer
Define result as integer
n = Get integer "Please enter a small
integer value"
n = abs(n)
result = Run Fact(n)
message n+"! = " + result
end macro

114 Functions
Simple Data Types
The IsoDraw Macro Language provides four different simple data types.

Integers

Integers are whole numbers, like 2, 4 and 357. The range of an integer
extends from (-2,147,483,648) through 2,147,483,647. Negative values
have to be put in brackets.

Floating-Point Numbers

Floating point numbers represent numeric values with decimal digits.


Negative values have to be put in brackets.

Strings

String literals are delimited either with single(’) or double (") quotes in
IsoDraw macros:

'Mo Szyslak'
"Julius Hibbert"

Within a string other type quotes can be used without limitation:

message "hello world: 'part one'"


message 'hello world: "part two"'

Quotes of the same type have to be doubled for not terminating the
string:

string1 = "double quote: "" "


string2 = 'single quote: '' '

Adding one string to another with the ’+’ operator:

Define text as string


text = "con" + 'cat'
message text + "enated"

Simple Data Types 115


Booleans

A boolean represents a "truth value" - it says whether something is true or


not. Truth and falseness determine the outcome of conditional code such
as:

define test as boolean


test = true

if (test = true) then


#do something
else
#do something else
end if

116 Simple Data Types


Complex Data Types
The IsoDraw Macro Language provides several complex data types.

Point

A point owns two float properties which define the x- and y-coordinates
of the point.

define pt_Start as point


pt_Start.x = (-22.99)
pt_Start.y = 123.123

Point3

The point3 type defines a three-dimensional point with its x-, y- and z-
coordinates. These properties are float literals.

define pt3_corner as point3


pt3_corner.x = 332.76
pt3_corner.y = 239
pt3_corner.z = (-45.88)

Rectangle

Rectangle defines a rectangle with its top-left- and bottom-right-corners.


The properties defining the single coordinates are float literals.

define rect_Select as rectangle


rect_Select.top = 252.55
rect_Select.left = 299.297
rect_Select.bottom = 498.348
rect_Select.right = 125.73

RGBColor

An RGBColor owns three properties which are integer literals. These


properties define the values of red, green and blue. In contrast to "normal"
integer literals the RGB-integers can only range from 0 to 255.

Complex Data Types 117


define RGB_red as RGBColor
RGB_red.red = 188
RGB_red.green = 0
RGB_red.blue = 139

CMYKColor

A CMYKColor owns four properties which are floats literals. These


properties define the values of cyan, magenta, yellow and key (or black).
In contrast to "normal" float literals the CMYK-float range is only from 0
to 1.

define CMYK_blue as CMYKColor


CMYK_blue.cyan = 0.99
CMYK_blue.magenta = 0.7
CMYK_blue.yellow = 0.13
CMYK_blue.black = 0.08

ColorSpec

The ColorSpec data type is an either...or data type. This means that the
data type could assume three different states. Depending on the state of
the data type, it owns two or three properties.

The first and only common to all three different states of the ColorSpec
data type is the type property. This property contains the string value
"cmykValues", "rgbValues" or "colorRef".

If the value type is "cmykValues" the ColorSpec data type owns a second
property called cmyk which is a CMYKColor data type.

118 Complex Data Types


#defining a colspec with another variable
define CMYK_blue as CMYKColor
CMYK_blue.cyan = 0.99
CMYK_blue.magenta = 0.7
CMYK_blue.yellow = 0.13
CMYK_blue.black = 0.08

define color_blue as ColorSpec


color_blue.type = "cmykValues"
color_blue.cmyk = CMYK_blue

Add color "NewBlue" color_blue

If the value type is "rgbValues" the ColorSpec data type owns a second
property called rgb which is an RGBColor data type.

#defining a colorSpec directly


define color_red as ColorSpec
color_red.type = "rgbValues"
color_red.rgb.red = 188
color_red.rgb.green = 0
color_red.rgb.blue = 29

If the value type is "colorRef" the ColorSpec data type owns another two
properties. One is a string and called color and one is a float and called
tone. The color property contains the name of the color the data type is
referencing. Every color defined in IsoDraw is allowed. The tone property
defines the modification of intensity as a float (0 to 1) of the color defined
by the color property.

define grey25 as ColorSpec


grey25.type = "colorRef"
grey25.color = "$ISO_BLACK"
grey25.tone = 0.25

Fill

The fill data type owns four properties. The first one is a string which
defines the type of the fill. The allowed values for type are "no_fill",
"hatching", "pattern" and "color".

Complex Data Types 119


define myFill as fill

myFill.type = "pattern"

The second property is a ColorSpec called colSpec. (see ColorSpec


description for more details)

myFill.colSpec.rgb.blue = 29

The third property defines the hatching used. Values allowed for this
property are the names of all existing hatchings as string.

myFill.hatching = "Aluminium"

The fourth property is used for defining the type of pattern. Allowed
values for that property are the names of all existing patterns as string.

myFill.pattern = "25% Grey"

Mouse Event

The mouse event returns information about the mouse behavior of the
user, e.g. which mouse button has been clicked. (see Wait Mouseclick for
more details)

define myME as MouseEvent


myME = Wait MouseClick

Document or ActiveDoc - The Document Object

The Document Data Type is a reference on an existing document in


IsoDraw.

define myDoc as document


myDoc = new

The ActiveDoc object is a reference on the current active document in


IsoDraw.

120 Complex Data Types


#both examples change the name of the active
#document

define doc_01 as document


doc_01 = activeDoc
doc_01.name = "a new document"

#or
activeDoc.name = "a new document"

It is assumed that myDoc has already been defined as a document and set
as the activeDoc for the following samples.

document.name

Returns and sets the name of the document as string.

myDoc.name = "myNewDocument"

document.path

Returns and sets the path of the document as string.

myDoc.path = "c:\temp\doc_01.iso"

document.penCount

Returns the number of the pens as integer. This property is read only.

message myDoc.penCount

document.active_Pen

Returns and sets the name of the active pen as string.

myDoc.active_pen = "Thick"

document.styleCount

Returns the number of the styles as integer. This property is read only.

message myDoc.styleCount

Complex Data Types 121


document.active_style

Returns and sets the name of the active styles as string.

myDoc.active_style = "Solid"

document.shadowCount

Returns the number of shadows as integer. This property is read only.

message myDoc.shadowCount

document.active_shadow

Returns and sets the name of the active shadow as string.

myDoc.active_shadow = "Autom. Short"

document.gridCount

Returns the number of grids as integer. This property is read only.

message myDoc.gridCount

document.active_grid

Returns and sets the name of the active grid as string.

myDoc.active_grid = "Isometric"

document.formatCount

Returns the number of text formats as integer. This property is read only.

message myDoc.formatCount

document.active_textFormat

Returns and sets the name of the active text format as string.

myDoc.active_textFormat = "Normal"

122 Complex Data Types


document.viewportCount

Returns the number of viewports as integer. This property is read only.

message myDoc.viewportCount

document.viewports[ ]

This property gives access to all viewport attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a
document and set as the activeDoc for the following samples.

document.viewports[].name
Returns and sets the viewport name as string.

myDoc.viewports[1].name = "test"

document.viewports[].Id
Returns the viewport ID as string. This property is read only.

message myDoc.viewports[1].Id

document.viewports[].Rectangle
Returns and sets the viewport rectangle as rectangle.

myDoc.viewports[1].rectangle.bottom = 500
myDoc.viewports[1].rectangle.left = 135
myDoc.viewports[1].rectangle.right = 200
myDoc.viewports[1].rectangle.top = 650

document.viewports[].LayerCount
Returns the number of layers in a viewport as integer. This property is read
only.

message myDoc.viewports[1].LayerCount

document.viewports[ ].Layers[]
This property gives access to layer attributes within a viewport but it can
not be used directly. It is assumed that myDoc has already been defined
as a document and set as the activeDoc for the following samples.

document.viewports[].Layer[].Name
Returns and sets the name of a layer within a viewport as string.

Complex Data Types 123


myDoc.viewports[1].Layers[1].Name = "Lyr1"

document.viewports[].Layers[].locked
Returns and sets the locked state of a layer within a viewport as boolean.

myDoc.viewports[1].Layers[1].locked = true

document.viewports[].Layers[].protected
Returns and sets the protected state of a layer within a viewport as
boolean.

myDoc.viewports[1].Layers[1].protected = true

document.viewports[].Layers[].active
Returns and sets the active state of a layer within a viewport as boolean.

myDoc.viewports[1].Layers[1].active = true

document.viewports[].Layers[].printable
Returns and sets the printable state of a layer within a viewport as
boolean.

myDoc.viewports[1].Layers[1].printable = true

document.viewports[].Layers[].exportable
Returns and sets the exportable state of a layer within a viewport as
boolean.

myDoc.viewports[1].Layers[1].exportable = true

document.viewports[].Layers[].visible
Returns and sets the visible state of a layer within a viewport as boolean.

myDoc.viewports[1].Layers[1].visible = true

document.viewports[].Layers[].useColor
Returns and sets the use of color property of a layer within a viewport as
boolean.

myDoc.viewports[1].Layers[1].useColor = true

document.calloutCount

124 Complex Data Types


Returns the number of callout styles as integer. This property is read only.

message myDoc.calloutCount

document.active_callout

Returns and sets the name of the active callout style as string.

myDoc.active_calloutstyle = "Normal"

document.layerCount

Returns the number of layers of the document as integer.

message myDoc.layerCount

document.layers[ ]

Gives access to all layer attributes but can not be reached directly. (see
Layer - The Layer Object for more details)

myDoc.layers[1].name = "myLayer"

document.selectedElements

Returns the number of selected elements of the document as integer.

message myDoc.selectedElements

document.firstSelectedElement

This property returns the first selected element of a selection as element.


To get the next element of a selection use element.nextSelectedElement.

Complex Data Types 125


Macro ListElementSelection
Define el as Element
Define m as String
el = activeDoc.firstSelectedElement
If (exists(el ) = false) then
Message "Select some Elements,
please!"
Else
m = "Type(s) of selected Elements: " +
el.type
el = el.nextSelectedElement
While (exists(el ) = true)
m = m + ", " + el.type
el = el.nextSelectedElement
End While
Message m + "."
End If
End Macro

document.selectedParts

Returns the number of selected parts of the document as integer.

message myDoc.selectedParts

document.modified

Returns if the document was modified as boolean. (returns 0 if the


document is not modified, 1 if it has been modified)

message myDoc.modified

document.grid

This property gives access to all grid attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a
document and set as the activeDoc for the following samples.

document.grid.gridSize
Returns and sets the grid size property as float.

myDoc.grid.gridSize = 20

document.grid.radius

126 Complex Data Types


Returns and sets the magnetic radius property as float.

myDoc.grid.radius = 5

document.grid.elementMagnet
Returns and sets the magnetic elements property as boolean.

myDoc.grid.elementMagnet = true

document.grid.gridMagnet
Returns and sets the magnetic grid points property as boolean.

myDoc.grid.gridMagnet = true

document.grid.showGrid
Returns and sets the show grid property as boolean.

myDoc.grid.showGrid = true

document.grid.showDim
Returns and sets the show dimensions property as boolean.

myDoc.grid.showDim = true

document.grid.constrain
Returns and sets the align to grid property as boolean.

myDoc.grid.constrain = true

document.grid.gridInFront
Returns and sets the grid in front property as boolean.

myDoc.grid.gridInFront = true

document.grid.noFShortInIso
Returns and sets the no isometric foreshortening property as boolean.

myDoc.grid.noFShortInIso = true

document.grid.gridColor
Returns and sets the color property as RGBColor.

myDoc.grid.gridColor.red = 50
myDoc.grid.gridColor.green = 150

Complex Data Types 127


myDoc.grid.gridColor.blue = 50

document.grid.firstSelColor
Returns and sets the first color property as RGBColor.

myDoc.grid.firstSelColor.red = 10
myDoc.grid.firstSelColor.green = 160
myDoc.grid.firstSelColor.blue = 140

document.grid.secondSelColor
Returns and sets the second color property as RGBColor.

myDoc.grid.secondSelColor.red = 75
myDoc.grid.secondSelColor.green = 30
myDoc.grid.secondSelColor.blue = 85

document.window

This property gives access to all window attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a document
and set as the activeDoc for the following samples.

document.window.pageX
Returns and sets the window x-cords property as float.

myDoc.window.pageX = 200

document.window.pageY
Returns and sets the window y-cords property as float.

myDoc.window.pageY = 300

document.window.overlapX
Returns and sets the print overlap x-cords property as float.

myDoc.window.overlapX = 10

document.window.overlapY
Returns and sets the print overlap y-cords property as float.

myDoc.window.overlapY = 10

document.window.scale

128 Complex Data Types


This command is included for compatibility reasons
only. It is not recommended that you use this command
for new development of macros as it may be
discontinued in the future. All features from this
command have been incorporated into the new command
“zoom” found in the Window Menu chapter.

Returns and sets the window view size (zoom) property as float.

myDoc.window.scale = 10

document.window.dimScale
Returns and sets the dimension scaling property as float.

myDoc.window.dimScale = 3

document.window.preview
Returns and sets the objects preview property as integer. The allowed
values are:

0 “no preview”
1 “a preview”
2 “visible hotspots”
4 “visible objects”

Add values to combine properties.

myDoc.window.preview = 6

document.window.is3D
Returns the 3D property as boolean. This property is read only.

message myDoc.window.is3D

document.window.curSystem
Returns and sets the current unit system property as string. Allowed
values are "mm", "in" and "pt".

myDoc.window.curSystem = "mm"

document.shadow

Complex Data Types 129


This property gives access to all shadow attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a document
and set as the activeDoc for the following samples.

document.shadow.shadowWidth
Returns and sets the shadow width property as float.

myDoc.shadow.shadowWidth = 5

document.shadow.shadowFactor
Returns and sets the shadow factor property as float.

myDoc.shadow.shadowFactor = 2

document.thread

This property gives access to all thread attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a document
and set as the activeDoc for the following samples.

document.thread.inner.upTo1
Returns and sets the first "inner thread up to" property as float.

myDoc.thread.inner.upTo1 = 20

document.thread.inner.upTo2
Returns and sets the second "inner thread up to" property as float.

myDoc.thread.inner.upTo2 = 40

document.thread.inner.size1
Returns and sets the first inner thread distance property as float.

myDoc.thread.inner.size1 = 2.5

document.thread.inner.size2
Returns and sets the second inner thread distance property as float.

myDoc.thread.inner.size2 = 4

document.thread.inner.size3
Returns and sets the third inner thread distance property as float.

130 Complex Data Types


myDoc.thread.inner.size3 = 5.5

document.thread.outer.upTo1
Returns and sets the first "outer thread up to" property as float.

myDoc.thread.outer.upTo1 = 20

document.thread.outer.upTo2
Returns and sets the second "outer thread up to" property as float.

myDoc.thread.outer.upTo2 = 40

document.thread.outer.size1
Returns and sets the first outer thread distance property as float.

myDoc.thread.outer.size1 = 2.5

document.thread.outer.size2
Returns and sets the second outer thread distance property as float.

myDoc.thread.outer.size2 = 4

document.thread.outer.size3
Returns and sets the third outer thread distance property as float.

myDoc.thread.outer.size3 = 5.5

document.thickthin

This property gives access to all thick/thin attributes but it can not be used
directly. It is assumed that myDoc has already been defined as a document
and set as the activeDoc for the following samples.

document.thickthin.useThickThin
Returns and sets the "use thick thin technique" property as boolean.

myDoc.thickthin.useThickThin = true

document.thickthin.thickPen
Returns and sets the thick pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thickPen = "Thick"

Complex Data Types 131


document.thickthin.thinPen
Returns and sets the thin pen property as string. The name of every exiting
pen is an allowed value.

myDoc.thickthin.thinPen = "Thin"

document.thickthin.useEllipsePens
Returns and sets the "specify pens for ellipses and threads" property as
boolean.

myDoc.thickthin.useEllipsePens = true

document.thickthin.thick1
Returns and sets the first thick pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thick1 = "Thick"

document.thickthin.thin1
Returns and sets the first thin pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thin1 = "Thin"

document.thickthin.thick2
Returns and sets the second thick pen property as string. The name of
every exiting pen is an allowed value.

myDoc.thickthin.thick2 = "Thick"

document.thickthin.thin2
Returns and sets the second thin pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thin2 = "Thin"

document.thickthin.thick3
Returns and sets the third thick pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thick3 = "Thick"

document.thickthin.thin3

132 Complex Data Types


Returns and sets the third thin pen property as string. The name of every
exiting pen is an allowed value.

myDoc.thickthin.thin3 = "Thin"

document.thickthin.upto1
Returns and sets the first up to property as float.

myDoc.thickthin.upto1 = 20

document.thickthin.upto2
Returns and sets the second up to property as float.

myDoc.thickthin.upto2 = 40

document.background

This property gives access to all background attributes but it can not be
used directly. It is assumed that myDoc has already been defined as a
document and set as the activeDoc for the following samples.

document.background.inColor
Returns and sets the “in color” property as boolean.

myDoc.background.inColor = true

document.background.intensity
Returns and sets the intensity property as float. The property range is from
0 to 100.

myDoc.background.intensity = 50

document.background.color
Returns and sets the screen color property as RGBColor.

myDoc.background.color = "{RGB 50 80 120}"

document.lineOptions

This property gives access to all line option attributes but it can not be
used directly. It is assumed that myDoc has already been defined as a
document and set as the activeDoc for the following samples.

Complex Data Types 133


document.lineOptions.lineCap
Returns and sets the line cap ends property as integer. Allowed values are
0 for “flat”, 1 for “round” and 2 for “square”.

myDoc.lineOptions.lineCap = 1

document.lineOptions.lineJoin
Returns and sets the line option corners property as integer. Allowed
values are 0 for “mitered”, 1 for “rounded” and 2 for “bevel”.

myDoc.lineOptions.lineJoin = 2

document.lineOptions.miterLimit
Returns and sets the miter limit property as integer.

myDoc.lineOptions.miterLimit = 4

document.lineOptions.overPrint
Returns and sets the overprint property as integer. Allowed values are 0
for “none”, 1 for “stroke”, 2 for “fill” and 3 for “stroke and fill”.

myDoc.lineOptions.overPrint = 2

document.simpleEllipsePrinting

This property sets and returns the simple ellipse printing as boolean.

myDoc.simpleEllipsePrinting = true

document.colorCount

Returns the number of colors as integer. This property is read only.

message myDoc.colorCount

document.hatchingCount

Returns the number of hatchings as integer. This property is read only.

message myDoc.hatchingCount

document.patternCount

134 Complex Data Types


Returns the number of patterns as integer. This property is read only.

message myDoc.patternCount

Element - The Element Object

An element is something you have created in IsoDraw, for example an


ellipse or a line.

define myElem as element


myElem = create line 10 10 100 10

All create commands (ellipse, line, rectangle ...) return a reference on the
created element. The properties of this element object can be queried and
set.

Macro Change Segment Pens

define myElem as element


myElem = create line 10 10 100 100
append line segment 100 10
append line segment 10 10

myElem.line.segments[1].pen = "Thick"
myElem.line.segments[2].pen = "Medium"
myElem.line.segments[3].pen = "Thin"

End Macro

It is assumed that myElem has already been defined as an element for the
following samples.

element.element_id

Returns and sets the element’s internal id as integer.

message myElem.element_id

element.type

Returns the element type as string. Allowed values are:

Complex Data Types 135


"Line"
"Rectangle"
"Polygon"
"Marker"
"Ellipse"
"Inner_thread"
"Outer_thread"
"Bezier"
"Text"
"Placed_file"
"Image"
"Callout"

This property is read only.

message myElem.type

element.locked

Returns and sets the locked state of the element as integer. Allowed values
are 0 for “unlocked” and 1 for “locked”.

myElem.locked = 0

element.mask

Returns the masked state of the element as boolean. This property is read
only.

message myElem.mask

element.box

Returns the element box as rectangle. This property is read only.

message myElem.box.top
message myElem.box.left
message myElem.box.bottom
message myElem.box.right

element.firstChild

136 Complex Data Types


This will return the first element located within a group. The returned data
type is element. This property is read only.

element.lastChild

This will return the last element located within a group. The returned data
type is element. This property is read only.

element.previousSibling

This will return the previous element located within a group or on a layer.
The returned data type is element. This property is read only.

Complex Data Types 137


element.nextSibling

This will return the next element located within a group or on a layer. The
returned data type is element. This property is read only.

138 Complex Data Types


macro ElementChildAndSibling
define i as integer
define n as integer
define k as integer
define m as integer
define ele1 as element
define ele2 as element
define ele3 as element
define lay as layer

for i = activeDoc.layerCount to 1 step -1


message "processing layer " +
activeDoc.layers[i].name
ele1 = activeDoc.layers[i].firstChild
n = 1
while (exists(ele1) = true)
message "The " + n + " element of
this layer is a " + ele1.type
n = n + 1
ele2 = ele1.firstChild
k = 1
while (exists(ele2) = true)
message "The " + k + "
element of this group is a " + ele2.type
ele3 = ele2.firstChild
m = 1
while (exists(ele3) = true)
message "The " + m + "
element of this subgroup is a " + ele3.type
ele3 = ele3.nextSibling
m = m + 1
end while
ele2 = ele2.nextSibling
k = k + 1
end while
ele1 = ele1.nextSibling
end while
end for
end macro

element.parent

Complex Data Types 139


Returns the parent of an element as element.

element.layer

Returns the layer which the element is located on as layer. This property
is read only.

macro getLayerName
define el as element
select all
el = activeDoc.firstSelectedElement
message el.layer.name
end macro

element.selected

Returns the selected state of the element as integer. This property is read
only. 0 means “not selected” and 1 means “selected”.

message myElem.selected

element.nextSelectedElement

This property returns the next selected element of a selection as element.


To get the first element of a selection use document.firstSelectedElement.

Macro MakeHotspots
Define el as Element
Select if Type is equal to "Text"
el = activeDoc.firstSelectedElement
while (Exists (el) = true )
Create Object_Info el
el.info.hotspot = "region"
el = el.nextSelectedElement
end while
End Macro

element.lineCap

Returns and sets the ends property of the element as integer. Allowed
values are 0 for “flat”, 1 for “round” and 2 for “square”.

myElem.lineCap = 1

140 Complex Data Types


element.lineJoin

Returns and sets the corners property of the element as integer. Allowed
values are 0 for “mitered”, 1 for “rounded” and 2 for “bevel”.

myElem.lineJoin = 2

element.miterLimit

Returns and sets the miter limit property of the element as integer.

myElem.miterLimit = 4

element.overPrint

Returns and sets the overprint property of the element as integer. Allowed
values are 0 for “none”, 1 for “stroke”, 2 for “fill” and 3 for “stroke and fill”.

myElem.overPrint = 2

element.segmentCount

Returns the number of the segments of the element as integer. This


property is read only.

message myElem.segmentcount

element.fill

Returns and sets the filling of the element as Fill.

myElem.fill.colSpec.rgb.red = 200
myElem.fill.colSpec.rgb.green = 60
myElem.fill.colSpec.rgb.blue = 120

element.group.childCount

Returns the number of elements within a group as integer. This property


is read only.

message myElem.group.childCount

element.document

Complex Data Types 141


With element.document you can modify the properties of a placed
element.

define myElem as element


myElem = place

message myElem.document.destinationRect.top

element.document.startPoint
Returns and sets the start point parameter as point.

myElem.document.startPoint.x = 58.84

element.document.destinationRect
Returns the destination rectangle parameter as rect. This property is read
only.

message myElem.document.destinationRect.bottom

element.document.file_name
Returns the file name of the placed document as string. This property is
read only.

message myElem.document.file_name

element.document.path
Returns the path of the placed document as string. This property is read
only.

message myElem.document.path

element.document.update_mode
Returns and sets the update mode of the placed document as integer.
Allowed values are 1 for “auto”, 2 for “notify” and 3 for “none”.

myElem.document.update_mode = 1

element.document.include_file
Returns and sets if the placed file should be included in the document as
integer. Allowed values are 0 for "do not include" and 2 for "include file"

myElem.document.include_file = 0

element.info

142 Complex Data Types


With element.info you can modify the properties of the object info of
the element.

message myElem.info.id

element.info.type
Returns and sets the type of the object info as string.

message myElem.info.type

element.info.id
Returns and sets the object id as string.

myElem.info.id = "AQ01"

element.info.name
Returns and sets the object name as string.

myElem.info.name = "TI"

element.info.tip
Returns and sets the object tip as string.

myElem.info.tip = "hi"

element.info.hotspot
Returns and sets the object hotspot as string. Allowed string values are
“none”, “line” and “region”

myElem.info.hotspot = "region"

element.info.attrCount
Returns the number of attributes of the object as integer. This property is
read only.

message myElem.info.attrCount

element.info.attributes[ ]

This property gives access to object attributes but can not be used directly.
It is assumed that myElem has already been defined as an element for the
following samples

Complex Data Types 143


element.info.attributes[ ].type
Returns and sets the type of one object attribute as string. Allowed string
values are "String", "Float", "Integer" and "Link".

myElem.info.attributes[1].type = "Integer"

element.info.attributes[ ].name
Returns and sets the name of one object attribute as string.

myElem.info.attributes[1].name = "IsoDraw"

element.info.attributes[ ].value
Returns and sets the value of one object attribute. Depending on what
type the attribute is defined (see element.info.attributes[ ].type) the values
of this property could be integer, float or string.

myElem.info.attributes[1].value = "Integer"

element.info.view_context

This property gives access to all view context attributes but can not be
used directly. It is assumed that myElem has already been defined as an
element for the following samples

element.info.view_context.type
Returns and sets the type of the view context as string. Possible values are
"none", "extent" and "size".

myElem.info.view_context.type = "none"

element.info.view_context.rectangle
If the view context “size” is used, this property must also be used to return
and set the size of the view context as rectangle.

myElem.info.view_context.rectangle.top = 500.89
myElem.info.view_context.rectangle.left = 200
myElem.info.view_context.rectangle.bottom =
300.54
myElem.info.view_context.rectangle.right =
350.34

element.line

144 Complex Data Types


This property gives access to all line attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.line.startPoint
Returns and sets the start point of the line as point.

myElem.line.startPoint.x = 107.55
myElem.line.startPoint.y = 157.39

element.line.segments[ ].selected
Returns the selected state of one line segment as integer. This property is
read only. 0 means “not selected” and 1 means “selected”.

message myElem.line.segments[1].selected

element.line.segments[ ].endPoint
Returns and sets the end point of one line segment as point.

myElem.line.segments[1].endPoint.x = 188.66
myElem.line.segments[1].endPoint.y = 256.66

element.line.segments[ ].pen
Returns and sets the pen of one line segment as string. Any existing pen
is allowed.

myElem.line.segments[1].pen = "Thick"

element.line.segments[ ].style
Returns and sets the style of one line segment as string. Any existing style
is allowed.

myElem.line.segments[1].style = "Solid"

element.line.segments[ ].shadow
Returns and sets the shadow of one line segment as string. Any existing
shadow is allowed.

myElem.line.segments[1].shadow = "Autom. Long"

element.ellipse

Complex Data Types 145


This property gives access to all ellipse attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.ellipse.centerPoint
Returns and sets the center point of the ellipse as point.

myElem.ellipse.centerPoint.x = 58.76
myElem.ellipse.centerPoint.y = 12.45

element.ellipse.angle
Returns and sets the angle of the ellipse as float.

myElem.ellipse.angle = 45

element.ellipse.value
Returns and sets the value of the ellipse as float.

myElem.ellipse.value = 90

element.ellipse.radius
Returns and sets the radius of the ellipse as float.

myElem.ellipse.radius = 500

element.ellipse.segments[ ].selected
Returns the selected state of one ellipse segment as integer. This property
is read only. 0 means “not selected” and 1 means “selected”.

message myElem.ellipse.segments[1].selected

element.ellipse.segments[ ].startAngle
Returns and sets the start angle of one ellipse segment as float.

myElem.ellipse.segments[1].startAngle = 35.7

element.ellipse.segments[ ].endAngle
Returns and sets the end angle of one ellipse segment as float.

myElem.ellipse.segments[1].endAngle = 35.7

element.ellipse.segments[ ].pen
Returns and sets the pen of one ellipse segment as string. Any existing pen
is allowed.

146 Complex Data Types


myElem.ellipse.segments[1].pen = "Thick"

element.ellipse.segments[ ].style
Returns and sets the style of the ellipse segment as string. Any existing
style is allowed.

myElem.ellipse.segments[1].style = "Solid"

element.ellipse.segments[ ].shadow
Returns and sets the shadow of one ellipse segment as string. Any existing
shadow is allowed.

myElem.ellipse.segments[1].shadow = "Autom.
Long"

element.innerthread

This property gives access to all inner threads attributes but it can not be
used directly. It is assumed that myElem has already been defined as an
element for the following samples

element.innerthread.centerPoint
Returns and sets the center point of the inner thread as point.

myElem.innerthread.centerPoint.x = 134.56
myElem.innerthread.centerPoint.y = 12.45

element.innerthread.angle
Returns and sets the angle of the inner thread as float.

myElem.innerthread.angle = 45

element.innerthread.value
Returns and sets the value of the inner thread as float.

myElem.innerthread.value = 90

element.innerthread.radius
Returns and sets the radius of the inner thread as float.

myElem.innerthread.radius = 500

element.innerthread.segments[ ].selected

Complex Data Types 147


Returns the selected state of one inner thread segment as integer. This
property is read only. 0 means “not selected” and 1 means “selected”.

message myElem.innerthread.segments[1].selected

element.innerthread.segments[ ].startAngle
Returns and sets the start angle of one inner thread segment as float.

myElem.innerthread.segments[1].startAngle =
35.7

element.innerthread.segments[ ].endAngle
Returns and sets the end angle of one inner thread segment as float.

myElem.innerthread.segments[1].endAngle = 35.7

element.innerthread.segments[ ].pen
Returns and sets the pen of one inner thread segment as string. Any
existing pen is allowed.

myElem.innerthread.segments[1].pen = "Thick"

element.innerthread.segments[ ].style
Returns and sets the style of one inner thread segment as string. Any
existing style is allowed.

myElem.innerthread.segments[1].style = "Solid"

element.innerthread.segments[ ].shadow
Returns and sets the shadow of one inner thread segment as string. Any
existing shadow is allowed.

myElem.innerthread.segments[1].shadow = "Autom.
Long"

element.outerthread

This property gives access to all outer threads attributes but it can not be
used directly. It is assumed that myElem has already been defined as an
element for the following samples

element.outerthread.centerPoint
Returns and sets the center point of the outer thread as point.

148 Complex Data Types


myElem.outerthread.centerPoint.x = 150.75
myElem.outerthread.centerPoint.y = 180

element.outerthread.angle
Returns and sets the angle of the outer thread as float.

myElem.outerthread.angle = 45

element.outerthread.value
Returns and sets the value of the outer thread as float.

myElem.outerthread.value = 90

element.outerthread.radius
Returns and sets the radius of the outer thread as float.

myElem.outerthread.radius = 500

element.outerthread.segments[ ].selected
Returns the selected state of one outer thread segment as integer. This
property is read only. 0 means “not selected” and 1 means “selected”.

message myElem.outerthread.segments[1].selected

element.outerthread.segments[ ].startAngle
Returns and sets the start angle of one outer thread segment as float.

myElem.outerthread.segments[1].startAngle =
35.7

element.outerthread.segments[ ].endAngle
Returns and sets the end angle of one outer thread segment as float.

myElem.outerthread.segments[1].endAngle = 35.7

element.outerthread.segments[ ].pen
Returns and sets the pen of one outer thread segment as string. Any
existing pen is allowed.

myElem.outerthread.segments[1].pen = "Thick"

element.outerthread.segments[ ].style
Returns and sets the style of one outer thread segment as string. Any
existing style is allowed.

Complex Data Types 149


myElem.outerthread.segments[1].style = "Solid"

element.outerthread.segments[ ].shadow
Returns and sets the shadow of one outer thread segment as string. Any
existing shadow is allowed.

myElem.outerthread.segments[1].shadow = "Autom.
Long"

element.callout

This property gives access to all callout attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.callout.style_name
Returns the name of the callout style as string. This property is read only.

message myElem.callout.style_name

element.callout.line_pen
Returns and sets the type of the callout line pen as string. Allowed values
are all existing pen names and "$CS_DEFAULT" for using the value of the
Normal callout style.

message myElem.callout.line_pen

myElem.callout.line_pen = "$CS_DEFAULT"

element.callout.line_style
Returns and sets the type of the callout line style as string. Allowed values
are all existing style names and "$CS_DEFAULT" for using the value of the
Normal callout style.

myElem.callout.line_style = "$CS_DEFAULT"

element.callout.line_shadow
Returns and sets the type of the callout line shadow as string. Allowed
values are all existing shadow names and "$CS_DEFAULT" for using the
value of the Normal callout style.

myElem.callout.line_shadow = "$CS_DEFAULT"

150 Complex Data Types


element.callout.shape_type
Returns and sets the callout shape type as integer. Use $CS_DEFAULT for
the shape type value of the Normal callout style. Allowed values are:

0 "None"
1 "Circle"
2 "Triangle Up"
3 "Triangle Down"
4 "Rectangle"
5 "Pentagon"
6 "Hexagon"

myElem.callout.shape_type = 2

myElem.callout.shape_type = $CS_DEFAULT

element.callout.shape_pen
Returns and sets the callout shape pen as string. Allowed values are all
existing pen names and "$CS_DEFAULT" for using the value of the Normal
callout style.

myElem.callout.shape_pen = "$CS_DEFAULT"

element.callout.shape_style
Returns and sets the callout shape type as string. Allowed values are all
existing line style names and "$CS_DEFAULT" for using the value of the
Normal callout style.

myElem.callout.shape_style = "Solid"

element.callout.shape_shadow
Returns and sets the callout shape shadow as string. Allowed values are
all existing shadow names and "$CS_DEFAULT" for using the value of the
Normal callout style.

myElem.callout.shape_shadow = "no shadow"

element.callout.fill
Returns and sets the fill of the callout shape. Please refer to the section
on defining fills for more information.

myElem.callout.fill.colSpec.type = "ColorRef"
myElem.callout.fill.colSpec.color = "Black"
myElem.callout.fill.colSpec.tone = 0.50

Complex Data Types 151


element.callout.shape_width
Returns and sets the value of the callout shape width as float. Use
$CS_DEFAULT for the shape type value of the Normal callout style.

myElem.callout.shape_width = 2.5

element.callout.shape_height
Returns and sets the value of the callout shape height as float. Use
$CS_DEFAULT for the shape type value of the Normal callout style.

myElem.callout.shape_height = 1.5

element.callout.text_update
Returns and sets the status of the text update width as string. The allowed
values are "none" and "auto" or "$CS_DEFAULT" for the value of the
Normal callout style.

myElem.callout.text_update = "auto"

element.callout.text_position
Returns and sets the type of the text alignment as string. The allowed
values are "aligned" and "centered" or "$CS_DEFAULT" for the value of the
Normal callout style.

myElem.callout.text_position = "centered"

element.callout.text_prefix
Returns and sets the text prefix as string. Use "$CS_DEFAULT" for the value
of the Normal callout style.

myElem.callout.text_prefix = "partNo:"

element.callout.text_postfix
Returns and sets the text postfix as string. Use "$CS_DEFAULT" for the
value of the Normal callout style.

myElem.callout.text_postfix = "_66765"

element.callout.text_gap
Returns and sets the text gap as float. Use $CS_DEFAULT for the value of
the Normal callout style.

myElem.callout.text_gap = 1.5

152 Complex Data Types


element.callout.text_font
Returns and sets the text font of the callout as string. Any installed font
can be used. Use "$CS_DEFAULT" for the value of the Normal callout style.

myElem.callout.text_font = "Arial"

element.callout.text_face
Returns and sets the text face of the callout as string. Allowed values are
"normal", "bold", "italic", "bolditalic" and "$CS_DEFAULT" for the value of
the Normal callout style.

myElem.callout.text_face = "bold"

element.callout.text_size
Returns and sets the text size of the callout as float. Use $CS_DEFAULT for
the value of the Normal callout style.

myElem.callout.text_size = 24.5

element.callout.text_strokecolor
Returns and sets the text stroke color of the callout as ColorSpec.

myElem.callout.text_strokecolor.type =
"rgbValues"

element.callout.text_stroke
Returns and sets the text stroke of the callout as float.

myElem.callout.text_stroke = 2.2

element.callout.text_fillcolor
Returns and sets the color of the fill of the text of the callout as ColorSpec.

myElem.callout.text_fillcolor.type =
"rgbValues"
myElem.callout.text_fillcolor.rgb.red = 168
myElem.callout.text_fillcolor.rgb.green = 201
myElem.callout.text_fillcolor.rgb.blue = 98

element.callout.text_scheme
Returns the text scheme of the callout as string. This property is read only.

message myElem.callout.text_scheme

Complex Data Types 153


element.callout.text_hotspot_flag
Returns and sets if the hotspot flag is set as integer. Allowed values are 0
for "No Hotspot", 1 for "Is Hotspot" and 256 for the value of the callout
style.

myElem.callout.text_hotspot_flag = 256

element.rect

This property gives access to all rectangle attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.rect.startPoint
Returns and sets the start point of the rectangle as point.

myElem.rect.startPoint.x = 107.55
myElem.rect.startPoint.y = 200.89

element.rect.segments[ ].selected
Returns the selected state of one rectangle segment as integer. This
property is read only. 0 means “not selected” and 1 means “selected”.

message myElem.rect.segments[1].selected

element.rect.segments[ ].endPoint
Returns and sets the end point of one rectangle segment as point.

myElem.rect.segments[1].endPoint.x = 388.66
myElem.rect.segments[1].endPoint.y = 388.66

element.rect.segments[ ].pen
Returns and sets the pen of one rectangle segment as string. Any existing
pen is allowed.

myElem.rect.segments[1].pen = "Thick"

element.rect.segments[ ].style
Returns and sets the style of one rectangle segment as string. Any existing
style is allowed.

myElem.rect.segments[1].style = "Solid"

element.rect.segments[ ].shadow

154 Complex Data Types


Returns and sets the shadow of one rectangle segment as string. Any
existing shadow is allowed.

myElem.rect.segments[1].shadow = "Autom. Long"

element.polygon

This property gives access to all polygon attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.polygon.startPoint
Returns and sets the start point of the polygon as point.

myElem.polygon.startPoint.x = 107.55
myElem.polygon.startPoint.y = 107.55

element.polygon.segments[ ].selected
Returns the selected state of one polygon segment as integer. This
property is read only. 0 means “not selected” and 1 means “selected”.

message myElem.polygon.segments[1].selected

element.polygon.segments[ ].endPoint
Returns and sets the end point of one polygon segment as point.

myElem.polygon.segments[1].endPoint.x = 188.66
myElem.polygon.segments[1].endPoint.y = 348.66

element.polygon.segments[ ].pen
Returns and sets the pen of one polygon segment as string. Any existing
pen is allowed.

myElem.polygon.segments[1].pen = "Thick"

element.polygon.segments[ ].style
Returns and sets the style of one polygon segment as string. Any existing
style is allowed.

myElem.polygon.segments[1].style = "Solid"

element.polygon.segments[ ].shadow
Returns and sets the shadow of one polygon segment as string. Any
existing shadow is allowed.

Complex Data Types 155


myElem.polygon.segments[1].shadow = "Autom.
Long"

element.marker

This property gives access to all marker attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.marker.startPoint
Returns and sets the start point of the marker as point.

myElem.marker.startPoint.x = 107.55
myElem.marker.startPoint.y = 237.55

element.marker.segments[ ].endPoint
Returns and sets the end point of one marker segment as point.

myElem.marker.segments[1].endPoint.x = 188.66
myElem.marker.segments[1].endPoint.x = 456.34

element.bezier

This property gives access to all bezier attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.bezier.startPoint
Returns and sets the start point of the bezier curve as point.

myElem.bezier.startPoint.x = 107.55
myElem.bezier.startPoint.x = 237.87

element.bezier.bezFlag
Returns and sets the type of the first bezier curve as integer. 0 means
“curve” and 1 means “corner”.

myElem.bezier.bezFlag = 1

element.bezier.segments[ ].selected
Returns the selected state of one bezier segment as integer. This property
is read only. 0 means “not selected” and 1 means “selected”.

message myElem.bezier.segments[1].selected

156 Complex Data Types


element.bezier.segments[ ].h1Point
Returns and sets the end point of the first bezier segment handle as point.

myElem.bezier.segments[1].h1Point.x = 18.6
myElem.bezier.segments[1].h1Point.y = 18.6

element.bezier.segments[ ].h2Point
Returns and sets the end point of the second bezier segment handle as
point.

myElem.bezier.segments[1].h2Point.x = 32.68
myElem.bezier.segments[1].h2Point.y = 232.67

element.bezier.segments[ ].endPoint
Returns and sets the end point of one bezier segment as point.

myElem.bezier.segments[1].endPoint.x = 129.56
myElem.bezier.segments[1].endPoint.y = 122.53

element.bezier.segment[ ].bezFlag
Returns and sets the type of one bezier segment as integer. 0 means
“curve” and 1 means “corner”.

myElem.bezier.segments[1].bezFlag = 1

element.bezier.segments[ ].pen
Returns and sets the pen of one bezier segment as string. Any existing pen
is allowed.

myElem.bezier.segments[1].pen = "Thick"

element.bezier.segments[ ].style
Returns and sets the style of one bezier segment as string. Any existing
style is allowed.

myElem.bezier.segments[1].style = "Solid"

element.bezier.segments[ ].shadow
Returns and sets the shadow of one bezier segment as string. Any existing
shadow is allowed.

myElem.bezier.segments[1].shadow = "Autom. Long"

element.text

Complex Data Types 157


This property gives access to all text attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.text.startPoint
Returns and sets the start point of a text element as point.

myElem.text.startPoint.x = 122.76
myElem.text.startPoint.y = 131.76

element.text.justHor
Returns and sets the horizontal justification of a text element as integer.
Allowed values are 0 for “left”, 1 for “center” and (-1) for “right”.

myElem.text.justHor = 0

element.text.justVer
Returns and sets the vertical justification of a text element as integer.
Allowed values are 1 for “top”, 2 for “middle”, 3 for “bottom” and 4 for
“baseline”.

myElem.text.justVer = 2

element.text.stroke
Returns and sets the stroke width of a text element as float. You can enter
any size but when you enter -256 you will deactivate the stroke.

myElem.text.stroke = 2

element.text.back_stroke
Returns and sets the stroke width of the background of a text element as
float. You can enter any size but when you enter -256 you will deactivate
the stroke.

myElem.text.back_stroke = 1.5

element.text.backstroke_color
Returns and sets the stroke color of the background of a text element as
ColorSpec.

myElem.text.backstroke_color.type = "rgbValues"
myElem.text.backstroke_color.rgb.red = 188
myElem.text.backstroke_color.rgb.green = 208
myElem.text.backstroke_color.rgb.blue = 168

158 Complex Data Types


element.text.backfill_color
Returns and sets the color of the background of a text element as
ColorSpec.

myElem.text.backfill_color.type = "rgbValues"
myElem.text.backfill_color.rgb.red = 234
myElem.text.backfill_color.rgb.green = 29
myElem.text.backfill_color.rgb.blue = 176

element.text.back_width
Returns and sets the width of the background of a text element as Float.

myElem.text.back_width = 2.2

element.text.back_height
Returns and sets the height of the background of a text element as Float.

myElem.text.back_height = 1.1

element.text.back_shape
Returns and sets the shape of the background of a text element as integer.
Allowed values are 0 for “rectangle” and 1 for “circle”.

myElem.text.back_shape = 1

element.text.back_auto
Returns and sets if the background of a text element is adjusted to the
text as boolean.

myElem.text.back_auto = TRUE

element.text.string
Returns and sets the displayed text of a text element as string.

myElem.text.string = "Hello World"

element.image

This property gives access to all image attributes but it can not be used
directly. It is assumed that myElem has already been defined as an element
for the following samples

element.image.startPoint

Complex Data Types 159


Returns and sets the start point of an image element as point. The start
point is the images lower lefthand corner.

myElem.image.startPoint.x = 122.76
myElem.image.startPoint.y = 131.76

element.image.horResolution
Returns the horizontal resolution of an image element in DPI as float. This
value is Read Only.

message myElem.image.horResolution

element.image.verResolution
Returns the vertical resolution of an image element in DPI as float. This
value is Read Only.

message myElem.image.verResolution

element.image.pixelDepth
Returns the pixel depth of an image element as integer. This value is Read
Only.

message myElem.image.pixelDepth

element.image.kind
Returns the kind of image element selected as string. This value is Read
Only.

message myElem.image.kind

element.image.rowBytes
Returns the image’s horizontal size in bytes as integer. This value is Read
Only.

message myElem.image.rowBytes

element.image.imageWidth
Returns the image’s horizontal size in pixels as integer. This value is Read
Only.

message myElem.image.imageWidth

element.image.imageHeight

160 Complex Data Types


Returns the image’s vertical size in pixels as integer. This value is Read
Only.

message myElem.image.imageHeight

Layer - The Layer Object

The Layer Data Type is a reference on an existing layer in IsoDraw.

define myLyr as layer


myLyr = add layer "extra layer"

All layer commands (add, cut, paste ...) return a reference on the modified
layer. The properties of this layer object can be queried and set.

Macro Add Layer

define myLyr as layer


myLyr = add layer "Engine" 188 0 29
message myLyr.name

myLyr.name = "GearBox"
message myLyr.name

End Macro

It is assumed that myLyr has already been defined as a layer for the
following samples

layer.name

Returns and sets the name of the layer as string.

myLyr.name = "GearBox"
message myLyr.name

layer.screenColor

Returns and sets the screen color of the layer as RGBColor.

myLyr.screenColor.red = 100
myLyr.screenColor.green = 200

Complex Data Types 161


myLyr.screenColor.blue = 175

layer.locked

Returns and sets the locked state of the layer as integer. Allowed values
are 0 for “unlocked” and 1 for “locked”.

myLyr.locked = 0

layer.active

Returns the active state of the layer as boolean. This property is read only.

message myLyr.active

layer.printable

Returns and sets the printable state of the layer as boolean.

myLyr.printable = true

layer.exportable

Returns and sets the exportable state of the layer as boolean.

myLyr.exportable = false

layer.visible

Returns and sets the visible state of the layer as boolean.

myLyr.visible = true

layer.hasElements

Returns if the layer has elements as boolean. This property is read only.

message myLyr.hasElements

layer.useColor

Returns and sets the use of color of the layer as boolean.

162 Complex Data Types


myLyr.useColor = true

layer.firstChild

This will return the first element which is located on the layer. The
returned data type is element. This property is read only.

layer.lastChild

This will return the first element which is located on the layer. The
returned data type is element. This property is read only.

layer.previousSibling

This property will return the previous layer of the layer list. The returned
data type is layer. This property is read only. (see next and previous layer
example)

layer.nextSibling

This property will return the next layer of the layer list. The returned data
type is layer. This property is read only.

next and previous layer example

macro LayerSibling
define i as integer
define theLay as layer
i = activeDoc.layerCount
theLay = activeDoc.layers[i]
while (exists (theLay) = true)
message "Processing layer " +
theLay.name
theLay = theLay.previousSibling
end while
end macro

Preferences (Part I) - The Application Object

Complex Data Types 163


Unlike the other data types the Application Object need not be defined to
be available. Every time you start IsoDraw the Application Object will be
created.

With the Application object you can gain access to nearly all options
available in the IsoDraw preferences.

message "Is Anti-Aliasing on? ->" +


app.useAntiAliasing

if (app.useAntiAliasing = false) then


app.useAntiAliasing = true
message "Now Anti-Aliasing is on"
end if

app.version

This set of properties you will determine the version of IsoDraw the macro
is running on.

message app.version.main + "." + app.version.sub


+ "(" + app.version.build + ")"
#returns: (e.g.) 6.1(2)

app.version.name
This property returns the name of the application. This is read only.

message app.version.name
#returns: (e.g.) IsoDraw 6.1 - US

app.version.main
This returns the “main” version number of IsoDraw as integer. This
property is read only.

app.version.sub
This returns the “sub” version number of IsoDraw as integer. This property
is read only.

app.version.build
This returns the “build” number of IsoDraw as integer. This property is read
only.

app.version.xtra

164 Complex Data Types


This if this version of IsoDraw is a special customer build as integer. This
property is read only.

app.docCount

Returns the number of currently opened documents as integer. This


property is read only.

message app.docCount

app.documents[ ].name

Returns the name of one currently opened document. This property is read
only.

message app.documents[1].name

app.penCount

Returns the number of default pens as integer. This property is read only.

message app.penCount

app.styleCount

Returns the number of default styles as integer. This property is read only.

message app.styleCount

app.shadowCount

Returns the number of default shadows as integer. This property is read


only.

message app.shadowCount

app.GridCount

Returns the number of default grids as integer. This property is read only.

message app.GridCount

Complex Data Types 165


app.colorCount

Returns the number of default colors as integer. This property is read only.

message app.colorCount

app.hatchingCount

Returns the number of hatchings as integer. This property is read only.

message app.hatchingCount

app.patternCount

Returns the number of patterns as integer. This property is read only.

message app.patternCount

app.formatCount

Returns the number of default text formats as integer. This property is


read only.

message app.formatCount

app.calloutCount

Returns the number of default callouts as integer. This property is read


only.

message app.calloutCount

app.password

Returns and sets the password property as string. #USE CAUTION#

app.password = "pumpernickel"

app.drawOffscreen

Returns and sets the draw Objects in background property as boolean.

166 Complex Data Types


app.drawOffscreen = false

app.useAntiAliasing

Returns and sets the use Anti Aliasing property as boolean.

app.useAntiAliasing = true

app.showLineStyles

Returns and sets the show Line Styles in attribute window property as
boolean.

app.showLineStyles = true

app.showToolTips

Returns and sets the show Tool Tips property as boolean.

app.showToolTips = true

app.showRulers

Returns and sets the showRulers property as boolean.

app.showRulers = true

app.showCursorInfo

Returns and sets the showCursorInfo property as boolean.

app.showCursorInfo = true

app.magnetFlags

Returns and sets the magnetFlags property as integer. The allowed values
are:

Complex Data Types 167


1 “Element points”
2 “Intersection points”
3 1 and 2
4 “Points on path”
5 1 and 4
6 2 and 4
7 all

app.magnetFlags = 4

app.selectableFills

Returns and sets the selectableFills property as boolean.

app.selectableFills = true

app.useIsoExtOnMac

Returns and sets the useIsoExtOnMac property as boolean.

app.useIsoExtOnMac = true

app.allowInternet

Returns and sets the allowInternet property as boolean, turning on and


off the automatic check for product updates.

app.allowInternet = true

app.updatePeriod

Returns and sets the updatePeriod property as integer, settingthe


frequency in days of automatic checks for product updates.

app.updatePeriod = 4

app.numberOfUndos

Returns and sets the numberOfUndos property as integer.

app.numberOfUndos = 25

168 Complex Data Types


app.autoSave

Returns and sets the autoSave property as boolean.

app.autoSave = true

app.autoSaveMinutes

Returns and sets the autoSaveMinutes property as float.

app.autoSaveMinutes = 5

app.useEllipsesIn3DTools

Returns and sets the Find elliptical arcs property as boolean. This option
appears as a dialog when using the rotational surfaces or extrusion tool.
It specifies whether elliptical arcs should be modeled as ellipses.

app.useEllipsesIn3DTools = true

app.preview

This property gives access to all preview properties but it can not be used
directly.

app.preview.resolution
Returns and sets the resolution property as float.

app.preview.resolution = 72

app.preview.border
Returns and sets the border width property as float.

app.preview.border = 1

app.preview.width
Returns and sets the fixed width property in mm as float. The value (-1)
disables the fixed width.

app.preview.width = 100

app.preview.kind

Complex Data Types 169


Returns and sets the image depth property as string. The allowed values
are here "bitmap", "grayscale", "color8" and "color24".

app.preview.kind = "color24"

app.preview.compression
Returns and sets the compression property as integer. The allowed values
are:

1 "none"
2 "PackBits"
3 "CCIT Group 3"
4 "CCIT Group 4"
5 "LZW"
6 "LZW2".

app.preview.compression = 2

app.preview.page
Returns and sets the dimension property as integer. The allowed values are
1 for "Extent" and 2 for "Drawing Size".

app.preview.page = 1

app.preview.intelOrder
Returns and sets the byte order property as boolean.

app.preview.intelOrder = true

app.preview.wantsPreview
Returns and sets the generate preview property as boolean.

app.preview.wantsPreview = true

app.compare

This property gives access to all compare attributes but it can not be used
directly.

app.compare.deletedColor
Returns and sets the deleted elements property as RGBColor.

170 Complex Data Types


app.compare.deletedColor.red = 221

app.compare.changedColor
Returns and sets the changed elements property as RGBColor.

app.compare.changedColor.green = 212

app.compare.createdColor
Returns and sets the created elements property as RGBColor.

app.compare.createdColor.blue = 122

app.options3D

This property gives access to all 3D Options attributes but it can not be
used directly.

app.options3D.showDialog
Returns and sets the Show options dialog before converting to 2D
property as boolean.

app.options3D.showDialog = true

app.options3D.renderSmoothAngle
Returns and sets the Max. smoothing angle property as integer. Allowed
values are from 0 to 120.

app.options3D.renderSmoothAngle = 65

app.options3D.objectAccuracy
Returns and sets the Tesselation Accuracy property as integer. Allowed
values are from 0 to 100.

app.options3D.objectAccuracy = 32

app.project3D

This property gives access to all 3D Projection attributes but it can not be
used directly.

app.project3D.asWireframe
Returns and sets the as wireframe attribute as boolean.

Complex Data Types 171


app.project3D.asWireframe = true

app.project3D.useThickThin
Returns and sets the use create thick/thin lines property as boolean.

app.project3D.useThickThin = true

app.project3D.createSurfaceBorders
Returns and sets the use create surface borders property as boolean.

app.project3D.createSurfaceBorders = false

app.project3D.smoothSurfaces
Returns and sets the Thin line threshold property as integer. Allowed
values are from 0 to 100.

app.project3D.smoothSurfaces = 65

app.project3D.thickPen
Returns and sets the for thick lines property as string. Allowed values are
any existing pen name.

app.project3D.thickPen = "$ISO_Thick"

app.project3D.thinPen
Returns and sets the for thin lines property as string. Allowed values are
any existing pen name.

app.project3D.thinPen = "$ISO_Thin"

app.dimensions

This property gives access to all dimension attributes but it can not be
used directly.

app.dimensions.baseOffset
Returns and sets the base offset property as float.

app.dimensions.baseOffset = 2

app.dimensions.extendOffset
Returns and sets the extend offset property as float.

172 Complex Data Types


app.dimensions.extendOffset = 2

app.dimensions.verticalOffset
Returns and sets the vertical offset property as float.

app.dimensions.verticalOffset = 0

app.dimensions.minLength
Returns and sets the minimum length property as float.

app.dimensions.minLength = 5

app.dimensions.decimalPlaces
Returns and sets the decimal places property as integer.

app.dimensions.decimalPlaces = 2

app.dimensions.leaderPen
Returns and sets the leader pen property as string. All existing pens are
allowed.

app.dimensions.leaderPen = "Thick"

app.dimensions.leaderStyle
Returns and sets the leader style property as string. All existing styles are
allowed.

app.dimensions.leaderStyle = "Solid"

app.dimensions.leaderShadow
Returns and sets the leader shadow property as string. All existing
shadows are allowed.

app.dimensions.leaderShadow = "Autom. Long"

app.dimensions.startPen
Returns and sets the start pen property as string. All existing pens are
allowed.

app.dimensions.startPen = "Thick"

app.dimensions.startStyle
Returns and sets the start style property as string. All existing styles are
allowed.

Complex Data Types 173


app.dimensions.startStyle = "Solid"

app.dimensions.startShadow
Returns and sets the start shadow property as string. All existing shadows
are allowed.

app.dimensions.startShadow = "Autom. Long"

app.dimensions.endPen
Returns and sets the end pen property as string. All existing pens are
allowed.

app.dimensions.endPen = "Thick"

app.dimensions.endStyle
Returns and sets the end style property as string. All existing styles are
allowed.

app.dimensions.endStyle = "Solid"

app.dimensions.endShadow
Returns and sets the end shadow property as string. All existing shadows
are allowed.

app.dimensions.endShadow = "Autom. Long"

app.dimensions.stripZeros
Returns and sets the strip zeros property as boolean.

app.dimensions.stripZeros = true

app.dimensions.txtFormat
Returns and sets the text format property as string. All existing text
formats are allowed.

app.dimensions.txtFormat = "Normal"

app.dimensions.txtFont
Returns and sets the text font property as string. All installed fonts are
allowed.

app.dimensions.txtFont = "Arial"

app.dimensions.txtFace

174 Complex Data Types


Returns and sets the text face property as string. Allowed values are
"normal", "bold", "italic" and "bolditalic".

app.dimensions.txtFace = "bold"

app.dimensions.txtSize
Returns and sets the text size property as float.

app.dimensions.txtSize = 24.5

app.dimensions.txtStrokeColor
Returns and sets the text strokecolor property as ColorSpec.

app.dimensions.txtStrokeColor.type =
"cmykValues"

app.dimensions.txtStroke
Returns and sets the text stroke property as float.

app.dimensions.txtStroke = 2.2

app.dimensions.textFillcolor
Returns and sets the text fillcolor property as ColorSpec.

app.dimensions.textFillColor.type = "rgbValues"
app.dimensions.textFillColor.rgb.red = 168
app.dimensions.textFillColor.rgb.green = 168
app.dimensions.textFillColor.rgb.blue = 168

app.grid

This property gives access to all grid attributes but it can not be used
directly.

app.grid.gridSize
Returns and sets the grid size property as float.

app.grid.gridSize = 20

app.grid.radius
Returns and sets the magnetic radius property as float.

app.grid.radius = 5

Complex Data Types 175


app.grid.elementMagnet
Returns and sets the magnetic elements property as boolean.

app.grid.elementMagnet = true

app.grid.gridMagnet
Returns and sets the magnetic grid points property as boolean.

app.grid.gridMagnet = true

app.grid.showGrid
Returns and sets the show grid property as boolean.

app.grid.showGrid = true

app.grid.showDim
Returns and sets the show dimensions property as boolean.

app.grid.showDim = true

app.grid.constrain
Returns and sets the align to grid property as boolean.

app.grid.constrain = true

app.grid.gridInFront
Returns and sets the grid in front property as boolean.

app.grid.gridInFront = true

app.grid.noFShortInIso
Returns and sets the no isometric foreshortening property as boolean.

app.grid.noFShortInIso = true

app.grid.gridColor
Returns and sets the color property as RGBColor.

app.grid.gridColor.red = 0

app.grid.firstSelColor
Returns and sets the first color property as RGBColor.

app.grid.firstSelColor.green = 0

176 Complex Data Types


app.grid.secondSelColor
Returns and sets the second color property as RGBColor.

app.grid.secondSelColor.blue = 0

app.grid.preferredGrid
Returns and sets the name of the standard Grid as string. Only the names
of existing grids can be set.

app.grid.preferredGrid = "Plane view"

app.window

This property gives access to all window attributes but it can not be used
directly.

app.window.pageX
Returns and sets the window x-cords property as float.

app.window.pageX = 200

app.window.pageY
Returns and sets the window y-cords property as float.

app.window.pageY = 230

app.window.overlapX
Returns and sets the print overlap x-cords property as float.

app.window.overlapX = 10

app.window.overlapY
Returns and sets the print overlap y-cords property as float.

app.window.overlapY = 10

app.window.Scale
Returns and sets the window scale property as float.

app.window.Scale = 10

app.window.dimScale
Returns and sets the dimension scaling property as float.

Complex Data Types 177


app.window.dimScale = 7

app.window.preview
Returns and sets the objects preview property as integer. The allowed
values are 0 for “no preview”, 1 for “a preview”, 2 for “visible hotspots” and
4 for “visible objects”. 3 is for “preview and hotspots”, 6 is for “hotspots
and objects” and 7 is for everything.

app.window.preview = 6

app.window.is3D
Returns the 3D property as boolean. This property is read only.

message app.window.is3D

app.window.curSystem
Returns and sets the current system property as string. Allowed values are
"mm", "in" and "pt".

app.window.curSystem = "mm"

app.shadow

This property gives access to all shadow attributes but it can not be used
directly.

app.shadow.shadowWidth
Returns and sets the shadow width property as float.

app.shadow.shadowWidth = 5

app.shadow.shadowFactor
Returns and sets the shadow factor property as float.

app.shadow.shadowFactor = 2

app.thread

This property gives access to all thread attributes but it can not be used
directly.

app.thread.inner.upTo1
Returns and sets the first "inner thread up to" property as float.

178 Complex Data Types


app.thread.inner.upTo1 = 20

app.thread.inner.upTo2
Returns and sets the second "inner thread up to" property as float.

app.thread.inner.upTo2 = 40

app.thread.inner.size1
Returns and sets the first inner thread distance property as float.

app.thread.inner.size1 = 2

app.thread.inner.size2
Returns and sets the second inner thread distance property as float.

app.thread.inner.size2 = 2.5

app.thread.inner.size3
Returns and sets the third inner thread distance property as float.

app.thread.inner.size3 = 3

app.thread.outer.upTo1
Returns and sets the first "outer thread up to" property as float.

app.thread.outer.upTo1 = 20

app.thread.outer.upTo2
Returns and sets the second "outer thread up to" property as float.

app.thread.outer.upTo2 = 40

app.thread.outer.size1
Returns and sets the first outer thread distance property as float.

app.thread.outer.size1 = 2

app.thread.outer.size2
Returns and sets the second outer thread distance property as float.

app.thread.outer.size2 = 2.5

app.thread.outer.size3
Returns and sets the third outer thread distance property as float.

Complex Data Types 179


app.thread.outer.size3 = 3

app.thickthin

This property gives access to all thick/thin attributes but it can not be used
directly.

app.thickthin.useThickThin
Returns and sets the "use thick thin technique" property as boolean.

app.thickthin.useThickThin = true

app.thickthin.thickPen
Returns and sets the thick pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thickPen = "Thick"

app.thickthin.thinPen
Returns and sets the thin pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thinPen = "Thin"

app.thickthin.useEllipsePens
Returns and sets the "specify pens for ellipses and threads" property as
boolean.

app.thickthin.useEllipsePens = true

app.thickthin.thick1
Returns and sets the first thick pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thick1 = "Thick"

app.thickthin.thin1
Returns and sets the first thin pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thin1 = "Thin"

app.thickthin.thick2

180 Complex Data Types


Returns and sets the second thick pen property as string. The name of
every existing pen is an allowed value.

app.thickthin.thick2 = "Thick"

app.thickthin.thin2
Returns and sets the second thin pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thin2 = "Thin"

app.thickthin.thick3
Returns and sets the third thick pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thick3 = "Thick"

app.thickthin.thin3
Returns and sets the third thin pen property as string. The name of every
existing pen is an allowed value.

app.thickthin.thin3 = "Thin"

app.thickthin.upto1
Returns and sets the first up to property as float.

app.thickthin.upto1 = 20

app.thickthin.upto2
Returns and sets the second up to property as float.

app.thickthin.upto2 = 40

app.polygontool

This property gives access to all polygon tool attributes but it can not be
used directly.

app.polygontool.sides
Returns and sets the polygon sides property as integer.

app.polygontool.sides = 7

Complex Data Types 181


app.ellipsetool

This property gives access to all ellipse tool attributes but it can not be
used directly.

app.ellipsetool.value
Returns and sets the ellipse value property as float.

app.ellipsetool.value = 50

app.rectangletool

This property gives access to all rectangle tool attributes but it can not be
used directly.

app.rectangletool.radius
Returns and sets the rectangle radius value property as float.

app.rectangletool.radius = 25

app.background

This property gives access to all background attributes but it can not be
used directly.

app.background.inColor
Returns and sets the in color property as boolean.

app.background.inColor = true

app.background.intensity
Returns and sets the intensity property as float. The properties range is
from 0 to 100.

app.background.intensity = 50

app.background.Color
Returns and sets the screen color property as RGBColor.

app.background.Color = "{RGB 107 69 77}"

app.lineOptions

182 Complex Data Types


This property gives access to all line option attributes but it can not be
used directly.

app.lineOptions.lineCap
Returns and sets the ends property as integer. Allowed values are 0 for
“flat”, 1 for “round” and 2 for “square”.

app.lineOptions.lineCap = 1

app.lineOptions.lineJoin
Returns and sets the corners property as integer. Allowed values are 0 for
“mitered”, 1 for “rounded” and 2 for “bevel”.

app.lineOptions.lineJoin = 2

app.lineOptions.miterLimit
Returns and sets the miter limit property as integer.

app.lineOptions.miterLimit = 4

app.lineOptions.overPrint
Returns and sets the overprint property as integer. Allowed values are 0
for “none”, 1 for “stroke”, 2 for “square” and 3 for “stroke and square”.

app.lineOptions.overPrint = 2

app.simpleEllipsePrinting

This property sets and returns the simple ellipse printing as boolean.

app.simpleEllipsePrinting = true

app.curMacroTransform

This property returns the current transformation properties but it can not
be used directly.

app.curMacroTransform.offset
Returns the offset property as point. This property is read only.

message app.curMacroTransform.offset

app.curMacroTransform.angle

Complex Data Types 183


Returns the angle property as float. This property is read only.

message app.curMacroTransform.angle

app.curMacroTransform.scale
Returns the scale property as point. This property is read only.

message app.curMacroTransform.scale

app.dtd

This property returns and sets the default dtd-file as string.

app.dtd = "webcgm"

app.standardTxtFormat

This property returns and sets which text format is the standard text
format as string.

app.standardTxtFormat = "Normal"

app.option

This property gives access to the optimize options.

app.option.smooth_tolerance
Returns and sets the Tolerance for smoothing property as float. This
setting does not make a permanent change. The value will be reset to 0.1
each time IsoDraw is restarted.

app.option.smooth_tolerance = 0.1

184 Complex Data Types


app.interaction

Returns and sets the display of certain dialogs as boolean. We do not


recommend setting this to false permanently as many dialogs will not
appear during your use of IsoDraw.

app.interaction = false

#Turning off dialogs


app.interaction = false
Select if Type is equal to 'callout'
Cut
#Turn dialogs back on
app.interaction = true

Preferences (Part II) - Data Exchange Settings

You can gain access to the data exchange settings through the
Application Object.

Import CGM

app.cgm.showDialog
Returns and sets if the cgm import dialog is shown as boolean.

app.cgm.showDialog = TRUE

app.cgm.usebackcolor
Returns and sets if the backcolor is used as boolean.

app.cgm.usebackcolor = TRUE

app.cgm.scale
Returns and sets the scale as float. 1 stands for 100% and 0.1 for 10%.

#setting the scale to 55%


app.cgm.scale = 0.55

app.cgm.entities
Sets the CGM options as integer. Please use this formula to calculate the
allowed values:
value = 2^x

Complex Data Types 185


x Option

0 “Polylines“
1 “Disjoint Polyline“
2 “Polymarker“
3 “Text“
4 “Restricted Text“
5 “Append Text“
6 “Polygon“
7 “Polygon Set“
8 “Cell Array“
9 “Rectangle“
10 “Circle“
11 “Circular Arc 3 Point“
12 “Circular Arc 3 Point Close“
13 “Circular Arc Center“
14 “Circular Arc Center Close“
15 “Ellipse“
16 “Elliptical Arc“
17 “Elliptical Arc Close“
18 “Circular Arc Centre Reversed“
19 “Hyperbolic Arc“
20 “Parabolic Arc“
21 “Non-Uniform B-Spline“
22 “Non-Uniform Rational B-Spline“
23 “Polybezier“
24 “Segments“
25 “Figures“
26 “Tiles“
27 “Background Colour“
28 “Clip Element V1“
29 “Clip Element V3“
30 “Appl. Str. Elements“

Add values to activate different options.

#activating the text-option only


app.cgm.entities = 8

#activating the text- (2^2=4), polymarker-


#(2^3=8) and restricted text-option (2^4=16)
app.cgm.entities = 4 + 8 + 16

186 Complex Data Types


app.cgm.importtype
Returns and sets the “Read from version 1/2 as” property as integer.
Allowed values are 1 for “basic”, 2 for “boxed cap” and 3 for “isotropic cap”.

app.cgm.importtype = 1

app.cgm.pictures
Returns and sets the import pictures property as integer. Setting this
property to 0 means importing all pictures and setting the property to
another number means importing just one specific picture.

app.cgm.pictures = 0

app.cgm.cgmlinecap
Returns and sets the line caps as integer. Allowed values are 0 for “flat”, 1
for “rounded” and 2 for “rectangle”.

app.cgm.cgmlinecap = 2

app.cgm.cgmlinejoin
Returns and sets the line join as integer. Allowed values are 0 for
“mitered”, 1 for “rounded” and 2 for “bevel”.

app.cgm.cgmlinejoin = 2

app.cgm.pageSizeKind
Returns and sets the page size value as integer. Allowed values are 1 for
“default” and 2 for use “VDC extend”.

app.cgm.pageSizeKind = 1

Export CGM

app.cgm.profile
Returns and sets the CGM profile as integer. Allowed values are

Complex Data Types 187


1 “ISO 8632:1999”
2 “WebCGM”
3 “ATA GREXCHANGE V2.8”
4 “ATA GREXCHANGE V2.7”
5 “ATA GREXCHANGE V2.6”
6 “ATA GREXCHANGE V2.5”
7 “ATA GREXCHANGE V2.4”
8 “ATA GREXCHANGE V2.5/IsoDraw”
9 “CALS MIL-D-28003A”
10 “SAE J2008”
11 “Model Profile (ISO 8632:1992/Am.1:1994)”
12 “ISO ISP 12071-1 (FCG11) (Draft)”
13 “ISO ISP 12072-1 (FCG23) (Draft)”
14 “ISO ISP 12073-1 (FCG32) (Draft)”
15 “ISO ISP 12074-1 (FCG33) (Draft)”
16 “ATA GREXCHANGE V2.9”
17 AECMA S1000D

app.cgm.profile = 10

app.cgm.useAECMAs1000d
Returns and sets the S1000d compliant as integer. Allowed values are 0 for
“do not use” and 1 for “use”.

app.cgm.useAECMAs1000d = 1

app.cgm.encoding
Returns and sets the CGM encoding type as integer. Allowed values are 1
for “binary” and 2 for “text”.

app.cgm.encoding = 1

app.cgm.vdcType
Returns and sets the VDC-Type as integer. Allowed values are 1 for “16bit
integer”, 2 for “32bit integer” and 3 for “real”.

app.cgm.vdcType = 2

app.cgm.compressionColor
Returns and sets the compression color type as integer. Allowed values
are:

188 Complex Data Types


1 “none”
2 “Runlength”
3 “JPEG”
4 “PNG”

app.cgm.compressionColor = 3

app.cgm.compressionBW
Returns and sets the B/W compression type as integer. Allowed values are:

1 “none”
2 “runlength”
3 “CCITT Group3 (T4)”
4 “CCITT Group3 (T6)”
5 “PNG”

app.cgm.compressionBW = 2

app.cgm.textType
Returns and sets the text type as integer. Allowed values are:

0 “none”
1 “RT basic”
2 “RT boxed-cap”
3 “RT boxed-all”
4 “RT isotropic-cap”
5 “RT isotropic-all”
6 “RT justified”

app.cgm.textType = 6

app.cgm.exportType
Returns and sets the export text type as integer. Allowed values are 1 for
“basic”, 2 for “boxed-cap” and 3 for “isotropic-cap”.

app.cgm.exportType = 1

app.cgm.ellipseAsPoly
Returns and sets if ellipses should be exported as polylines as boolean.

app.cgm.ellipseAsPoly = FALSE

app.cgm.layerToPicture

Complex Data Types 189


Returns and sets if a separate picture should be generated for every layer
as boolean.

app.cgm.layerToPicture = FALSE

app.cgm.nativeCGM
Returns and sets if CGM should be used as the native file format as
boolean.

app.cgm.nativeCGM = FALSE

app.cgm.changeURL
Returns and sets if .iso should be replaced with .cgm in links as boolean.

app.cgm.changeURL = TRUE

app.cgm.vdcExtentMode
Returns and sets the VDC extent mode as integer. Allowed values are 0 for
“include all points”, 1 for “bounding box” and 2 for “page size”.

app.cgm.vdcExtentMode = 2

app.cgm.styleHandling
Returns and sets the linestyle handling mode as integer. Allowed values
are:

1 “map”
2 “split”
3 “LETD if not solid”
4 “LETD always”

app.cgm.styleHandling = 3

app.cgm.extension
Returns and sets the file extension as string.

app.cgm.extension = "cgm"

app.cgm.version
Returns and sets the CGM version as integer. Allowed values are 1 for “1”,
2 for “2”, 3 for “3” and 4 for “4”.

app.cgm.version = 1

190 Complex Data Types


Export EPS

app.eps.extension
Returns and sets the file extension as string.

app.eps.extension = "eps"

app.eps.preview
Returns and sets the preview as integer. Allowed values are 1 for “no
preview”, 2 for “for MS-DOS” and 3 for “for Mac”.

app.eps.preview = 2

app.eps.embedFonts
Returns and sets if type 1 fonts should be embedded as boolean.

app.eps.embedFonts = FALSE

Import Illustrator

app.ill.ignoreGuides
Returns and sets if the guides are ignored as boolean.

app.ill.ignoreGuides = TRUE

Export Illustrator

app.ill.extension
Returns and sets the file extension as string.

app.ill.extension = "ai"

app.ill.includeEPS
Returns and sets if the EPS file is included as boolean.

app.ill.includeEPS = FALSE

app.ill.version
Returns and sets the illustrator version as integer. Allowed values are 0 for
“Adobe Illustrator™ 7.0”, 1 for “Adobe Illustrator™ 88” and 2 for “Adobe
Illustrator™ 6.0”.

app.ill.version = 0

Complex Data Types 191


Export SVG

app.svg.extension
Returns and sets the file extension as string.

app.svg.extension = "svg"

app.svg.compressed
Returns and sets if an compressed svgz file is created as boolean.

app.svg.compressed = FALSE

app.svg.embedRaster
Returns and sets if the raster image is embedded as boolean.

app.svg.embedRaster = FALSE

app.svg.size
Returns and sets the Illustration size as integer. Allowed values are 1 for
“scalable illustration” and 2 for “fixed size illustration”.

app.svg.size = 2

app.svg.page
Returns and sets the Dimensions as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.svg.page = 1

app.svg.encoding
Returns and sets the file encoding as integer. Allowed values are 1 for “ISO
Latin”, 2 for “UTF-8” and 3 for “UTF-16”.

app.svg.encoding = 2

app.svg.hotspot_regions
Returns and sets the Hotspot regions as integer. Allowed values are 1 for
“use visible geometry only” and 2 for “create region paths”.

app.svg.hotspot_regions = 2

app.svg.object_attributes

192 Complex Data Types


Returns and sets the Object attributes as integer. Allowed values are 1 for
“don’t export object attributes” and 2 for “export attributes using
namespace”.

app.svg.object_attributes = 2

Import IGES

app.iges.showDialog
Returns and sets if the IGES import dialog is shown as boolean.

app.iges.showDialog = TRUE

app.iges.scale
Returns and sets the scale as float. 1 is used for 100% and 0.1 for 10%.

#setting the scale to 21%


app.iges.scale = 0.21

app.iges.platformIn
Returns and sets the import platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.iges.platformIn = 3

app.iges.selectGroups
Returns and sets if the assemblies should be selected as boolean.

app.iges.selectGroups = FALSE

app.iges.createInfo
Returns and sets if the object informations for the assemblies should be
created as boolean.

app.iges.createInfo = FALSE

app.iges.hsType
Returns and sets which hotspot type is created for the assemblies as
integer. Allowed values are 0 for “no hotspot” and 1 for “lines of objects”.

app.iges.hsType = 1

app.iges.ignoreInvisElts

Complex Data Types 193


Returns and sets if invisibly elements should be ignored as boolean.

app.iges.ignoreInvisElts = TRUE

app.iges.use102
Returns and sets if the entity 102 should be used as bezier path as boolean.

app.iges.use102 = TRUE

app.iges.convertAnnotations
Returns and sets if the annotations of the elements should be converted
as boolean.

app.iges.convertAnnotations = TRUE

app.iges.views
Returns and sets how elements which are not assigned to a view should
be handled as integer. Allowed values are 0 for “without any view” and 1
for “in all views”.

app.iges.views = 1

app.iges.bestView
Returns and sets is the best view is chosen automatically as integer.
Allowed values are 0 for “do not check best view” and 1 for “check best
view automatically”.

app.iges.bestView = 1

app.iges.entityFlags1
Returns and sets the IGES options as integer. Please use this formula to
calculate the allowed values:
value = 2^x

x Option

0 “100 Circular Arc“


1 “102 Composite Curve“
2 “104 Conic Arc“
3 “106 Copious Data“
4 “108 Plane“

194 Complex Data Types


5 “110 Line“
6 “112 Parametric Spline Curve“
7 “114 Parametric Spline Surface“
8 “116 Point“
9 “118 Ruled Surface“
10 “120 Surface of Revolution“
11 “122 Tabulated Cylinder“
12 “124 Transformation Matrix“
13 “126 Rational B-Spline Curve“
14 “128 Rational B-Spline Surface“
15 “130 Offset Curve“
16 “132 Connect Point“
17 “140 Offset Surface“
18 “141 Boundary“
19 “142 Curve on a Parametric Surface“
20 “143 Bounded Surface“
21 “144 Trimmed (Parametric) Surface“
22 “186 Manifold Solid B-Rep Object“
23 “202 Angular Dimension“
24 “206 Diameter Dimension“
25 “210 General Label“
26 “212 General Note“
27 “214 Leader/Wedge“
26 “216 Linear Dimension“
29 “218 Ordinate Dimension“
30 “220 Point Dimension“
31 “222 Radius Dimension“

Add values to activate different options.

#activating the Copius Data-option only


app.iges.entityFlags1 = 8

#activating the Composite Curve- (2^1=2),


#Copious Data-(2^3=8) and Lines-option (2^5=32)
app.iges.entityFlags1 = 2 + 8 + 32

app.iges.entityFlags2
Returns and sets the IGES options as integer. Please use this formula to
calculate the allowed values:
value = 2^x

Complex Data Types 195


x Option

0 “228 General Symbol“


1 “230 Sectioned Area“
2 “304 Line Font Definition“
3 “308 Subfigure Definition“
4 “312 Text Display“
5 “314 Color Definition“
6 “320 Network Subfigure Definition“
7 “402 Form 1, 7, 15 Group“
8 “402 Form 18 Flow“
9 “402 Form 9, 13, 16“
10 “406 Property/Drawing Size“
11 “408 Singular Subfigure Instance“
12 “412 Rectangle Array Subfigure Instance“
13 “414 Circular Array Subfigure Instance“
14 “416 External Reference“

Add values to activate different options.

#activating the General Symbol-option only


app.iges.entityFlags2 = 1

#activating the General Symbol- (2^0=1),


#Sectioned Area-(2^1=2) and Line Font Definition
#-option (2^2=4)
app.iges.entityFlags2 = 1 + 2 + 4

Export IGES

app.iges.platformout
Returns and sets the export platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.iges.platformout = 2

app.iges.extension
Returns and sets the file extension as string.

app.iges.extension = "igs"

app.iges.standard

196 Complex Data Types


Returns and sets the standard header as integer. Allowed values are 1 for
“CALS I Subset”, 2 for “CALS II Subset” and 3 for “VDAIS”.

app.iges.standard = 3

app.iges.sender
Returns and sets the sender information as string.

app.iges.sender = "ITEDO SOFTWARE"

app.iges.receiver
Returns and sets the receiver information as string.

app.iges.receiver = "ITEDO LLC"

app.iges.author
Returns and sets the author information as string.

app.iges.author = "MS"

app.iges.company
Returns and sets the company information as string.

app.iges.company = "ITEDO SOFTWARE GMBH"

app.iges.VDAIS.sender
Returns and sets the VDAIS Sendefirma information as string.

app.iges.vdais.sender = "ITEDO SOFTWARE GMBH"

app.iges.VDAIS.partner
Returns and sets the VDAIS Ansprechpartner information as string.

app.iges.vdais.partner = "MS"

app.iges.VDAIS.tel
Returns and sets the VDAIS Telefon information as string.

app.iges.vdais.tel = "02242 - 92210"

app.iges.VDAIS.adresse
Returns and sets the VDAIS Adresse information as string.

app.iges.vdais.adresse = "D-53773 Hennef"

Complex Data Types 197


app.iges.VDAIS.system
Returns and sets the VDAIS Erzeugendes System information as string.

app.iges.vdais.system = "WIN2K"

app.iges.VDAIS.projekt
Returns and sets the VDAIS Projekt information as string.

app.iges.vdais.projekt = "T 305 UHF"

app.iges.VDAIS.kennung
Returns and sets the VDAIS Projektkennung information as string.

app.iges.vdais.kennung = "4711-2"

app.iges.VDAIS.variante
Returns and sets the VDAIS Variante information as string.

app.iges.vdais.variante = "V666"

app.iges.VDAIS.conf
Returns and sets the VDAIS Vertraulichkeit information as string.

app.iges.vdais.conf = "Nur für den


Dienstgebrauch"

app.iges.VDAIS.datum
Returns and sets the VDAIS Gültigkeitsdatum information as string.

app.iges.vdais.datum = "01 01 2005"

app.iges.VDAIS.receiver
Returns and sets the VDAIS Empfängerfirma information as string.

app.iges.vdais.receiver = "ITEDO LLC"

app.iges.VDAIS.recName
Returns and sets the VDAIS Empfängername/Abteilung information as
string.

app.iges.vdais.recName = "DR"

app.iges.CALS1.identifier
Returns and sets the CALS1 Identifier information as string.

198 Complex Data Types


app.iges.CALS1.identifier = "11299874548"

app.iges.CALS1.description
Returns and sets the CALS1 Description information as string.

app.iges.CALS1.description = "Big Project"

app.iges.CALS2.creator
Returns and sets the CALS2 Creator information as string.

app.iges.CALS2.Creator = "HunchBack"

app.iges.CALS2.PartName
Returns and sets the CALS2 Part Name information as string.

app.iges.CALS2.partName = "EL4456:8876-1B"

app.iges.CALS2.drawingName
Returns and sets the CALS2 Drawing Name information as string.

app.iges.CALS2.drawingName = "Front Left"

app.iges.CALS2.description
Returns and sets the CALS2 Description information as string.

app.iges.CALS2.description = "put a onto b"

app.iges.CALS2.revision
Returns and sets the CALS2 Revision information as string.

app.iges.CALS2.revision = "445:7889:223211c"

app.iges.CALS2.sizeNumber
Returns and sets the CALS2 Size Number information as string.

app.iges.CALS2.sizeNumber = "76DD"

Import DWG

app.dwg.showDialog
Returns and sets if the DWG import dialog is shown as boolean.

app.dwg.showDialog = TRUE

Complex Data Types 199


app.dwg.scale
Returns and sets the scale as float. 1 stands for 100% and 0.1 for 10%.

#setting the scale to 37%


app.dwg.scale = 0.37

app.dwg.platformIn
Returns and sets the import platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.dwg.platformIn = 3

app.dwg.unit
Returns and sets the the corresponding unit as integer. Allowed values are:

1 “mm”
2 “inch”
3 “foot”
4 “m”

app.dwg.unit = 1

app.dwg.polyAsElements
Returns and sets if polylines should be converted into lines and circles as
boolean.

app.dwg.polyAsElements = FALSE

app.dwg.ignoreVarPolyWidth
Returns and sets if variable width of polylines should be ignored as
boolean.

app.dwg.ignoreVarPolyWidth = TRUE

app.dwg.ignoreTextFactor
Returns and sets if the width factor of text elements should be ignored as
boolean.

app.dwg.ignoreTextFactor = TRUE

app.dwg.ignoreHeight
Returns and sets if the height and elevation should be ignored as boolean.

200 Complex Data Types


app.dwg.ignoreHeight = FALSE

app.dwg.entities
Returns and sets the DWG options as integer. Please use this formula to
calculate the allowed values:
value = 2^x

x Option

0 “LINE“
1 “POINT“
2 “CIRCLE“
3 “SHAPE“
4 “ELLIPSE“
5 “SPLINE“
6 “TEXT“
7 “ARC“
8 “TRACE“
9 “SOLID“
10 “INSERT“
11 “ATTDEF“
12 “ATTRIB“
13 “POLYLINE“
14 “LINE3D“
15 “FACE3D“
16 “DIMENSION“
17 “RAY“
18 “XLINE“
19 “MTEXT“
20 “LEADER“
21 “MLINE“
22 “LWLINE“
23 “PROXY“
24 “HATCH“
25 “VIEWPORT“

Add values to activate different options.

#activating the TEXT-option only


app.dwg.entities = 64

#activating the CIRCLE- (2^2=4), SHAPE-


#(2^3=8) and ELLIPSE-option (2^4=16)
app.dwg.entities = 4 + 8 + 16

Complex Data Types 201


Export DWG

app.dwg.release
Returns and sets the AutoCAD release as integer. Allowed values are:

0 “Release 12”
1 “Release 13”
2 “Release 14”
3 “AutoCAD 2000”

app.dwg.release = 3

app.dwg.flags
Returns and sets the conversion flags as integer. Allowed values are 0 for
“Convert ellipses and beziers to 2D polylines”, 1 for “Convert ellipses to 3D
arcs and beziers to 2D polylines”, 2 for “Convert ellipses to 2D Polylines and
beziers to 3D Polylines” and 3 for “Convert ellipses and beziers to 3D”.
Conversion of ellipses (2 and 3) is only valid for “Release 12”!

app.dwg.flags = 2

app.dwg.platformOut
Returns and sets the export platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.dwg.platformOut = 3

app.dwg.extension
Returns and sets file extension as string.

app.dwg.extension = "dwg"

Import DXF

app.dxf.showDialog
Returns and sets if the DXF import dialog is shown as boolean.

app.dxf.showDialog = TRUE

app.dxf.scale
Returns and sets the scale as float. 1 stands for 100% and 0.1 for 10%.

202 Complex Data Types


#setting the scale to 37%
app.dxf.scale = 0.37

app.dxf.platformIn
Returns and sets the import platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.dxf.platformIn = 3

app.dxf.unit
Returns and sets the corresponding unit as integer. Allowed values are:

1 “mm”
2 “inch”
3 “foot”
4 “m”

app.dxf.unit = 1

app.dxf.polyAsElements
Returns and sets if polylines should be converted into lines and circles as
boolean.

app.dxf.polyAsElements = FALSE

app.dxf.ignoreVarPolyWidth
Returns and sets if variable width of polylines should be ignored as
boolean.

app.dxf.ignoreVarPolyWidth = TRUE

app.dxf.ignoreTextFactor
Returns and sets if the width factor of text elements should be ignored as
boolean.

app.dxf.ignoreTextFactor = TRUE

app.dxf.ignoreHeight
Returns and sets if the height and elevation should be ignored as boolean.

app.dxf.ignoreHeight = FALSE

app.dxf.entities

Complex Data Types 203


Returns and sets the DXF options as integer. Please use this formula to
calculate the allowed values:
value = 2^x

x Option

0 “LINE“
1 “POINT“
2 “CIRCLE“
3 “SHAPE“
4 “ELLIPSE“
5 “SPLINE“
6 “TEXT“
7 “ARC“
8 “TRACE“
9 “SOLID“
10 “INSERT“
11 “ATTDEF“
12 “ATTRIB“
13 “POLYLINE“
14 “LINE3D“
15 “FACE3D“
16 “DIMENSION“
17 “RAY“
18 “XLINE“
19 “MTEXT“
20 “LEADER“
21 “MLINE“
22 “LWLINE“
23 “PROXY“
24 “HATCH“
25 “VIEWPORT“

Add values to activate different options.

#activating the TEXT-option only


app.dxf.entities = 64

#activating the CIRCLE- (2^2=4), SHAPE-


#(2^3=8) and ELLIPSE-option (2^4=16)
app.dxf.entities = 4 + 8 + 16

Export DXF

204 Complex Data Types


app.dxf.release
Returns and sets the AutoCAD release as integer. Allowed values are:

1 “Release”
2 “Release 13”
3 “Release 14”
4 “AutoCAD 2000”

app.dxf.release = 4

app.dxf.flags
Returns and sets the conversion flags as integer. Allowed values are 0 for
“Convert ellipses and beziers to 2D polylines”, 1 for “Convert ellipses to 3D
arcs and beziers to 2D polylines”, 2 for “Convert ellipses to 2D Polylines and
beziers to 3D Polylines” and 3 for “Convert ellipses and beziers to 3D”.
Conversion of ellipses (2 and 3) is only valid for “Release 12”!

app.dxf.flags = 2

app.dxf.platformOut
Returns and sets the export platform as integer. Allowed values are 1 for
“Mac”, 2 for “MS Win” and 3 for “Unix”.

app.dxf.platformOut = 3

app.dxf.extension
Returns and sets file extension as string.

app.dxf.extension = "dxf"

Import VRML

app.vrml.showDialog
Returns and sets if the VRML import dialog is shown as boolean.

app.vrml.showDialog = TRUE

app.vrml.scale
Returns and sets the scale as float. 1 stands for 100% and 0.1 for 10%.

#setting the scale to 37%


app.vrml.scale = 0.37

Complex Data Types 205


app.vrml.selectGroups
Returns and sets if assemblies should be selected as boolean.

app.vrml.selectGroups = FALSE

app.vrml.createInfo
Returns and sets if the object info for assemblies should be created as
boolean.

app.vrml.createInfo = FALSE

app.vrml.hsType
Returns and sets the hotspot type as integer. Allowed values are 0 for “no
Hotspot” and 1 for “lines of object”.

app.vrml.hsType = 1

app.vrml.readflag
Returns and sets if the buffers should be read for all file sizes as integer.
Allowed values are 1 for “off” and 17 for “create reading buffer for all file
sizes”.

app.vrml.readflag = 17

app.vrml.entities
Returns and sets the VRML options as integer. Please use this formula to
calculate the allowed values:
value = 2^x

x Option

0 “Box“
1 “Cube“
2 “Cone“
3 “Cylinder“
4 “Sphere“
5 “Elevation Grid“
6 “Point Set“
7 “Indexed Line Set“
8 “Indexed Face Set“
9 “Extrusion“

Add values to activate different options.

206 Complex Data Types


#activating the Cone-option only
app.vrml.entities = 4

#activating the Cone- (2^2=4), Cylinder-


#(2^3=8) and Sphere-option (2^4=16)
app.vrml.entities = 4 + 8 + 16

app.vrml.viewpointFlag
Returns and sets the VRML Viewpoints option as integer. Use 0 to not use
viewpoints, use 1 to Use viewpoints; Select from list and use 3 to Use
viewpoints; Predefined viewpoint.

app.vrml.viewpointFlag = 0

app.vrml.viewpointPredef
Returns and sets the Predefined viewpoint option as string. The option to
Use viewpoints; Predefined viewpoint must be selected for this setting to
take affect.

app.vrml.viewpointPredef = "test"

Import Wavefront

app.wavefront.showDialog
Returns and sets if the Wavefront import dialog is shown as boolean.

app.wavefront.showDialog = TRUE

app.wavefront.scale
Returns and sets the scale as float. 1 stands for 100% and 0.1 for 10%.

#setting the scale to 13%


app.wavefront.scale = 0.13

app.wavefront.selectGroups
Returns and sets if assemblies should be selected as boolean.

app.wavefront.selectGroups = FALSE

app.wavefront.createInfo
Returns and sets if the object info for assemblies should be created as
boolean.

app.wavefront.createInfo = FALSE

Complex Data Types 207


app.wavefront.hsType
Returns and sets the hotspot type as integer. Allowed values are 0 for “no
Hotspot” and 1 for “lines of object”.

app.wavefront.hsType = 1

app.wavefront.readflag
Returns and sets if the buffers should be read for all file sizes as integer.
Allowed values are 1 for “off” and 17 for “create reading buffer for all file
sizes”.

app.wavefront.readflag = 17

Export HPGL

app.hpgl.extension
Returns and sets the file extension as string.

app.hpgl.extension = "hpl"

app.hpgl.sortPens
Returns and sets if the pens should be sorted for the plotter output as
boolean.

app.hpgl.sortPens = TRUE

app.hpgl.refPoint.x
Returns and sets the reference point x-coord as float.

app.hpgl.refPoint.x = 10.1

app.hpgl.refPoint.y
Returns and sets the reference point y-coord as float.

app.hpgl.refPoint.y = 10.2

Export TIFF

app.tiff.extension
Returns and sets the file extension as string.

app.tiff.extension = "tif"

208 Complex Data Types


app.tiff.resolution
Returns and sets the resolution as float.

app.tiff.resolution = 200

app.tiff.border
Returns and sets the border thickness as float.

app.tiff.border = 2

app.tiff.depth
Returns the color depth as integer. This property is read only. (Returned
values could be 1, 8, and 24 for 1, 8, and 24 bit)

message app.tiff.depth

app.tiff.kind
Returns and sets the color depth as string. Allowed values are “bitmap”,
“grayscale”, “color8” and “color24”.

app.tiff.kind = "color24"

app.tiff.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.tiff.page = 2

app.tiff.compression
Returns and sets the compression as integer. Allowed values are 1 for
“none”, 7 for “PackBits”, for “CCITT Group3”, 4 for “CCITT Group4”, 5 for
“LZW” and 6 for “LZW2”.

app.tiff.compression = 2

app.tiff.intelOrder
Returns and sets the byte order as boolean.

app.tiff.intelOrder = TRUE

Export JPEG

app.jpeg.extension

Complex Data Types 209


Returns and sets the file extension as string.

app.jpeg.extension = "jpg"

app.jpeg.resolution
Returns and sets the resolution as float.

app.jpeg.resolution = 200

app.jpeg.border
Returns and sets the border thickness as float.

app.jpeg.border = 2

app.jpeg.kind
Returns and sets the color depth as string. Allowed values are “grayscale”
and “color24”.

app.jpeg.kind = "color24"

app.jpeg.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.jpeg.page = 2

app.jpeg.quality
Returns and sets the export quality as float. Allowed values are between 1
and 100. A value to 40 would represent 4 on the quality scale.

app.jpeg.quality = 40

Export PNG

app.png.extension
Returns and sets the file extension as string.

app.png.extension = "png"

app.png.resolution
Returns and sets the resolution as float.

app.png.resolution = 200

210 Complex Data Types


app.png.border
Returns and sets the border thickness as float.

app.png.border = 2

app.png.kind
Returns and sets the color depth as string. Allowed values are “bitmap”,
“grayscale”, “color8” and “color32”.

app.png.kind = "color32"

app.png.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.png.page = 2

app.png.filter
Returns and sets the export filter as float. Allowed values are:

0 “None”
1 “Sub”
2 “Up”
3 “Average”
4 “Paeth”
5 “Adaptive”

app.png.filter = 3

Export BMP

app.bmp.extension
Returns and sets the file extension as string.

app.bmp.extension = "bmp"

app.bmp.resolution
Returns and sets the resolution as float.

app.bmp.resolution = 200

app.bmp.border
Returns and sets the border thickness as float.

Complex Data Types 211


app.bmp.border = 2

app.bmp.kind
Returns and sets the color depth as string. Allowed values are “bitmap”,
“grayscale”, “color8” and “color24”.

app.bmp.kind = "color24"

app.bmp.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.bmp.page = 2

app.bmp.version
Returns and sets the version as integer. Allowed values are 1 for
“Windows” and 2 for “OS/2”.

app.bmp.version = 1

app.bmp.compression
Returns and sets the compression as integer. Allowed values are 0 for
“none” and 1 for “RLE 8”.

app.bmp.compression = 1

Export PCX

app.pcx.extension
Returns and sets the file extension as string.

app.pcx.extension = "pcx"

app.pcx.resolution
Returns and sets the resolution as float.

app.pcx.resolution = 200

app.pcx.border
Returns and sets the border thickness as float.

app.pcx.border = 2

212 Complex Data Types


app.pcx.kind
Returns and sets the color depth as string. Allowed values are “bitmap”,
“grayscale”, “color8” and “color24”.

app.pcx.kind = "color24"

app.pcx.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.pcx.page = 2

app.pcx.encoding
Returns and sets the compression as integer. Allowed values are 1 for
“none” and 2 for “RLE 8”.

app.pcx.encoding = 1

Export CALS

app.cals.extension
Returns and sets the file extension as string.

app.cals.extension = "cc4"

app.cals.resolution
Returns and sets the resolution as float.

app.cals.resolution = 200

app.cals.border
Returns and sets the border thickness as float.

app.cals.border = 2

app.cals.page
Returns and sets the dimension as integer. Allowed values are 1 for
“Drawing size” and 2 for “Extent”.

app.cals.page = 2

app.cals.srcdocid
Returns and sets the srcdocid information as string.

Complex Data Types 213


app.cals.srcdocid = "sample"

app.cals.dstdocid
Returns and sets the dstdocid information as string.

app.cals.dstdocid = "sample"

app.cals.textfilid
Returns and sets the textfilid information as string.

app.cals.textfilid = "sample"

app.cals.figid
Returns and sets the figid information as string.

app.cals.figid = "sample"

app.cals.srcgph
Returns and sets the srcgph information as string.

app.cals.srcgph = "sample"

app.cals.doccls
Returns and sets the doccls information as string.

app.cals.doccls = "sample"

app.cals.notes
Returns and sets the notes information as string.

app.cals.notes = "sample"

Export Text

app.txt.extension
Returns and sets the file extension as string.

app.txt.extension = "txt"

app.txt.useUnicode
Returns and sets if IsoDraw should generate a unicode text file as boolean.

app.txt.useUnicode = TRUE

214 Complex Data Types


Export Object List

app.objectList.extension
Returns and sets the file extension as string.

app.objectList.extension = "txt"

app.objectList.fileTag
Returns and sets the file element as string.

app.objectList.fileTag = "MyFile"

app.objectList.objTag
Returns and sets the object element as string.

app.objectList.objTag = "MyObject"

app.objectList.layerTag
Returns and sets the layer element as string.

app.objectList.layerTag = "MyLayer"

app.objectList.flags
Returns and sets the object list flags as integer. Allowed values are:

1 “Write as XML”
2 “ID”
4 “Name”
8 “Object tip”
16 “Other attributes”
32 “XML attributes”
64 “XML: obj-type as element name”

Add values to combine different flags.

#enable all attributes


app.objectList.flags = (1+2+4+8+16+32+64)

Export Interleaf

app.interleaf.extension
Returns and sets the file extension as string.

Complex Data Types 215


app.interleaf.extension = "doc"

app.interleaf.useStyles
Returns and sets if linestyles should be converted into single elements as
boolean.

app.interleaf.useStyles = TRUE

Export MIF

app.mif.extension
Returns and sets the file extension as string.

app.mif.extension = "mif"

Export PICT

The PICT format is a format which could only be used on a Macintosh


compatible computer.

app.pict.extension
Returns and sets the file extension as string.

app.pict.extension = "pic"

Import WMF

The WMF format is a format which could only be used on a Windows


compatible computer.

app.wmf.showDialog
Returns and sets if the wmf import dialog is shown as boolean.

app.wmf.showDialog = TRUE

app.wmf.asRaster
Returns and sets if the wmf file should be imported as image element as
boolean.

app.wmf.asRaster = FALSE

Export WMF

216 Complex Data Types


The WMF format is a format which could only be used on a Windows
compatible computer.

app.wmf.extension
Returns and sets the file extension as string.

app.wmf.extension = "wmf"

app.wmf.enhanced
Returns and sets if the file should be written as enhanced metafile as
boolean.

app.wmf.enhanced = TRUE

Sub Data Types

The IsoDraw Macro Language provides different kinds of Sub Data Types.
These Sub Data Types could be imputed to the group of Complex Data
Types but in contrast to these data types, the Sub Data Types can not be
defined. They can only be accessed through the Application or the
Document Object. Keep in mind that with these data types you will only
change the preferences of the current active document (Document
Object) or the preferences of the application (Application Object).

.Pens[ ]

This property gives access to all pen attributes but it can not be used
directly.

.Pens[ ].name
Returns and sets the name of a specific default pen as string.

app.Pens["Thick"].name = "myThickPen"

.Pens[ ].width
Returns and sets the width of a specific default pen as float.

app.Pens[1].width = 2.5

.Pens[ ].color

Complex Data Types 217


This is a ColorSpec type property. (See the ColorSpec paragraph for more
details).

message app.Pens["Medium"].color.type

.Pens[ ].style
Returns and sets the style of a specific pen as string.

app.Pens["Thick"].style = "Solid"

.Pens[ ].shadow
Returns and sets the type of shadow as string.

app.Pens[1].shadow = "Autom. Long"

.Pens[ ].switchPen
Returns and sets the type of pen switched to as string.

app.Pens[1].switchPen = "Thin"

.Pens[ ].screenColor
Returns and sets the screen color as RGBColor.

app.Pens[3].screenColor.red = 122
app.Pens[3].screenColor.green = 122
app.Pens[3].screenColor.blue = 122

.linestyles[ ]

This property gives access to all style attributes but it can not be used
directly.

.linestyles[].name
Returns and sets the name of the linestyle as string.

app.linestyles[1].name = "myLineStyle"

.linestyles[].type
Returns and sets the type of the linestyle as integer. The allowed values
are 0 for “solid”, 1 for “dashed” and 2 for “dotted”.

app.linestyles[1].type = 2

.linestyles[ ].startMark

218 Complex Data Types


Returns and sets the start mark of the linestyle as integer between 0 and
46 (0 = no mark).

app.linestyles[1].startMark = 33

.linestyles[ ].endMark
Returns and sets the end mark of the linestyle as integer between 0 and
46 (0 = no mark).

app.linestyles[1].endMark = 7

.linestyles[ ].minEndLength
Returns and sets the minimum end length of the linestyle as float.

app.linestyles[1].minEndLength = 33

.linestyles[ ].pattern[ ]
Returns and sets the pattern values.

app.linestyles[1].pattern[1]

Returns and sets the pattern values as float. This applies to


linestyles.type 1 and 2. If the linestyle.type property is set to
"dotted" and the first pattern is greater than 0 the first pattern defines the
point distance. If the linestyle.type property is set to "dotted" and
the first pattern is equal to (-256) the point distance is set to automatic.

app.linestyles[1].pattern[1] = 1
app.linestyles[1].pattern[2] = 1.5

The linestyles can be addressed by the language independent specifier (see


Style Names) too:

app.linestyles[“$ISO_DOTTED”].pattern[1] = 1.5

.shadows[ ]

This property gives access to all shadow attributes but it can not be used
directly.

.shadows[ ].name
Returns and sets the name of the shadow as string.

Complex Data Types 219


app.shadows[1].name = "myPrettyShadow"

.shadows[ ].width
Returns and sets the width of the shadow in mm as float. Setting this
value to 0 means automatic; all positive values defining the thickness of
the shadow in mm; all negative values defining the thickness of the
shadow relative to the thickness of the line thickness.

app.shadows[1].width = 7

.shadows[ ].color
Returns and sets the color of the shadow as ColorSpec.

app.shadows[1].color.rgb.red = 155
app.shadows[1].color.rgb.green = 155
app.shadows[1].color.rgb.blue = 155

.shadows[ ].start
Returns and sets the start type of the shadow as integer. Allowed values
are 1 for “long”, 2 for “middle”, 3 for “short”.

app.shadows[1].start = 1

.shadows[ ].end
Returns and sets the end type of the shadow as integer. Allowed values
are 1 for “long”, 2 for “middle”, 3 for “short”.

app.shadows[1].end = 2

.colors[ ]

This property gives access to all color attributes but it can not be used
directly.

.colors[ ].name
Returns and sets the name of the color as string.

app.colors[1].name = "myLovelyBlue"

.colors[ ].kind
Returns and sets the type of the color as string. The allowed values are
"Custom_color", "RGB_color". "CMYK_color" and "Color_Tone".

app.colors[1].kind = "RGB_color"

220 Complex Data Types


.colors[ ].color
Returns and sets the color as ColorSpec.

app.colors[1].color.rgb.red = 188
app.colors[1].color.rgb.green = 188
app.colors[1].color.rgb.blue = 188

.hatchings[ ]

This property gives access to one hatching attribute but it can not be used
directly.

.hatchings[ ].name
Returns and sets the name of the hatching as string.

app.hatchings[1].name = "firstHatch"

.patterns[ ]

This property gives access to one pattern attribute but it can not be used
directly.

.patterns[ ].name
Returns and sets the name of the hatching as string.

app.patterns[1].name = "firstPatch"

.txtFormats[ ]

This property gives access to all text format attributes but it can not be
used directly.

.txtFormats[ ].name
Returns and sets the name of the text format as string.

app.txtFormats[1].name = "My New Format"

.txtFormats[ ].font
Returns and sets the name of the font of the text format as string. Any
installed font can be used.

app.txtFormats[1].font = "Arial"

Complex Data Types 221


.txtFormats[ ].face
Returns and sets the text face of the text format as string. Allowed values
are “normal”, “bold”, “italic” and “bolditallic”.

app.txtFormats[1].face = "bold"

.txtFormats[ ].size
Returns and sets the size of the text format as float.

app.txtFormats[1].size = 12

.txtFormats[ ].leading
Returns and sets the leading of the text format as float.

app.txtFormats[1].leading = 2.5

.txtFormats[ ].position
Returns and sets the position of the text format as float.

app.txtFormats[1].position = 8

.txtFormats[ ].kerning
Returns and sets the kerning of the text format as float.

app.txtFormats[1].kerning = 1.2

.callouts[ ]

This property gives access to all callout attributes but it can not be used
directly.

.callouts[ ].style_name
Returns and sets the name of the callout style as string.

app.callouts[1].style_name = "myNewCallout"

.callouts[ ].shape_type
Returns and sets the type of the callout shape type as integer. Allowed
values are 0 for "None", 1 for "Circle", 2 for "Triangle Up", 3 for "Triangle
Down", 4 for "Rectangle", 5 for "Pentagon" and 6 for "Hexagon".

app.callouts[1].shape_type = 2

222 Complex Data Types


.callouts[ ].shape_width
Returns and sets the value of the callout shape width as float.

app.callouts[1].shape_width = 2.5

.callouts[ ].shape_height
Returns and sets the value of the callout shape height as float.

app.callouts[1].shape_height = 1.5

.callouts[ ].shape_pen
Returns and sets the pen of the shape of the callout as string. Any defined
pen can be used.

app.callouts[1].shape_pen = "Thick"

.callouts[ ].shape_style
Returns and sets the style of the shape of the callout as string. Any
defined style can be used.

app.callouts[1].shape_style = "Dashed"

.callouts[ ].shape_shadow
Returns and sets the shadow of the shape of the callout as string. Any
defined shadow can be used.

app.callouts[1].shape_shadow = "Autom. Long"

.callouts[ ].text_update
Returns and sets the status of the text update width as string. The allowed
values are "none" and "auto".

app.callouts[1].text_update = "auto"

.callouts[ ].text_position
Returns and sets the type of the text alignment as string. The allowed
values are "aligned" and "centered".

app.callouts[1].text_position = "centered"

.callouts[ ].text_prefix
Returns and sets the text prefix as string.

Complex Data Types 223


app.callouts[1].text_prefix = "partNo:"

.callouts[ ].text_postfix
Returns and sets the text postfix as string.

app.callouts[1].text_postfix = "_66765"

.callouts[ ].text_gap
Returns and sets the text gap as float.

app.callouts[1].text_gap = "1.5"

.callouts[ ].line_pen
Returns and sets the line pen as string. Any existing pen can be used.

app.callouts[1].line_pen = "Thick"

.callouts[ ].line_style
Returns and sets the line style as string. Any existing style can be used.

app.callouts[1].line_style = "Solid"

.callouts[ ].line_shadow
Returns and sets the line shadow as string. Any existing shadow can be
used.

app.callouts[1].line_shadow = "Autom. Long"

.callouts[ ].fill
Returns and sets the callout fill as fill.

app.callouts[1].fill.type = "no_fill"

.callouts[ ].text_format
Returns and sets the text format of the callout as string. Any defined
format can be used.

app.callouts[1].text_format = "Normal"

.callouts[ ].text_font
Returns and sets the text font of the callout as string. Any installed font
can be used.

app.callouts[1].text_font = "Arial"

224 Complex Data Types


.callouts[ ].text_face
Returns and sets the text face of the callout as string. Allowed values are
"normal", "bold", "italic" and "bolditalic".

app.callouts[1].text_face = "bold"

.callouts[ ].text_size
Returns and sets the text size of the callout as float.

app.callouts[1].text_size = 24.5

.callouts[ ].text_strokecolor
Returns and sets the text stroke color of the callout as ColorSpec.

app.callouts[1].text_strokecolor.type =
"cmykValues"

.callouts[ ].text_stroke
Returns and sets the text stroke of the callout as float.

app.callouts[1].text_stroke = 2.2

.callouts[ ].text_fillcolor
Returns and sets the color of the fill of the text of the callout as ColorSpec.

app.callouts[1].text_fillcolor.rgb.red = 168
app.callouts[1].text_fillcolor.rgb.green = 168
app.callouts[1].text_fillcolor.rgb.blue = 168

.callouts[ ].text_scheme
Returns and sets the text scheme of the callout as string. Allowed values
are "no_scheme", "alpha_uppercase", "alpha_lowercase" and "numeric".

app.callouts[1].text_scheme = "no_scheme"

.callouts[ ].text_hotspot_flag
Returns and sets if the hotspot flag is set as boolean.

app.callouts[1].text_hotspot_flag = false

.grids[ ]

This property gives access to all grid attributes but it can not be used
directly.

Complex Data Types 225


.grids[ ].name
Returns and sets the name of the grid as string.

app.grids[1].name = "Isometric"

.grids[ ].xAngle
Returns and sets the x-angle of the grid as float.

app.grids[1].xAngle = 30

.grids[ ].zAngle
Returns and sets the z-angle of the grid as float.

app.grids[1].zAngle = 30

226 Complex Data Types


Appendix
International Names

Writing Language independent macros

In order to develop macros independent from the language version of


IsoDraw you will find international attribute-names for the macro
language further down in this chapter.

Using these names rather than the language specific names will enable
these macros to run in IsoDraw disregarding the language version.

Even if it is valid to switch the active pen with:

myDoc.active_pen = “No Pen”

This would switch the pen only if the Pen is really named “No Pen”. This
is true for the English language version of IsoDraw only. In the German
version the appropriate command would be:

myDoc.active_pen = “Kein Stift”

In order to write a macro which works always, we recommend using the


’international names’

myDoc.active_pen = “$ISO_NOPEN”

The proper pen name is calculated during run time of the macro. This
command line would work on IsoDraw, no matter if it is an English,
German, Italian, French or even Japanese installation.

Appendix 227
Pen Names

$ISO_NOPEN
$ISO_THICK
$ISO_MEDIUM
$ISO_THIN
$ISO_CENTERLINE

Style Names

$ISO_SOLID
$ISO_DASHED
$ISO_CENTERLINE
$ISO_DOTTED
$ISO_DOTDASHED
$ISO_DASHDOTDOT
$ISO_STARTARROW
$ISO_ENDARROW
$ISO_ENDDOT
$ISO_ARROW
$ISO_STITCHLINE
$ISO_CENTERLINE2
$ISO_HIDDENLINE
$ISO_PHANTOMLINE
$ISO_BREAKLINE1
$ISO_BREAKLINE2

Shadow Names

$ISO_NOSHADOW
$ISO_LONG
$ISO_MIDDLE
$ISO_SHORT
$ISO_CENTER

Color Names

$ISO_NOFILL
$ISO_WHITE
$ISO_BLACK

Callout Names

$ISO_NORMAL

228 Appendix

You might also like