a) Applying a scope box to views placed on a specific set of sheets. Cropping these Views. Turning the Crop Regions off on these views.
b) Assigning a viewport type to these views (to remove view titles).
c) Aligning the viewports on these sheets using a Template Sheet as a reference. The node I’m using for this function is the “Tool.AlignViewsFromTemplateSheet” from the SteamNodes package.
The script is (almost) working perfectly…
Before running the script my project looks like this (the top left sheet “A1.003 - GROUND FLOOR PLAN” is the 'Template Sheet with the viewport placed in the desired location):
I’ve tried various combinations of sequencing the various parts of the script (Passthrough node, Clockwork Package) to see if it was due to an error of this nature but no luck.
I also tried duplicating the Tool.AlignViewsFromTemplateSheet node to essentially have it run twice in the hope this would automatically run this part of the script twice - but again, no luck.
I know it’s not critical as the script is still working but can anybody shed any light on why this is happening, or what the cause may be?
I had a similar thought, and tried to structure the script in a more linear path as you suggest (that’s what I meant by the below, sorry if that wasn’t clear):
I will try again though just in case I didn’t do it correctly the first time. I’ll let you know how I go.
I think you need to try and use Transaction.Start and Transaction.End to make sure the sheets and views are modified properly and cropped before trying to move them around.
Are the Transaction.Start & Transaction.End nodes you suggest different to the Passthrough node from the Clockwork package in the function they perform?
Yes, they force the start and stop of the transaction in Revit which is modifying the viewport type and crop / scope box settings. It is what commits these changes before continuing on and should resolve your issues
Ok understood. I’ve been trying to do this using the passthrough node. Is there a reason you suggest the transaction nodes instead? Just trying to get a better understanding of all this…
Revit does all of it’s actions using Transaction in the behind the scenes code, and a Dynamo session typically only uses ONE Transaction per run. This means that sometimes grpahs like yours that rely on things being done in an order don’t always work UNLESS you force Dynamo to use Commit (Tansaction.End) and Start (Transaction.Start) a new one. You may also still need the Passthrough to wait on the elements to give the nodes, but they won’t do it on thier own.