Changing Dimension Text Value using Dynamo

Changing Dimension Text Value using Dynamo

suganesh_matrix_a540
Enthusiast Enthusiast
3,229 Views
11 Replies
Message 1 of 12

Changing Dimension Text Value using Dynamo

suganesh_matrix_a540
Enthusiast
Enthusiast

Hello everyone

 

Can anyone guide me on how to change the dimension text value for multiple dimensions at once? Please see the attached image below. I want to toggle between those options using Dynamo.

 

suganeshmatrixa540_0-1691428186482.png

 

0 Likes
Accepted solutions (1)
3,230 Views
11 Replies
Replies (11)
Message 2 of 12

RPTHOMAS108
Mentor
Mentor

I'm not sure you'll find node that will do exactly that, likely you'll have to write a Python node that is using API methods such as:

 

Dimension.ValueOverride
or
DimensionSegment.ValueOverride if it is a multi segment dimension (using Dimension.NumberOfSegments to iterate Dimension.Segments).

 

It will likely set overridden or not depending on if you provide something or null to the ValueOverride property I expect.

 

As with the UI you'll have to provide a text value that isn't something that looks like a number or normal dimension value alone.

0 Likes
Message 3 of 12

suganesh_matrix_a540
Enthusiast
Enthusiast
Thank you for your reply.
I don't know how to use API methods.
0 Likes
Message 4 of 12

RPTHOMAS108
Mentor
Mentor

Ask the question on dynamo forum and perhaps someone will provide a Python code example, it is fairly easy to do. Alternatively become self taught via https://primer2.dynamobim.org/ etc.

 

However generally it is a bad workflow to replace dimension values with text.

0 Likes
Message 5 of 12

L.Maas
Mentor
Mentor

Here a concept.

LMaas_0-1691430299962.png\

LMaas_1-1691430326683.png.

You will have to find a way which dimensions to change

Dimension.SetValueOverride to change the value

Dimension.ValueOverride to ask what the valueoverride is

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

0 Likes
Message 6 of 12

suganesh_matrix_a540
Enthusiast
Enthusiast
Thank you. Will do.
Its just in few locations i need them that way.
0 Likes
Message 7 of 12

suganesh_matrix_a540
Enthusiast
Enthusiast
Thank you for that concept script! Will try it out.
0 Likes
Message 8 of 12

suganesh_matrix_a540
Enthusiast
Enthusiast
How do it change it back to actual value of the dimension if its a text?
0 Likes
Message 9 of 12

L.Maas
Mentor
Mentor
 

Here two ways

LMaas_1-1691432503873.png

 

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

Message 10 of 12

edson.maruyama
Explorer
Explorer

How can you do this if you want to override only a segment of a dimension. Let's say like you want to override the first and last segment.

I know Rhythm can isolate the segments, but I could not find a way to override their values.

0 Likes
Message 11 of 12

RLY_15
Advisor
Advisor
Accepted solution

robert2JCCH_2-1710202022504.png

 

robert2JCCH_3-1710202098480.png

 


Proof of concept. Multi-segment dimensions are lists. The override node also accepts lists.

 

To only override the first/last segment, you can use something like Clockwork package's ReplaceItemAtIndex+ (allows multiple list replacements by indices)

 

EDIT: So I realized after posting that this still overrides the middle values, which is not good if those values change in the model (even if they're initially 'correct'). I'll look around to see if there's a package library that can isolate override state for each list item.

EDIT EDIT:
It's nulls. You put nulls in where you don't want to override the text.

Message 12 of 12

edson.maruyama
Explorer
Explorer

@RLY_15 it worked like a charm!

Used ReplaceByCondition to replace the values I wanted overriden, and to replace the others with null!

Thank you very much!


0 Likes