0% found this document useful (0 votes)
73 views

Allplan 2020 IL VisualScripting

Uploaded by

Julien Maurice
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)
73 views

Allplan 2020 IL VisualScripting

Uploaded by

Julien Maurice
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/ 49

ALLPLAN 2020

E-learning

Allplan Visual Scripting


This documentation has been produced with the utmost care.
ALLPLAN GmbH and the program authors have no liability to the purchaser
or any other entity, with respect to any liability, loss, or damage caused,
directly or indirectly by this software and its documentation, including but
not limited to, any interruptions of service, loss of business, anticipatory
profits, or consequential damages resulting from the use or operation of this
software and its documentation. In the event of discrepancies between the
descriptions and the program, the menu and program lines of the program
take precedence.
Information in this documentation is subject to change without notice.
Companies, names, and data used in examples are fictitious unless otherwise
noted. No part of this documentation may be reproduced or transmitted in
any form or by means, electronic or mechanical, for any purpose, without the
express written permission of ALLPLAN GmbH.
Allfa® is a registered trademark of ALLPLAN GmbH, Munich.
Allplan® is a registered trademark of the Nemetschek Group, Munich.
Adobe® , Acrobat®, and Acrobat Reader® are trademarks or registered
trademarks of Adobe Systems Incorporated.
AutoCAD®, DXF™, and 3D Studio MAX® are trademarks or registered
trademarks of Autodesk Inc., San Rafael, CA.
BAMTEC® is a registered trademark of Häussler, Kempten, Germany.
Datalogic and the Datalogic logo are registered trademarks of Datalogic
S.p.A. in many countries, including the United States and Europe. All rights
reserved.
Microsoft® and Windows® are either trademarks or registered trademarks
of Microsoft Corporation.
MicroStation® is a registered trademark of Bentley Systems, Inc.
Parts of this product were developed using LEADTOOLS, (c) LEAD
Technologies, Inc. All rights reserved.
Parts of this product were developed using the Xerces library of "The
Apache Software Foundation".
fyiReporting Software LLC developed parts of this product using the
fyiReporting library, which is released for use with the Apache Software
license, version 2.
Allplan update packages are created using 7-Zip, (c) Igor Pavlov.
CineRender, render engine, and parts of this documentation; copyright 2014
MAXON Computer GmbH. All rights reserved.
All other (registered) trademarks are the property of their respective
owners.

© ALLPLAN GmbH, Munich. All rights reserved.


1st edition, May 2020
Document no. 200eng01s59-1-BS0520
Allplan Visual Scripting Contents i

Contents
Welcome to Allplan Visual Scripting ....................................... 1
Your feedback............................................................................................................... 2

Introduction ....................................................................................... 3
What is visual programming? .............................................................................. 3
Why visual scripting? ................................................................................................ 3
Where to find visual scripting in Allplan? ....................................................... 4

The user interface of Allplan Visual Scripting ................... 5


Toolbar............................................................................................................................... 6
Library palette .............................................................................................................. 8
Workspace .................................................................................................................... 10
Script view .................................................................................................................... 10

Components of a script ............................................................... 11


Nodes .................................................................................................................................11
Structure of a node ...........................................................................................................11
Handling nodes ....................................................................................................................18
Types of nodes ...................................................................................................................18

Connecting lines........................................................................................................ 20
Creating connecting lines ............................................................................................20
Editing connecting lines ................................................................................................22

Running a script ............................................................................. 23


ii Contents Allplan 2020

Your first attempt at scripting - part 1 .............................. 25


Interplay between Allplan Visual Scripting and Allplan ...................... 28

Your first attempt at scripting - part 2 ............................. 29


Modifying parameters........................................................................................... 36

Your first attempt at scripting - part 3 ............................. 38

Examples provided ...................................................................... 40

Index ................................................................................................... 45
Allplan Visual Scripting Welcome to Allplan Visual Scripting 1

Welcome to Allplan Visual


Scripting
This description focuses on the topic of visual scripting.
You find general information about visual programming
and learn how Allplan has taken up this topic.
Ranging from a detailed explanation of the user interface
of Allplan Visual Scripting to in-depth information about
the components of a script to your first own small script -
this guide shows you all you need to know about visual
scripting in Allplan.
Have fun with this small guide! We wish you every
success!
2 Your feedback Allplan 2020

Your feedback
We are always trying to improve the overall quality of our program
documentation. Your comments and suggestions are important to
us, and we welcome feedback.
Please do not hesitate to contact us to express criticism or praise
concerning the documentation. Feel free to contact us as follows:

Documentation

ALLPLAN GmbH
Werinherstr. 79, Eingang 32 d
81541 Munich, Germany

Email: [email protected]
Allplan Visual Scripting Introduction 3

Introduction
What is visual programming?
Visual programming is receiving more and more attention in the
construction industry. By means of visual programming, you can
program powerful, customized scripts that open up countless new
options when it comes to creativity and design. Visual scripting
facilitates any kind of work: You can automate recurring design
activities, create user-defined forms, analyze data, and generate
project-specific reports.
Parametric modeling is an excellent tool to increase efficiency in
BIM-based planning. This means that the modeled components are
smart due to the parameters assigned. To assign parameters, you
use scripting languages, such as Python. These scripting languages
facilitate the creation of parametric models and support the
automation of design workflows. Think of SmartParts or
PythonParts. When you use them in a model, you are, in fact,
modeling parametrically.

Why visual scripting?


A disadvantage of parametric modeling is that users need extensive
knowledge of the scripting language. As a rule, users must create
parameters and dependencies by writing codes, which requires
advanced programming skills. Although there are various predefined
components, many architects and engineers often need customized
components or a particular behavior, which predefined solutions
cannot provide. This makes modeling difficult and time-consuming.
By means of visual scripting, you can create these components by
visually arranging and linking nodes on a graphical user interface.
These nodes are easy to understand - even without programming
skills. Basically, it’s like creating a flowchart. But visual scripting is
much more than modeling components. You can create scripts to
automate workflows, add information to existing objects, or analyze
the model.
4 Where to find visual scripting in Allplan? Allplan 2020

Where to find visual scripting in Allplan?


You can use Allplan Visual Scripting without additional software in
Allplan. After you have opened Allplan Visual Scripting, it runs in its
own, discrete window. Allplan stays open in the background.
When you look at the Actionbar, you can find visual scripting in the
User-Defined Objects task.

Click to select Allplan Visual Scripting. You can see the Allplan
Visual Scripting window, where you can visually link predefined code
blocks (also referred to as nodes). This results in a script. After
running this script, the program computes the algorithm. This
algorithm creates configurable and reusable objects in Allplan or runs
the defined workflow in Allplan.
But first things first.
Allplan Visual Scripting The user interface of Allplan Visual Scripting 5

The user interface of


Allplan Visual Scripting
Let’s first have a look at the user interface of Allplan Visual Scripting:

1 - Toolbar
2 - Library palette
3 - Workspace
4 - Script view

Tip: You can resize the


Allplan Visual Scripting
window.
6 Toolbar Allplan 2020

Toolbar
The toolbar is above the workspace of the Allplan Visual Scripting
window:

You can find the following tools on the left side of the toolbar:

New to create a new script.

Open to open an existing script.


Allplan comes with a collection of sample scripts. To load these
scripts, select the Examples folder in the left column of the Open
dialog box. You can derive your own scripts from these sample
scripts. All you need to do is save the scripts under new names.

Save to save a new or changed script.

To save a script under a new name, open the Save drop-down list
on the toolbar of the Allplan Visual Scripting window and click Save
as.

Start to run the script.


Allplan opens the NodeScript palette, displaying the result of the
script as a preview in the viewport.
The script does not contain any actual objects or geometries. Only
when you select this tool does the program run the algorithm defined
in Allplan Visual Scripting and display the result of the algorithm as
configurable and reusable objects in Allplan or run the defined
workflow in Allplan.
Allplan Visual Scripting The user interface of Allplan Visual Scripting 7

You can find the following tools on the right side of the toolbar:

Output window to get further information.


If the script does not run (correctly), this window provides further
information about what might have caused the problems.
If a script fails to load or run, the output window opens, displaying
information about what type of error was detected and where it can
be found in the script.

Help to get further information about Allplan Visual Scripting.

Open the Help drop-down list. Getting started provides a short


guide to Allplan Visual Scripting. About Allplan Visual Scripting opens
the Allplan Help for Visual Scripting.
8 Library palette Allplan 2020

Library palette
The Library palette of Allplan Visual Scripting contains all available
nodes sorted alphabetically by category.
The Library palette is a tree structure that consists of folders
structured logically.

You can dock the palette window to the left or right of the
workspace. To minimize the palette, click Turn on auto-hide. To
temporarily open the palette window, point to >>. To see the palette
all the time, click Turn on auto-hide again.
The box for the search tool is below the title bar of the Library
palette. By entering the name of the node or parts thereof, you can
reduce the number of nodes listed in the library. This makes it easier
for you to find a specific node.
Allplan Visual Scripting The user interface of Allplan Visual Scripting 9

When you open a folder and point to a node (see "Nodes" on page 11),
you can see a list of input parameters and output parameters of the
node and further information (property and data type) about these
parameters. This example shows the Box node in the
Geometry\Objects folder:
10 Workspace Allplan 2020

Workspace
You create and edit scripts in the workspace of Allplan Visual
Scripting. These scripts consist of different nodes (on page 11) that
are linked by connecting lines (on page 20). You drag the nodes from
the Library palette into the workspace. After having placed the
nodes in the workspace, you connect them by means of connecting
lines.
Double-click in the workspace to open quick input (see "Your first
attempt at scripting - part 2" on page 29).

Script view
The tools for changing the script view are in the upper-right corner
of the workspace.

Zoom selection: Zooms in on the selected nodes. If you have not


selected a node, this tool is grayed out.

Zoom all: Shows the entire script in the workspace.

/ : Zoom in on or Zoom out of the script in the workspace in


incremental steps.

Tip: You can also zoom by


moving the wheel button.
Allplan Visual Scripting Components of a script 11

Components of a script
With Allplan Visual Scripting, you create visual programs in a
workspace by connecting nodes by means of connecting lines. In
doing so, you define the logic for running the resulting visual
program. This chapter introduces the elements of Allplan Visual
Scripting.

Nodes
By means of visual scripting, unexperienced users can create
complex scripts without having to understand the underlying
“Python” programming language. To create a script, you place nodes
in the required sequence in the workspace. By entering input values
for the nodes, you make them process the underlying program code,
which initiates certain actions or output. The nodes are arranged in
action networks, which run in turn.

Structure of a node
Each node consists of a title bar (1), a middle area with properties (2),
and the lower area with the settings (3).

Each node contains plenty of information. By pointing to or clicking a


component of the node, you can see additional information and
options.
12 Nodes Allplan 2020

Title bar
The title bar contains the icon and name of the node.
Click the "T” to open a box. By default, this box contains the short
description of the node. If a node creates a separate area in the
NodeScript palette in Allplan, you can enter the name of this area
(see "Interplay between Allplan Visual Scripting and Allplan" on page
28) in this box. You can also select the existing name. Use the ENTER
key to confirm the name you just entered.
Allplan Visual Scripting Components of a script 13

Point to the name of the node to open a ToolTip with further


information about this node.
Right-click the title bar to open a shortcut menu where you can
rename the node. Click "Select upstream nodes" to select the nodes
that precede this node and the nodes that are linked with this node.
Click "Select downstream nodes" to select the nodes that follow this
node and the nodes that are affected by the results of this node.
14 Nodes Allplan 2020

Properties area
The places where you can input or output data for nodes are referred
to as ports. These ports act as contacts for the connecting lines (on
page 20). By means of the input ports (4) on the left side, you enter
data into a node. Then, the node processes and outputs the data
through the output ports (5) on the right side. Data flow is always
from left to right.

Point to a port to open a ToolTip with the name, property, and data
type of the port. Input ports require you to enter data of the type
displayed. After processing the input, the node outputs data of the
types displayed through the output ports.
Allplan Visual Scripting Components of a script 15

Click to expand or collapse the individual values displayed for a


parameter.

This example shows the BoxBy2Points node. As you can see, the
StartPoint parameter consists of three values (StartPoint.X,
StartPoint.Y, and StartPoint.Z). After clicking , you can control
these values separately. This means that you can individually define
whether and under which name a value is visible in the NodeScript
palette in Allplan.
16 Nodes Allplan 2020

Note: A red value indicates that this node requires values from
another node. To run this node, you must connect it with another
node.

You can make entries for the individual values on the right side of the
Properties area. In addition, you can define whether and under which
names the values are visible in the NodeScript palette in Allplan. Use
the ENTER key to confirm the names you entered. To close the box
with the properties, open another box with properties or click in the
workspace.

Note: If the parameter is visible in the NodeScript palette of Allplan,


you can also modify the parameter there. The changed value is then
visible in this place in the node (see also "Modifying parameters (on
page 36)").
Allplan Visual Scripting Components of a script 17

Settings area
In addition to properties, each node has settings that you can use to
control the result of the object in the viewport of Allplan. With these
settings, you can also control whether the properties are visible in
the NodeScript palette of Allplan (see "Your first attempt at scripting
- part 2" on page 29).

• Create model objects: Creates objects as model data, as


opposed to preview data.
• Create preview objects: Shows previews of the created objects
in the Allplan viewport.
• Create handles: Creates the generated object with or without
handles.
• Show in palette: Shows or hides all properties of a node in the
NodeScript palette in Allplan.
• Turn on point numbering: Numbers the points consecutively.
• Note dialog line text: Click this button to open a box. The text
that you enter is then visible in the dialog line of Allplan.
18 Nodes Allplan 2020

Handling nodes
Tip: You can also select When you click to select a node, it gets a thick blue border. You can
several nodes by enclosing select several nodes in one go. To do this, select and hold the CTRL
them in a selection key and click the nodes one after the other. You can then move the
rectangle. selected nodes by means of drag-and-drop editing.
Use CTRL+V and CTRL+C to copy and paste selected nodes.
Use the DEL key to delete selected nodes. By deleting a node, you
also remove all its connecting lines.

Types of nodes
Nodes are the basic building blocks of Allplan Visual Scripting. Each
node contributes to the script as a whole.
A node is a predefined code block that processes incoming data
through input ports and outputs (partial) results through output
ports. For example, results can be objects, vectors, and values. Data
flow is always from left to right.
A node requires data so that the node can run its actions and then
output data. The incoming data and outgoing data can be completely
different, such as an integer or a list.
There are also nodes that have only output ports but no input ports.
Allplan Visual Scripting Components of a script 19

The Library palette (on page 8) of Allplan Visual Scripting contains


the following folders with nodes:
- AddOns\WarpedSlabs to create, place, and modify warped
slabs (double-tee beams).
- Architecture\Objects to create architectural objects (for
example, a wall based on a path).
- AreaRepresentation to assign 2D surface attributes to an
object.
- Attributes to determine attribute values of objects, change
attribute values, and create new attributes.
- General to assign the current format properties in Allplan to
the model objects, for example.
- Geometry to perform geometric operations (for example,
Boolean operations, transformations) and create geometric
objects (for example, curves, grids, geometric solids, planes,
vectors).
- ImportExport to import and export data to and from files.
- InputControls to add boxes, check boxes, and sliders for
parameters.
- List to read elements from lists (List\Access), create a list and
fill it with elements (List\Fill), and modify lists. For example,
ListReverse reverses the sequence of the list elements
(List\Modify). A list is a collection of elements or entries.
- Math to perform mathematical operations (for example,
elementary arithmetic, trigonometric functions, algebraic
functions).
- ModelObject to edit objects by filtering or matching
geometries or parameters.
- Palettes to create palettes with properties.
- Reinforcement to create and place reinforcement.
- SectionsAndViews to create views and sections of objects.
- Workflow to run workflows; for example, to restart the script.
20 Connecting lines Allplan 2020

Connecting lines
Connecting lines connect nodes to create relationships and to define
how a visual program runs. Think of connecting lines as electrical
wires that transport data pulses form one node to the next node.
Connecting lines show the data flow for running the algorithm.
Connecting lines connect the output port of a node with the input
port of another node. This directionality defines the data flow in the
visual program. Although you can arrange the nodes freely in the
workspace, the program generally runs from left to right because
the output ports are on the right side of the nodes and the input
ports are on the left side.

Creating connecting lines


You create a connecting line by clicking a port and then clicking the
(compatible) port of another node (port-to-port connection). While
you are doing this, the dashed connecting line is attached to the
cursor. As soon as the cursor hovers over a possible destination port,
you can see a ToolTip with the property and data type of this port.
Allplan Visual Scripting Components of a script 21

Ports expect data of a specific type. You can connect ports of the
same data type only. If you try to connect two ports that do not
match, the program displays a symbol and cancels the operation.

After you have successfully connected two ports, the connecting


line turns into a continuous line. Data always flows from the output
port to the input port through this connecting line. When connecting
two ports, you can start and end the connecting line at either port.
This doesn’t make any difference.
You can also connect the output ports of each node with several
input ports of other nodes. This also works the other way round: You
can connect several output ports with a single input port.
22 Connecting lines Allplan 2020

Editing connecting lines


Often, you often need to change the way the visual program runs. To
do this, you can edit the connections represented by connecting
lines. To edit a connecting line, point to this connecting line and right-
click to open the shortcut menu.

Tip: You do not even need to • Reconnect start: Removes the connecting line from the output
open the shortcut menu: To port so that you can place the connecting line at another output
remove a connecting line port.
from a port, select and hold
the SHIFT key and click the • Reconnect end: Removes the connecting line from the input port
port. The connecting line is so that you can place the connecting line at another input port.
attached to the cursor and • Disconnect: Deletes the connecting line.
can be connected with
another port or deleted. To
delete the connecting line,
click in the workspace or
select ESC.
To remove a connecting line
from a port, you can also
select and hold the CTRL
key and click the port.
Allplan Visual Scripting Running a script 23

Running a script
If you have correctly connected all nodes in the current script, you
can run the script by clicking Start (toolbar). As a result, the
NodeScript palette opens in Allplan. In addition, the workspace of
Allplan shows the result of the script (object) or runs the workflow
defined.
You can change the parameters both in the NodeScript palette and
in the script itself.

Note: You cannot select the Start tool until the script is complete.
For example, look for red input ports (see "Structure of a node" on
page 11).
24 Connecting lines Allplan 2020

1 - NodeScript palette: You can change the properties of the script


by means of the palette. The script defines which properties are
visible in the palette.
2 - Objects: Objects generated by the script are visible in the
workspace of Allplan. After closing the script, you can create these
objects in Allplan.
2 - Workflows: Workflows generated by the script process Allplan
data.
Allplan Visual Scripting Your first attempt at scripting - part 1 25

Your first attempt at


scripting - part 1
You learned a lot about theoretics in the preceding chapters. So, it’s
high time to get some practice.

To create a script
1 Start Allplan.
2 Create a new project, for example, Visual Scripting.
Drawing file 1 of the new project is open.
3 Go to the Actionbar and open a role that contains the User-
Defined Objects task. For example, select the architecture role.
4 Open the User-Defined Objects task.
This task contains the Visual Scripting task area.

5 Select the Allplan Visual Scripting tool.


You can see the Allplan Visual Scripting window. Allplan stays
open in the background.
Note: Make sure that the Allplan Visual Scripting window does not
hide the Allplan workspace or palettes.
Resize the Allplan Visual Scripting window accordingly.

6 To create a new script, click New on the toolbar of the Visual


Scripting window.
7 Enter the following in the search box of the library: circle
The library shows only the nodes whose names or descriptions
contain the word “circle”.
26 Connecting lines Allplan 2020

8 Point to the Circle3D node and drag it into the workspace.

9 Click Zoom selection in the script view (upper-right corner of


the workspace). This zooms in on the selected node so that it is in
the middle of the workspace.
Allplan Visual Scripting Your first attempt at scripting - part 1 27

10 To run the script, click Start on the toolbar.

Allplan displays the circle in the workspace and opens the


NodeScript palette.
28 Interplay between Allplan Visual Scripting and Allplan Allplan 2020

Interplay between Allplan Visual Scripting


and Allplan
Before you continue with your small script, let’s see how the entries
in Visual Scripting interact with the effects in Allplan. If you think that
the preceding chapters explained everything in detail and you do not
need any further information, you can also skip this section and
continue with the script (see "Your first attempt at scripting - part 2"
on page 29).
As described in "Structure of a node (on page 11)", you can define the
parameters that are visible in the NodeScript palette in Allplan and
the names of these parameters in the nodes in Allplan Visual
Scripting. Use the ENTER key to confirm the names entered.
If a node creates a separate area in the NodeScript palette in Allplan,
you define the name of this area in the node. It is the same with the
parameters. For each parameter, you can decide whether and under
which name it is visible in the NodeScript palette.
Allplan Visual Scripting Your first attempt at scripting - part 2 29

Your first attempt at


scripting - part 2
You dragged the Circle3D node into the workspace of Allplan Visual
Scripting and ran the script by selecting Start. In this section, you
add a second node to the script.

Tip: If you know a part of the To extend and save the script
node name, you can also use
quick input. To open quick 1 Create three copies of the initial circle. The centers of the circles
input, double-click in the are 2 m from one another.
workspace. Enter the node This operation is a geometric transformation.
name or parts thereof in the Open the corresponding folder in the Library palette. Drag the
box. PlaceByVector node into the workspace and place it to the right
of the Circle3D node.

2 Click Zoom all in the script view (upper-right corner of the


workspace). This zooms in on the two nodes so that they are
centered in the workspace.
3 The next step is to link the two nodes. This means that you
connect the output port of the node that supplies the values with
the input port of the node that processes the values.

The reference point is the center of the circle. To do this, you


must connect the CenterPoint output port of the Circle3D node
Quick input lists the nodes with the ReferencePoint input port of the PlaceByVector node
that match your entry. by means of a connecting line.
Double-click the required
node to place it in the Click the CenterPoint output port; then, click the ReferencePoint
workspace and to close input port.
quick input.
30 Interplay between Allplan Visual Scripting and Allplan Allplan 2020

4 To copy the circle, you must connect the Circle output port with
the ObjectsToPlace input port.
Note: If you want to correct a connection because you clicked a
wrong input port, select and hold the CTRL key (or SHIFT key) and
click the input port. The connecting line is attached to the cursor
and can be connected with the correct input port.
To delete the connection, remove the connecting line from the
input port and select the ESC key or click in the workspace.
Tip: Each connecting line has a shortcut menu (see "Editing
connecting lines" on page 22). By using the options on this
shortcut menu, you can change the start (output port) and end
(input port) of the connecting line or delete the connecting line.
Allplan Visual Scripting Your first attempt at scripting - part 2 31

5 To define the number of copies, open the properties of Count


(number of placements). Enter 4.

6 Specify how far from one another you want to place the circles.
Open the properties of Distance and enter X = 2 m.
As you entered the Distance immediately after the Count
(number of placements), you automatically closed the Count box
by opening the Distance box.
32 Interplay between Allplan Visual Scripting and Allplan Allplan 2020

7 To close the Distance box, click in the workspace.


Allplan Visual Scripting Your first attempt at scripting - part 2 33

8 Click Start and look at the result in Allplan.

9 Allplan displays the circles in red. This means that the circles are
preview objects. If you closed the script now, there would be no
model data. To create model objects in Allplan, you need to add
this information to the nodes. To do this, select the Create model
objects button in the settings area of each node. By selecting this
button in the Circle3D node, you create the initial circle as a model
object in Allplan. By selecting this button in the PlaceByVector
node, you create the three copies of the circle as model data in
Allplan.
34 Interplay between Allplan Visual Scripting and Allplan Allplan 2020

As a result, Allplan displays the circles with the format properties


that are selected in Allplan.
Note: You can find information about the other buttons in
"Structure of a node (on page 11)".
10 Finally, you can adjust the names of the areas and parameters in
the NodeScript palette. All this can be done in the nodes (see
"Interplay between Allplan Visual Scripting and Allplan" on page
28).
Allplan Visual Scripting Your first attempt at scripting - part 2 35

The result might look like this:

11 It’s time to save the script.


To do this, click Save on the toolbar of the Allplan Visual
Scripting window.
12 You can see the Save As dialog box. Select the required folder
(Project, Office, or Private), enter a name (for example,
circle.pyp), and click Save.
You have saved your script.
Note: You can see the path of the saved object on the title bar of
the Allplan Visual Scripting window.
36 Modifying parameters Allplan 2020

Modifying parameters
Before you complete your small script, let’s see how you can change
parameters both in the script and in Allplan.
At the moment, the Allplan Visual Scripting window is open and the
result of the script is visible in Allplan. In this situation, you can change
parameters in various ways:
• Use the script.
• Use the NodeScript palette of Allplan.
• Use the object in the workspace of Allplan.
For example:

To modify parameters
You want to change the radius of the circle.
To do this, you can
• Enter the required value in the 3D circle area in the
NodeScript palette of Allplan (1).

or
• Enter the required value in the yellow box of the circle in the
workspace of Allplan (2).

or
• Change the radius by dragging the handle of the circle (3).

or
• Enter the required radius by opening the properties of the
Radius parameter in the Circle3D node in the workspace of
the Allplan Visual Scripting window (4).
Allplan Visual Scripting Your first attempt at scripting - part 2 37

By changing the radius, you automatically change all four objects.


38 Modifying parameters Allplan 2020

Your first attempt at


scripting - part 3
Remember: You saved the small script before you modified the
Radius parameter. So that you can use the scripted objects in Allplan,
you must save these objects too.

To complete the script and to save the objects


1 To close Allplan Visual Scripting, click the button in the upper-right
corner of the Allplan Visual Scripting window.
2 As the last step involved modifying a node (changing the radius),
a dialog box asks whether you want to save the script, thus
overwriting the previous version.
By selecting the Save with object option, you ensure that the
object is still in the Allplan drawing file after saving.
Click Save.
Allplan Visual Scripting Your first attempt at scripting - part 3 39

The Allplan Visual Scripting window closes. You are in Allplan. The
drawing file with the scripted object is open.
Note: If you have not changed the script after you saved it, the
dialog box only asks whether you want to save the object:

By saving the object, you store the object as a PythonPart in the


selected folder (see "Your first attempt at scripting - part 2" on
page 29) in the library.
40 Modifying parameters Allplan 2020

Examples provided
Allplan comes with various scripted examples. You can find them in
the following Allplan path: ETC\Examples\VisualScripting
For example:

To use the examples


 Allplan is running; the Allplan Visual Scripting is selected; the
Allplan Visual Scripting window is open.

1 Click Open on the toolbar of Allplan Visual Scripting.


2 Select the Examples folder in the Open dialog box.
Allplan Visual Scripting Examples provided 41

3 Open the Geometry - Interactors folders and select


LoftCircleColumn.pyp. This example raises, copies, and
places 3D circles along a path.
Click Open.

The script appears in the workspace. You can see the path of the
selected object on the title bar of the Allplan Visual Scripting
window.

4 Click Start.
5 The dialog line of Allplan prompts you to enter a 3D line. Draw the
line in the workspace. As an alternative, define the line by entering
dx, dy and dz in the dialog line.
42 Modifying parameters Allplan 2020

Allplan creates the objects in the viewport and opens the


NodeScript palette.

6 As you learned in "Modifying parameters (on page 36)", you can


change the parameters of the objects in Allplan. To do this, you
can use the NodeScript palette or the handles or boxes. But you
can also make modifications directly in the nodes in Allplan Visual
Scripting.
So that you can use the modified script later, click Save as... in the
Save drop-down list on the toolbar of the Allplan Visual
Scripting window. You can see the Save As dialog box. Select the
required folder (Project, Office, or Private), and click Save.
Allplan Visual Scripting Examples provided 43

Note: The Save As dialog box also opens when you select the
Save tool. This ensures that you do not inadvertently
overwrite the examples.
7 When you close the Allplan Visual Scripting window, decide
whether you want to save the object in Allplan.

By clicking Save, you store the object as a PythonPart in the


selected folder (see point 6; Project, Office, or Private) under
VisualScripting in the library.

By clicking Do not save, you do not save the object created in


Allplan. You have already saved the script (see point 6).
Note: If you have not yet saved the script, the following dialog
box appears when you close the Allplan Visual Scripting window:

Decide whether you want to save only the script or both the
script and the object.
44 Allplan 2020
Allplan Visual Scripting Index 45

Index
A O
Allplan Visual Scripting 4 output window 6
library palette 8
selecting script view 10
Q
toolbar 6 quick input 10, 29
user interface 5 R
workspace 10
resizing 5, 25
C
S
components of a script 11, 20
connecting lines script
changing 22 creating 6, 25
creating 20, 29 displaying 10
definition 20 running 6, 23
deleting 22 save as 40
editing 22 save with object 38
reconnecting 22 saving 6, 29, 38
starting 6, 23, 25, 29, 40
D search 8, 10, 25
displaying the script 10 V
M visual programming 3
modifying parameters 36
Z
N zoom selection 10, 25
nodes zooming 10, 29
creating model objects 29
creating preview objects 11, 29
definition 11
deleting 22
entering properties 29
handling 18
modifying parameters 36
structure 11
types 18
NodeScript palette in Allplan
modifying parameters 36
renaming areas 28, 29
renaming parameters 28, 29
visibility of parameters 11

You might also like