This is driving me mad now. I have tried every method including OOTB nodes, 3rd party package nodes (Clockwork, GeniusLoci, Rhythm, Bimorph etc) and Revit API that I can find online on Youtube, in this forum, NONE of them work. It’s so screwed to the point I find it’s ghosted.
In short, I need to add multiple drafting views (containing imported CAD symbols) in groups, to different sheets, with my generated sheet name and number.
#1 symptom: using OOTB SheetByNameNumberTitleblockViews, those sheets with my desired name and sheet number appear in sheet list schedule for one second or less, then disappear. Dynamo run shows successful, however returned sheets shows no name and not visible in sheet list schedule/Project Browser
Possible reason:
Warning: Sheet.SetSheetName operation failed. referenced object is not valid. possibly because it has been deleted from the Gtabase, or Its creauon was undone.
#2 symptom: sheet Number already in use
this happens often too, using 3rd party nodes, API, and sometimes OOTB node
#3 symptom: view xxx cannot be added because already on another Sheet (while no sheet was ever created)
Possible solution for error #2: create the sheets first and let Revit automatically assign the sheet name and number. Then change the name and number after the sheets have been created. Make sure your levels/lacing is set correctly when trying to rename and renumber multiple sheets at one time.
As @Garbage_Collector states, without seeing your graph, it will be difficult for us to instruct on what to do for the other errors.
based on the error you posted, some views are too big for the sheet, hence the error. Maybe you can do it one by one and test out which drafting view is causing the error and then figure out why the drafting view is so huge. With a scale of 1000:1, I cant possibly think that your drafting view size will exceed the sheet size but I guess it might be your cad having floating elements which causes that max size
your errors 1-3 were caused by transactional issues… it might be good to end the global transaction in dynamo before trying to create new sheets. I would suggest to make your script work in this manner.
End all transaction
Check the drafting view size range, if exceeds a certain size, don’t proceed and show some indicator that the size is wrong
Check for existing sheetname/sheetnumber, if any exists automatically add a suffix to it (e.g xxx (1))
If everything else complies, proceed to create sheets
edit:
if you do not want to add suffix and want to “replace” the sheet, you will have to do it in python
Yes which I did, the node did not report error, but sheet was not created. In Revit 2023 I could see the same node return a sheet object, but with name empty
P.S. this is a fresh first run on reopened model
#Preparing input from dynamo to revit
sheetnames = ToList(IN[0])
sheetnumbers = ToList(IN[1])
sheet_titleblock = UnwrapElement(IN[2])
draftingviews = ToList(IN[3])
TransactionManager.Instance.EnsureInTransaction(doc)
#Main codes to be within this region
result = []
for sheet_name, sheet_number, drafting_view in zip(sheetnames, sheetnumbers, draftingviews):
newsheet = Autodesk.Revit.DB.ViewSheet.Create(doc, sheet_titleblock.Id)
#before setting name/number check for duplicates
newsheet.Name = sheet_name
newsheet.SheetNumber = sheet_number
sheet_center = XYZ((newsheet.Outline.Max.U - newsheet.Outline.Min.U) / 2, (newsheet.Outline.Max.V - newsheet.Outline.Min.V) / 2, 0)
#before creating viewport, check for the size requirement, you can set your viewscale here if its too big, but its up to you
vp = Autodesk.Revit.DB.Viewport.Create(doc, newsheet.Id, drafting_view.Id, sheet_center)
result.append(newsheet)
#End of region
TransactionManager.Instance.TransactionTaskDone()
TransactionManager.Instance.ForceCloseTransaction()
#Final output
OUT = result
I had similar issues so I decided to solve it with workarounds and building in safeguards.
I think the lacing is broken is this node so I help it along by just using List.OfRepeatedItem.
This only works for 1 view per sheet btw. (I processed this into a code block to save a lot of space and to ‘lock down’ any changes or when it breaks. So no in between lacing issues. The group of nodes work as 1 unit this way)
I basically turn off all annotations in the views so they’re not warping the Viewport Centerpoint.
I also delete all empty sheets that might be occupying the numbers.
I have the following imports:
import clr
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference(‘RevitAPI’)
import Autodesk
from Autodesk.Revit.DB import *
I feel there’s something wrong with my Revit, so I tried to do a fresh new installation. I could launch the uninstall wizard for Revit 2020 and 2021, I chose the repair option, and it succeeded.
However, I could not launch the uninstall wizard for Revit 2022 and 2023. Simply won’t show up. And yes, I did reboot my PC.
which I did, but encountered this error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 21, in
TypeError: DraftingView is not iterable
changed the code a bit further, and now this error:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 35, in
Exception: viewId cannot be added to the ViewSheet.
Parameter name: viewId
Hi we are trying to automate multiple views placement and alignment on to sheets, may I ask if you are aware of any existing solutions that can do this? Thanks in advance