Element.AddInsulation problem (custom node) - INPUT PROBLEM

Translated by moderator. Original post below the line.


Good morning,
I just worked on the subject because I had an error in the value of the insulation thickness. The problem came from the script which works by default with millimeters.

The PipeInsulation.Create class seems to only work with feet. Hence the script:

unittype = SpecTypeId.Length
dut = doc.GetUnits().GetFormatOptions(unittype).GetUnitTypeId()
bool = dut == UnitTypeId.Centimeters
size = map(lambda x:UnitUtils.Convert(x,UnitTypeId.Centimeters,UnitTypeId.Feet) if bool else x, size)

Then just replace Millimeters with the unit of length in REVIT units, as I just did with Centimeters.


Original post below


Bonjour,
Je viens de travailler sur le sujet car j’avais une erreur dans la valeur de l’épaisseur d’isolation. Le problème venait du script qui fonctionne par défaut avec des milimètres.

La class PipeInsulation.Create à l’air de ne fonctionner qu’avec des pieds. D’où le script:

unittype = SpecTypeId.Length
dut = doc.GetUnits().GetFormatOptions(unittype).GetUnitTypeId()
bool = dut == UnitTypeId.Centimeters
size = map(lambda x:UnitUtils.Convert(x,UnitTypeId.Centimeters,UnitTypeId.Feet) if bool else x, size)

Il suffit alors de remplacer Millimeters par l’unité de longueur dans les unités REVIT, comme je viens de le faire avec Centimeters.

Welcome to the forum and thanks for the handy tip for future visitors @f.rullon.cosym!

Please be sure to translate future posts to english in the future as I did above via google translate or similar. This is a technical requirement unfortunately, as otherwise search won’t work (you can imagine how difficult it would be to find something like this post if having to search for 22 different versions of the word ‘insulation’).