简体   繁体   中英

Create Dimensions from edge of wall, to sides of openings, to other edge of wall

I've been struggling with this issue off and on for the better part of a year. As the title says, i wish to dimension from one side of a wall, to both sides of openings (door openings), then terminate at the other end of the wall (vertically and horizontally). I also wish to dimension to all families hosted in the wall, but i have been able to accomplish this using ScottWilson's voodo magic helper class. Found Here: http://thebuildingcoder.typepad.com/blog/2016/04/stable-reference-string-magic-voodoo.html

foreach (ElementId ele in selSet) {
            FamilyInstance fi = doc.GetElement(ele) as FamilyInstance;
            Reference reference = ScottWilsonVoodooMagic.GetSpecialFamilyReference(fi,ScottWilsonVoodooMagic.SpecialReferenceType.CenterLR,doc);
            refs.Append(reference);
            pts[i] = ( fi.Location as LocationPoint ).Point;
            i++;
        }

        XYZ offset = new XYZ(0,0,4);
        Line line = Line.CreateBound( pts[0]+offset, pts[selSet.Count - 1]+offset );


        using( Transaction t = new Transaction( doc ) )
        {
            t.Start( "dimension embeds" );
            Dimension dim = doc.Create.NewDimension(doc.ActiveView, line, refs );
            t.Commit();
        }

The problem lies in determining the appropriate stable references to the wall faces. I am able to find all faces on a wall, but this gives me 100+ faces to sort through.

If anyone can help me it would be greatly appreciated!

Side note: The closest of gotten is using a casting a ray trace through my panel, then using a reference intersector method to determine references. But i'm really struggling with implementation: http://thebuildingcoder.typepad.com/blog/2015/12/retrieving-wall-openings-and-sorting-points.html

These two posts should provide more than enough to solve all your issues:

Basically, you need to obtain references to the faces or edges that you wish to attach the dimensioning to. These references can be obtained in several ways. Two common and easy approaches are:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM