Dynamo making dimensions changes earlier dimensions

I’m trying to use Dynamo to make dimensions of multiple siding components.
First run works well. The second time I run it in a different view, it creates a new dimension based on new components. Then dimensions in the first run are changed. See screenshots:

#Original code from @Einar_Raknes

import clr
from Autodesk.Revit.DB import *

import Revit

import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

Curve_List = IN[0]
Dim_All = []
Line_2 = IN[1]

opt = Options()
opt.View = doc.ActiveView

for i in range(0, len(Curve_List)):
	#Converting input from Dynamo to Revit
	Line_1 = UnwrapElement(Curve_List[i]).GeometryCurve
	line = UnwrapElement(Line_2[i]).GeometryCurve

	ref = ReferenceArray()

	#Create the dimension in a transaction

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


OUT = Dim_All


Hi @CH_W

Edit: I tested your code in multiple views i didn’t see any changes in first run :thinking:. Try restarting your pc.

@Kulkul - Were your views parallel but reversed normals?

Hi @Kulkul

Thank you for your answer. I tried what you said. Now there is an error "list object has no attribute ‘ToDSType’ "
Then I tried this

for j in range(0, len(Dim_All)):

OUT = Dim_All

It runs without error. But it still gives me the same dimension result. The second dimension is still messed.

I tried to restart PC and Revit. Still the same.

In my case, I’m making dimensions in EAST and WEST elevation. And it doesn’t work. But if I do EAST and SOUTH elevations, it works well.

I have no idea why.

Try using .ToDSType(False) so they aren’t Dynamo :wink: owned elements. This may keep them from changing each run, but it also means you can get duplicates if you run it twice on the same view.

You mean “aren’t Dynamo owned elements.” :slight_smile:

This does sound like an element binding issue. Check the forum as I have a good post from last month on that topic.

1 Like

@CH_W Could you please share rvt file.

And the .dyn. :slight_smile:

Found the post I was referring to before.

Hi @SeanP

I tried .ToDSType(False) then when i run it in the second view, it delete the first dimensions

Hi @jacob.small

I read this post but don’t really understand why it’s related…