Hi - I am trying to batch rename Worksets. Admittedly I don’t have much experience with python and am really guessing at the modifications required to rename in batch vs. by single workset.
"
import clr
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
Hmm I don’t see any extraneous apostrophes in the code I pasted so I’m thinking maybe just a copy/paste error? Try deleting all the contents of your Python script node and repasting
This would pop up if you mixed tabs and spaces in the same file. I would just go through it and check that you are consistently using one or the other.
I ran the script above and it worked without error so it must be a copy/paste slip up, but thank you for that info! I read the error quickly and thought I saw “’” (an apostrophe). Good to know in case I run into that error on my end at some point
Ha, my bad. If it’s really just an apostrophe then you are totally right. It would not show that message. Any message about illegal characters or unexpected new line, could be caused by what I was referring to.
I tyring to rename this worksets to uppercase but it appears that the code have an error the python show Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 21, in
TypeError: expected WorksetId, got inttest.dyn (22.7 KB)
Same issue. checked in Cpython3 and same error:
No method matches given arguments for RenameWorkset: (<class ‘Autodesk.Revit.DB.Document’>, <class ‘int’>, <class ‘str’>)
seems workset.Id gives back an int and not the WorksetId element(that RenameWorkset wants).
Hi all, I seem to be having different issue here. The script runs with no warning but it only takes the first character of the intended Workset name. Anyone have a clue what could be causing this ??