You are on page 1of 4

5/21/13

PlanSwift Wiki - Examples Of Some Formulas

Examples Of Some Formulas


Intro
This will give you some examples of formulas that can be used.

Steps
Have a "Job" open Go into "Advanced Properties" on a item you want the formula on. Will create the current date when the item was created. Will create the current time when the item was created. Will give you the Job's Name Will get the parent items property name. Example: [..\Qty] will give you the parent item's [Qty] property. Will give you the [Name] property of the parent of the parent item. Will get the parent's property with the same property name. [..\..] Works as well if you need the grandparent's same property name. Gives you the parent items Takeoff property Units. So you can specify the parent item !Units of ('PropertyName') Example [..\!Units('Takeoff')] will give you SQ FT if the parent item is a Area. If the parent item is a Linear then the result would be FT. For Labels must be [..\..\!Units('Takeoff')] . They are childrens of sections, which do not have Units('Takeoff') specified. Gives you the path to the folder the item is located in. Will add more later!

[!Date]

[!Time]

[\Job\Name]

[..\PropertyName]

[..\..\Name]

[..]

[..\!Units('Takeoff')]

[!FolderLocation]

wiki.planswift.com/Examples-Of-Some-Formulas

1/4

5/21/13

PlanSwift Wiki - Examples Of Some Formulas

[!ExePath]

Gives you the path of the planswift.exe file.

[\Settings\User]

Gives you the Planswift User Name Gives you a sum of all sub item or children items under that parent item like [!sum(Price Total)] will give you the sum of all sub items under that item. Good for Assemblies to have sum of that property in () on all sub parts. Will pick a random color each time you create a new item. Returns a value of 3.1415926535897932385 Example: Pi*Sqr([Diameter]/2) This example could be used to find the area of a circle. Will return the Hypotenuse of a right angle. Returns a number squared. This numeric value to be squared. Example: Sqr(2) will return 4 Sqr(4) will return 16 Sqr(5) will return 25 Returns the square root of a number. This is a numeric value to find square root value of. Example: Sqrt(25) will return 5 Sqrt(64) will return 8 Sqrt(144) will return 12 Returns e (the base of natural logarithms) raised to a power. This is a numeric value to be raised to e. Example: Exp(1) will return 2.72 Exp(2) will return 7.39 Exp(3) will return 20.09

[!Sum(PropertyName)]

[!RandomColor]

Pi

Hypot(Number1, Number2)

Sqr(Number) or X^2

Sqrt(Number)

Exp(Number)

wiki.planswift.com/Examples-Of-Some-Formulas

2/4

5/21/13

PlanSwift Wiki - Examples Of Some Formulas

Round(Expression)

Returns a number of the value rounded to the nearest whole number. If X is exactly halfway between two whole numbers (X.5), the result is always the even number. This method of rounding is often called "Bankers Rounding". (Expression) This is a value to be rounded. Example: 0.5 will round to 0 0.75 will round to 1 1.5 will round to 2

Round(([Property]*2) +0.5)/2

Will round to the nearest half. Example: Round(([Takeoff]*2) +0.5)/2 If [Takeoff] was 1.3 result would be 1.5 Returns a number of the value rounded up to the nearest whole number. This method of rounding is called "Round Up" (Expression) This is a value to round up to the nearest whole number. Example: Ceil(1.3) will round to 2 Ceil(1.5) will round to 2 Ceil(2.1) will round to 3 Returns a number of the value rounded down to the nearest whole number. This method of rounding is called "Round Down" (Expression) This is a value to round down to the nearest whole number. Example: Ceil(1.3) will round to 1 Ceil(1.5) will round to 1 Ceil(2.1) will round to 2 Returns the lesser of two numeric values. Expression1 This is a value to be used in the evaluation of finding which value is smaller. Expression2 This is a value to be used in the evaluation of finding which value is smaller. Example: Min(2, 4) will return 2
3/4

Ceil(Expression)

Floor(Expression)

Min(Expression1, Expression2)

wiki.planswift.com/Examples-Of-Some-Formulas

5/21/13

PlanSwift Wiki - Examples Of Some Formulas

Min(10, 5) will return 5 If ('[Stud Length]' = '8') then result := '8 foot stud 26PC' Else If ('[Stud Lenght]' = '10') then result := '10 foot stud 2610' Else Result := 0 If ('[PropertyName]'<= '8') then result := 8 Else If ('[PropertyName]'>= '10') then result := 10 Else Result := 0 Returns a value based off what another property is set to. Then at the end If no value is set in [Stud Length] it will result in a 0 Is a "If Expression" using < Greater or less then > signs. Example: if # is 9 if expression will return 10 if # is 6 if expression will return 8 Nested formula. see the How To - Create A Nested Formulas <--- click to go to the page http://www.planswift.com/kb/entry/285/ <---Link to Expression

[Property1Name[Property2Name]]

Expressions
Copyright 2012 PlanSwift LLC.

wiki.planswift.com/Examples-Of-Some-Formulas

4/4

You might also like