so I should read this as
object.property.function is that the correct syntax?
Because I don’t think I 100% understand the grammar here. Especially because it works different to DesignScript / Code Block language or Excel style formulas where you put the things you need inside the function
String.Replace(string, searchfor, replacewith)
Anyway I went through the code again and simplified it a lot and it all works properly now. Thank you for all the help.
1 Like
Yeah basically.
The grammar is different since it’s python and codeblocks don’t use Python.
We’re doing two things here at the same time. That’s probably whats confusing
We are creating a new string and replacing part of the string to remove the username. To simplify (readability) you could do this:
full_string = document.Title (this gives you the full doc title, including the username)
username = document.Application.Username
anonymous_title = full_string.replace(username, “”)

When you get more used to the code, you won’t do it like this though because you’re most likely not using these strings anywhere else, so writing it in one line is faster and more readable for the trained eye.
I know what it does. I can understand it fine. Reading python code is similar to reading Excel / Revit formulas etc
I just didn’t know python syntax. Sometimes words like Title or Application aren’t referred to at all and you just have to know them that they are properties. So now I have to expand my Revit API and python dictionary knowledge 