Roof Default Thickness to new text parameter


#1

Hi,

as you know a roof has default thickness, but when we add a variable layer to it and modify that, that default thickness goes blank in schedule.

i created text based parameter called Thickness for roofs so i can manually enter that number there but i have a problem, i’d appreciate any help/ideas.

thanks


#2

What does the error say?


#3

Untitled


#4

Well there ya go. That parameter type is not a string. It’s likely a number so you’ll have to convert your “Default Thickness” value before applying it to your new “Thickness” parameter.


#5

same error


#6

Other way around. You need to convert the string (Default Thickness) to a number.


#7


#8

Are you working in metric? Could be a units issue. It would be helpful if you showed more info.


#9

i work in millimetric


#10

i renamed my text based parameter to Thickness 2 and now this is the error
Untitled


#11

this shouldn’t be zero!


#12

That’s on the Revit end. You’ll have to look at your roof types.


#13

have only 1 roof type and the thickness is 494


#14

Ah. It’s because you’re trying to get a type parameter from an instance. You’re actually getting a value of null that’s converting to 0. Is Thickness/Thickness2 an instance parameter or a type parameter? You’ll want to get the Default Thickness value from the Roof Type then assign the Thickness value to either the same Type or the Instance depending on the parameter. You’ll probably need something like Element.Type to get the instance’s type.


#15

there are 3 parameters

1- Thickness which is instance, revit default and not editable in properties panel and is locked to Default Thickness.
2- Default Thickness which is a Type Parameter and changes based on the structure layer thickness
3- Thickness 2 which is a text based type parameter that i created.


#16

I gotcha. I was a little confused by your parameters. You’ll need to work with the element Types and not the instances.


#17

first it said the text parameter should be number,
i changed it to number and based on thickness, thickness 2 changed to 0
then i changed it to default thickness and this is the error i get


#18

and just to mention, i can not use the instance parameter (Thickness)
cuz when i modify the roof with variable layers and points, it changes to 0!
so i have to get Default Thickness which is always a number and Type parameter.


#19

Nick,

although it runs with error but it works!!!

the error says the parameter’s storage type is not a string, but it changes the number for me, so i’m good i guess … lol


#20

try after the node Element.GetParamterValueByName the archilab node ToDouble and use that as input in value
Probably some rooftype have no Default Thickness the node ToDouble create in that case a zero and the OOTB node string.ToNumber creates null