Sketchy Lines Graphic Display

Hey,

I’m working on a set of planning documents. I would really like for my linked Revit Model of the site context to appear with the Graphic Display options of Sketchy Lines in all views. That the default for the linked model is sketchy lines in the host model.

I can find the graphic override node, but that’s not quite what I’m after.

Hi @geordiedylan

Im assuming you only want to affect the graphics of the linked model and not the host. If so, I’m not sure there is a dynamo solution to this tbh as I think this functionality would be very much locked into revits graphical behaviour with limited to no API support.

A traditional solution might be using linked views. Graphical overrides tend to follow through when linking by view, however, I’ve never tried that with sketchy lines. If that fails then you can do multiple viewport overlays on sheet. Of course, these require a bit of work, but doable.

But if someone has a dynamo solution though, I’m all ears!

Cheers,
Dan

Hey Daniel,

Thanks for the response, you may be right. I was hoping that there may be a way to access sketchy lines in a similar was as visibility overrides, but that seems like it may not be possible.

View template perhaps?

Oh, you can certainly access them (in the host doc only) and here is how it can be done with Python, i couldn’t seem to find a node for it so made one…

View.SetSketchyLines

import clr

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc =  DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

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

def tolist(obj1):
	if hasattr(obj1,"__iter__"): return obj1
	else: return [obj1]

def ClampValue(val):
	val = int(val)
	if val < 0: val = 0
	if val >10: val = 10
	return val

# In Variables...
views = tolist(UnwrapElement(IN[0]))
enabled = tolist(IN[1])[0]
ext = tolist(IN[2])[0]
jitter = tolist(IN[3])[0]

# Out Variables...
outList = []

# Main Body...
TransactionManager.Instance.EnsureInTransaction(doc)
for v in views:
	try:
		vdsl = v.GetSketchyLines()
		vdsl.EnableSketchyLines = enabled
		vdsl.Extension = ClampValue(ext)
		vdsl.Jitter = ClampValue(jitter)		
		v.SetSketchyLines(vdsl)		
		outList.append("Success")
		
	except Exception,e:
		outList.append("Failed:\n" + e.message)
	
TransactionManager.Instance.TransactionTaskDone()	

OUT = outList


SetSketchyLines.dyn (6.8 KB)

However, as mentioned, this can only set the sketchy lines of the actual doc it is run in (not a linked doc). Also, it really depends on whether Revit does not just override these in the host model you are linking into (if that makes sense).

As @jacob.small mentions, you could also use view templates too. But i would conclude with, yes, it is possible to set sketchy lines. But i’m not sure this will help you.

3 Likes

Thanks for all the comments. Daniel the script is certainly useful. I can access a lot of things in the view template but I can’t seem to access sketchy lines. It’s okay, it’s not crucial to the presentation, but I thought it would be a nice effect to focus attention on the project more than the linked context model.