From the course: Dynamo for Revit: Python Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Strings

Strings

From the course: Dynamo for Revit: Python Scripting

Start my 1-month free trial

Strings

- [Instructor] In Dynamo, we often need to update revet family parameters, view names, or sheet names by using text, otherwise known as a string. A string data type is essentially, then, text made up of characters which form the complete string object. Let's have a look at creating strings within Python. Go ahead and place a new Python script node and double-click to open it up. We can create strings by first declaring a variable and assigning to it a value with either single or double quotation marks surrounding it, making sure not to combine the two, as this would cause an error. So let's try this with the variable string and the word hello surrounded by double quotation marks. We know this is a string, as it's turned up yellow in color. Let's go ahead and put an output string and run it. Great, so we have a string object in Dynamo. We can perform two arithmetic operations on strings, multiplication and addition. Multiplication simply repeats a string a set amount of times by using…

Contents