Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Insulation Thickness For Pipe

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
nitinjambhale
1587 Views, 3 Replies

Insulation Thickness For Pipe

Hello All,

Anybody knows how to set "Insulation Thickness" to Pipe. It is showing read only.

 

Please help.

 

Regards,

Nitin J.

3 REPLIES 3
Message 2 of 4
ollikat
in reply to: nitinjambhale

Not sure what version of Revit you are using. But at least in Revit 2013 API the InsulationLiningBase has property Thickness and it has public set().

Message 3 of 4
nitinjambhale
in reply to: ollikat

Hi,
looking for the same version. but does not know how to use that.

 

Regards,
Nitin J.

Message 4 of 4
Anonymous
in reply to: nitinjambhale

Here's a quick macro to access the insulation of a pipe.  This is for Revit 2012.

For Revit 2013, change any instances of doc.get_Element to doc.GetElement

 

The proper way to limit the selection of an element is to use an ISelectionFilter as an argument of uidoc.Selection.PickObject, but for the purposes of this macro I've cheated a little and done a quick check afterwards to ensure the element is a pipe.

 

 

 

public void InsulationTest()
        {
            UIDocument uidoc = this.ActiveUIDocument;
            Document doc = uidoc.Document;

            Reference reference = uidoc.Selection.PickObject(ObjectType.Element, "Pick a pipe");

            Element el = doc.GetElement(reference);

            if (!(el is Autodesk.Revit.DB.Plumbing.Pipe)) return;

            ICollection<ElementId> insulationIds = InsulationLiningBase.GetInsulationIds(doc, reference.ElementId);

            foreach (ElementId insulationId in insulationIds)
            {
                Element insEl = doc.get_Element(insulationId);

                Autodesk.Revit.DB.Plumbing.PipeInsulation insulation = insEl as Autodesk.Revit.DB.Plumbing.PipeInsulation;

                if (insulation != null)
                {
insulation.Thickness = 0.5; //Set value to whatever you want here, value is always in feet, regardless of the units of your model TaskDialog.Show("Thickness", insulation.Thickness.ToString()); } } }

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community