Dimension Lists of Grids in a List of Plan Views on a Sheet

Hi All

I am trying to complete a script that dimensions the grids of a list of plan views on a sheet. I have gotten to the final step and want to create the dimensions using the genius loci package. The dimensions do not get created as intended when I run the script. I have tested all possible lacing/level combinations and still cannot get the right results. In the image attached, the dimensions get created using levels 2 - 1 - 2 but with duplications at each position. @Alban_de_Chasteigner
See the .dyn file attached. Ignore the red groups.
Dimension Grids In Plan On Sheet.dyn (240.1 KB)
Thanks for your help. :sunglasses::sunglasses:

I know the image below shows the right setting but for some reason most of the dimensions are transferred to one of the views and the other view get one of the dimensions. Strange.

Hi,

Can you also share your Revit file ?

Hi Alban

Thanks for the response. Please see the files attached.
I have updated the dynamo file as well.
Thanks for your help.
Dimension Grids In Plan On Sheet.dyn (153.8 KB)
Dimension Grids.rvt (5.9 MB)

Hi Alban

I have a hunch as to why this is happening.
The other scripts I have made to dimension views on sheets each only had single lists of levels/grids. The plan views are more complex because they have several lists of grids.
Perhaps the python script in the Genius loci node does not accommodate such complexity?
I have tested the script out for a list of views, each with a single list of grids,
and it works fine here but still does not work for multiple lists of grids.
Please see an updated script attached. There was a minor error.
Thanks.


Dimension Grids In Plan On Sheet.dyn (154.7 KB)

Hi,

Perhaps the python script in the Genius loci node does not accommodate such complexity?

:grimacing:

I think you have over complicated the structure of your lists. One copy of each reference and each line is sufficient.
Longest lacing and @L2 on the input view do the trick.

1 Like

Ahh, I see. Thank you!
The issue I see here is that there might be instances in which there are buildings plans on the same sheet with different grid list lengths; this happens a lot in my office’s use cases.
Will this work in those situations?

Hi Alban

Thanks for all your help.
I have tried your solution, and it does not work when dimensioning views on a sheet with different grid list lengths, which was the point of the script I am trying to complete.
I am trying to achieve this, so people in the office do not have to dimension each view individually. I think it would save a ton of time if all the dimensions could be done on a sheet. My long term goal is to expand this into dimensioning walls, furniture etc., as the office requires.
I have filtered the lists so that only views with at least two parallel grids for dimensioning are taken to the Dimension.ByReferences node from the GeniusLoci package, so the lists fed into the node should yield the intended results.
I would appreciate your advice.
Please see a revised dyn and Revit file attached.
Thanks again

@GavinCrump would you know by any chance how I can fix this? Just asking because I know you have done a few dimensioning tutorials on YouTube. Thanks.

Dimension Grids.rvt (6.0 MB)
Dimension Grids In Plan On Sheet.dyn (205.9 KB)


Unfortunately my time is currently shot, but I’ll try to find some time to come to this. I try to keep my dimensioning tutorials on YouTube conceptual, as every use case is different and I’d never wish to solve them all. Even still, most comments on the videos for dimensions tend to be people asking to solve bespoke dimensioning problems… oy vey.

It all comes down to list structure and use of levels at the end of the day, as well as ensuring your groups of references are parallel and their reference line is perpendicular to that. I think you’ll need to use the following if I recall correctly…

Longest lacing, views at level 1, lines at level 2 (list of lists), references at level 2 (list of list of lists). Might be wrong on views but @L2 doesn’t seem right to me logically on paper, depending how the node itself works internally.

1 Like

Hi Gavin

Thanks for this.
I have already tried that combination of levels on the longest lacing.
Thanks for your help in advance.
Cheers.

1 Like

Hi Gavin.
I would still appreciate your help with this if you have some time.
Thank you.

Looks like the node might not be built to handle this scenario (couldn’t get it to, but might be mistaken). I used Python to add dimensions in multiple views at once as per below. As for all dimension workflows my solution probably wont be a one size fits all, but hopefully shows the list structure Python requires for such a task as well as the iteration guide to achieve such an outcome.

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

# Boilerplate text
import clr

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

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 tolist(input):
    result = input if isinstance(input, list) else [input]
    return result

def uwlist(input):
    result = input if isinstance(input, list) else [input]
    return UnwrapElement(result)

# Preparing input from dynamo to revit
views = uwlist(IN[0])
lines = tolist(IN[1])
refs  = IN[2]
dimtype = UnwrapElement(IN[3])

# Empty lists to use later
refList,dimList = [],[]

# Construct reference array list
for rlist in refs:
	elementsRef = ReferenceArray()
	for ref in rlist:
		elementsRef.Append(ref)
	refList.append(elementsRef)
	

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

# For each view
for v in views:
	# Make a list for dimensions
	dims = []
	# For each line and reference in that view
	for l,r in zip(lines,refList):
		# Make a dimension
		dim = doc.Create.NewDimension(v, l.ToRevitType(), r).ToDSType(True)
		# Append to the list
		dims.append(dim)
	# Add that list to the overall list by view
	dimList.append(dims)

# Finish the transaction
TransactionManager.Instance.TransactionTaskDone()

# Preparing output to Dynamo
OUT = dimList

DimSample R20.rvt (1.3 MB)
DimSample.dyn (24.2 KB)

2 Likes

Hi Bayo,

Another solution with the proper lacing on the Dimension ByReferences custom node.
(@L1 for the input line)


Dimension Grids In Plan On Sheet.dyn (224.1 KB)

2 Likes

Wow. Thank you @GavinCrump and @Alban_de_Chasteigner I will take a look at your solutions and revert. Much appreciated.

1 Like

Hi Alban

I appreciate your help. I did try this solution in the past. The issue here is that the dimensions get duplicated. In some areas, they are duplicated almost three times which would be problematic when manually nudging a dimension, and there are several others underneath.
I would have to try adjusting the python code in the package to suit my use case, as @GavinCrump has suggested. I will let you know when I succeed.
Thank you both for the help.
Thanks.

Hi Bayo,

You’re right. I reworked the node as in the example of @GavinCrump so that it takes into account more scenarii.


Dimension Grids In Plan On Sheet V2.dyn (215.5 KB)

I will do additional tests before publishing it in the package manager.
You can download it on Github or use Gavin’s Python script.

(Replace the old node in C:\Users\%USERNAME%\AppData\Roaming\Dynamo\Dynamo Revit\2.12\packages )

2 Likes

Ahh, thanks so much Alban. I tried modifying Gavin’s code yesterday, but I ran into the same problem; the dimensions were duplicated. It seems the method Create.NewDimension was iterating over every location line for all the views. Hence the duplication. I will take a look at your code and revert. Thanks for the future package update.

Hi @Alban_de_Chasteigner I have tried your solution and it works perfectly. Tried a few scenarios to test it out as well. Thanks for the help.

2 Likes