Add Dimension in a elevation view using a detail line as reference

Hello.

I trying to add dimension to walls and opening in elevations views. I got to obtain de lines of my faces which I will use as a reference. To generate the dimension I am using a script created by Einar_Raknes but this script only accepts 1 line and i need to use as input a list.

Here the script of Einar_Raknes: His node is Dimension Detail Line


#Original code from @Einar_Raknes
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

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

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

doc = DocumentManager.Instance.CurrentDBDocument

#Converting input from Dynamo to Revit
line = UnwrapElement(IN[0]).GeometryCurve

ref = ReferenceArray()
ref.Append(line.GetEndPointReference(0))
ref.Append(line.GetEndPointReference(1))

#Create the dimension in a transaction
TransactionManager.Instance.EnsureInTransaction(doc)

dim = doc.Create.NewDimension(doc.ActiveView, line, ref)

TransactionManager.Instance.TransactionTaskDone()

OUT = dim

Hi @Joze,

There are a lot of custom nodes for dimensioning in the Genius Loci package.

Or you could also set the longest lacing on your custom node.

1 Like

Hi @Alban_de_Chasteigner

I tried to use that node but I couldn’t get it to work. I read that I need the sketchplane in a 2d view therefore I tried to find another solution.

I want to modify the python script to accept a list of lines but I don’t know how to do it.

Can you please confirm if this node works in elevation or section view?

There is no need to do any particular operation with the Revit interface in elevation or section.
You have to define the sketchplane for dimensioning in 3D views.

1 Like

Hello @Alban_de_Chasteigner

Thank you a lot for your help. The script works :smile:

Dear Alban,

I have a problem with the dimension tool of Genius Loci.

I would like to dimension on the floor plan on view range +1500mm1.
When I use the Genius Loci Node of Wall References I get extra dimensions “0” (yellow) and the extra dimensions of another higher void (not in the view range of the floor plan = Red circel).

Could you help me?