Override Line Pattern Crop Region View

Great to hear and welcome to the Dynamo Forum!

Welcome on board @NoD and good luck for your work! Sharing is important!

Hello! Very new to Dynamo and to the forum. After I open and run the graph, what do I do in Revit to get the crop regions to change per my desired line type?

Thank you, -Kyle

Hi Kchristol,

Once you run the dynamo script, your crop region will be overridden so you dont have to do anything in Revit when you are making changes via Dynamo.

Well I guess it didn’t work but we’re going to continue hiding all crops in the project making it moot.
Thank you!

Hi @kchristol , Can you share an image or your work file to examine better your issue?

1 Like

Hi I am trying to run this script, no warnings came but nothing happened.

Please share below info :
#essential packages required
#updated dynamo script

It looks like you have all needed packages except for Rhythm.

Hi …Thanks it worked for all sections and Elevations …But not working for callouts …

Note: i am not sure if it can override the crop boundaries of Floor Plan/Ceiling Plan.

Regards,
Dipti

Rhythm has some robust nodes for overriding crop regions as well, maybe look for/try those instead.

Hi… Rythm Node for 2021 seems Depreciated. Do we have another node or Workaround for overriding the crop boundary element ?

There is an API based solution here:

As the user mentions you can get a view’s cropbox by dropping 1 below the view Id.

I’ve added a node to the next build of Crumple, but this is the base code for it:

# Made by Gavin Crump
# Free for use
# BIM Guru, www.bimguru.com.au

# Boilerplate text
import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *

# Current doc/app/ui
doc = DocumentManager.Instance.CurrentDBDocument

# Define list/unwrap list functions
def uwlist(input):
    result = input if isinstance(input, list) else [input]
    return UnwrapElement(result)

# Preparing input from dynamo to revit
views = uwlist(IN[0])
thickness = IN[1]

settings = OverrideGraphicSettings().SetProjectionLineWeight(thickness)
outcomes = []

# Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

for v in views:
	cropBoxId = ElementId(v.Id.IntegerValue - 1)
	try:
		v.SetElementOverrides(cropBoxId, settings)
		outcomes.append(True)
	except:
		outcomes.append(False)

TransactionManager.Instance.TransactionTaskDone()

# Output and Changing element to Dynamo for export
# <element>.ToDSType(True), #Not created in script, mark as Revit-owned
# <element>.ToDSType(False) #Created in script, mark as non-Revit-owned

# Preparing output to Dynamo
OUT = outcomes

Note this only works for elevations as Revit cannot override other view crop types.