Results 1 to 2 of 2

Thread: Change Standard Pipes Outer Diameter

  1. #1
    Member
    Join Date
    2013-11
    Posts
    14
    Login to Give a bone
    0

    Default Change Standard Pipes Outer Diameter

    Hello

    I am trying to set a Pipes inner and outer diameter. Currently if the Pipe has a diameter of 150mm, then the Pipe automatically has an inner diameter of 154mm and an outer diameter of 168mm. Our drainage guys are complaining that our addin is bringing in their pipes slightly too low (caused by the outer diameter of the Pipe).

    How can we change a Standard Pipes outer diameter?

    I've made the below attempts but none work. I've tried setting the Pipes inner and outer diameter parameters but these are read only params. I also tried setting the PipeType's inner and outer diameter parameters but these are read only params aswell. Note its not the Pipes insulation thickness thats the cause (because thats 0mm).

    Any ideas how to change a Pipes outer and inner diameter?

    Code:
    // None work
        public Pipe createPipeSetOuterDiameter(Document doc, PipeType pipeType, XYZ strt, XYZ end)
        {
            // Set Pipe Types outer and inner diameter: Fails
            pipeType.get_Parameter(BuiltInParameter.RBS_PIPE_OUTER_DIAMETER).Set(0.49213);
            pipeType.get_Parameter(BuiltInParameter.RBS_PIPE_INNER_DIAM_PARAM).Set(0.49213);
    
            Pipe pipe = doc.Create.NewPipe(strt, end, pipeType);
            pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.55);
    
            return pipe;
        }
    
        public Pipe createPipeSetOuterDiameterTech2(Document doc, PipeType pipeType, XYZ strt, XYZ end)
        {
            Pipe pipe = doc.Create.NewPipe(strt, end, pipeType);
    
            pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.55);
            pipe.get_Parameter(BuiltInParameter.RBS_PIPE_OUTER_DIAMETER).Set(0.49213); // Cannot set inner or outer diameter. Both are read only
            pipe.get_Parameter(BuiltInParameter.RBS_PIPE_INNER_DIAM_PARAM).Set(0.49213);
    
            return pipe;
        }
    
        public Pipe createPipeSetOuterDiameterTech3(Document doc, PipeType pipeType, XYZ strt, XYZ end)
        {
            Pipe pipe = doc.Create.NewPipe(strt, end, pipeType);
            pipe.get_Parameter(BuiltInParameter.RBS_PIPE_DIAMETER_PARAM).Set(0.55);
    
            ICollection<ElementId> insulationIds = InsulationLiningBase.GetInsulationIds(doc, pipe.Id);
            TaskDialog.Show("Number ", insulationIds.Count.ToString()); // Always outputs "Number 0"
    
            foreach (ElementId insulationId in insulationIds)
            {
                Element insEl = doc.GetElement(insulationId);
                Autodesk.Revit.DB.Plumbing.PipeInsulation insulation = insEl as Autodesk.Revit.DB.Plumbing.PipeInsulation;
    
                // Still unable to set the outer diameter just the insulation thickness
                if (insulation != null) {
                    insulation.Thickness = 0.49213; //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());
                }
            }
    
            return pipe;
        }

  2. #2
    Member
    Join Date
    2012-09
    Posts
    34
    Login to Give a bone
    0

    Default Re: Change Standard Pipes Outer Diameter

    You should always think of how things are done in the UI before you try to solve the solution using the API.

    To change pipe inner/outer diameter using the UI, you need to open Manage -> MEP Settings -> Mechanical Settings, and enter the "Segments and Sizes" section of the settings.

    Here, you set the nominal, inner and outer diameter for each pipe material. Each pipe type is assigned a material, and uses the size catalog for that material.

    In the API, it appears that the PipeSegment class is what you are looking for. I see the AddSize method which seems relevant to what you are trying to accomplish.

    I would also take a look at the PipeScheduleType class and the Class property on the PipeType class, which may also be related to what you're trying to accomplish.

    I have not used this class personally, so I'm not entirely sure how to implement what you're looking for. Hopefully this points you in the right direction.
    Last edited by ColinStark; 2014-10-27 at 09:26 PM.

Similar Threads

  1. 2012: Pipes showing Inside diameter in 3d
    By BrenDillon-IHA in forum Revit MEP - General
    Replies: 3
    Last Post: 2011-11-14, 08:47 PM
  2. change in slope of drainage pipes.
    By swapr78 in forum Revit MEP - General
    Replies: 0
    Last Post: 2011-04-22, 04:46 AM
  3. Change Outer edge of polyline color?!
    By rmccarty in forum CAD Standards
    Replies: 4
    Last Post: 2008-08-14, 06:44 PM
  4. Civil 3D 2007 - Change flow direction of pipes
    By t-square in forum AutoCAD Civil 3D - Pipes
    Replies: 2
    Last Post: 2007-05-25, 01:46 PM
  5. Change (one) node structure (MH) dimension using pipes
    By lerada in forum Civil 3D - Civil Design Companion - General
    Replies: 2
    Last Post: 2006-08-01, 03:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •