Forum Allplan

FUNCTION AND BNF NOTATION


Working in the program I ran into a problem: in "Help file" in section "interpreter formula syntax Allplan"(working with Label style) I read about the possibility of a call VBScript function to work with attributes.

As example : <VB_Script_function> ::= VB_function_name ( <statement> [ ; <statement> ] )

How it works? Where it's stored? How to do it? Point by point if you can... )

Thank you!

BNF = Backus-Naur-Form

Wikipedia

It explains the syntax of the formula.

<VB_Script_function> ::= VB_function_name ( <statement> [ ; <statement> ] )
means, that between the brackets can be a semicolon seprated list of statements

<statement> ::= <selection> | <expression>
means, that a statement can be a selection or a expression

<expression> ::= <term> { <add_operator> <term> }
means, that a expression is a term or two terms combined with add_operator

...

Hi!

By default, the VBS functions are stored in the file \STD\Vbs\functions.vbs.
Simply edit it with any text editor.

Later you can use any VBS-Function defined there in your formulas in Allplan.

For example:

Function bloque3(atri1,atri2,atri3)

		liste = atri1 & " " & atri2 & " " & atri3
		bloque3 = Replace(liste,"_",vbCr)

End Function

This funtion converts 3 string attributes into a textblock, replacing all occurencies of "_" with linebreaks.

The corresponding formula for my use case in Allplan is:

bloque3(@398@;@991@;@474@)

Hope this helps.

Regards,
Stefan

GEA Arquitectos S.L.P.
Calle Gerardo Diego 6A | 41013 Sevilla | Spain