Decimal to Fractional Inches


#1

I am working in Dynamo for the first time and wanted try out batch renaming things as an intro to the program. So as a test i tried to see what i could do with batch renaming text types, but i am having trouble with how length parameters in Dynamo are notated. They are in decimal inches and I want them to be in fractional inches. Is there a way to have something like .09375 say 3/32" instead? Text Rename


#2

Hi Matt,

Can you re-post your graph. Unable to read.


#3


#4

Hi Matt,

Download the latest version of spring nodes and you’ll find two nodes that can handle decimal feet to fractional feet conversions. Keep in mind that the fractional feet are represented as strings.

2015-10-04_15-07-00


#5

Thank you, that worked perfectly.

I have another question I hope has another easy solution with a node. Parameters that are colors in revit, like red/blue/yellow, show up in dynamo as random numbers like 12632256 or 65535. Is there a way to convert it back to the color name so then when i batch rename things the name of the color is in the type name?


#6

Those are the decimal value representation of the colors in Revit. I’ll check if we can translate those to Dynamo colors.

 

EDIT:

Here’s how to convert those values to Dynamo colors. I’ll add it to spring nodes later today:

 

2015-10-05_11-57-34


#7

Thank you so much, your help is greatly appreciated.

I have one last question. What I am trying to make is something that can rename things, like in this instance text types, to company standards because a lot of times once a revit project gets a few months in usually things like text types in a project become very messy if people are not adhering to standards. I figured this would be something that is easy, practical, and a learning experience for a first time dynamo user. I have completed the part that changes the name to company standards, the next step is my question.

If i have two text types in a project that have different names, but have the same parameters when i run the thing i created it renames them both the same name and then there are two text types that have the same name. Is there a way in dynamo to either combine the text types that have the same name or maybe assign all of the text notes in the project to one of the two and purge the other? Thanks

Untitled


#8

How did you manage to have two text types with the same name? :slight_smile:

Yes, that’s quite doable. The below example doesn’t do much filtering, so you’ll want to further expand it before using it:

2015-10-05_16-33-18

 

 

 

 


#9

Some Fractional experiments in python…
Fractional


#10

Basically what happens is when i run the text type renaming script to company standards, if there are multiple text types with different names, but the same parameters they will all get the same name and it causes a glitch in the revit matrix resulting in multiple text types with the same name.

i recreated your example and tried to get it to do what i am trying to accomplish, but i am having trouble with the filtering. How would i replace your 2.5mm Arial example with something that can identify the different duplicate type names, reassign all of text notes to only one of the duplicates and then delete the other unused duplicates? The screen shot below shows the duplicate types. Thank you for all your help.Capture


#11

I am not a big fan of the idea of having multiple text types with identical names because the name is the easiest way to differentiate the individual types. I think that it would be better if you rename your text only after you are done with handling all the duplicates.

If you have a company standard text type, you could create a set of test parameters, that you can compare against and identify every other text type that has identical parameter values like this:

2015-10-06_17-24-26

 

 

 

 

Once you know the duplicates, you can process them as in the previous example.