pipe dimensions

pipe dimensions

Anonymous
Not applicable
836 Views
2 Replies
Message 1 of 3

pipe dimensions

Anonymous
Not applicable

Dear Members,

Trying to create dimension for a pipe.

using (Transaction tx = new Transaction(doc))
            {
                tx.Start("Transaction Name");
                foreach (ElementId eid in sel.GetElementIds())
                {
                    //Debug.Print(e.Name);
                    try
                    {
                        SketchPlane sketch = doc.ActiveView.SketchPlane;
                        Pipe pp = doc.GetElement(eid) as Pipe;
                        LocationCurve lc = pp.Location as LocationCurve;
                        Line newLine2 = Line.CreateBound(lc.Curve.GetEndPoint(0) , lc.Curve.GetEndPoint(1));
                        ReferenceArray ra = new ReferenceArray();
                        ra.Append(newLine2.GetEndPointReference(0));
                        ra.Append(newLine2.GetEndPointReference(1));
                        int tt = pp.ConnectorManager.Connectors.Size;
                        Dimension newDimension = doc.Create.NewDimension(doc.ActiveView, newLine2, ra);
                    }
                    catch (Exception ee)
                    {
                        
                       
                    }
                }

                tx.Commit();
            }

Error:Inavlid Number of references

Thanks & Regards

Sanjay Pandey

0 Likes
837 Views
2 Replies
Replies (2)
Message 2 of 3

recepagah12
Advocate
Advocate

I think this is your solution.

End Point Reference

 

I hope this helps,

Recep.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Yes That did the trick.

But its not creating dimension for vertical pipes.

Thanks & Regards

Sanjay Pandey

0 Likes