Reveals at Ends of Walls
I am working on writing out a macro to create a reveal at each end of a wall, so placing two vertical reveals on a wall, one at the start and one at the end. I've got the concept working on walls that are created individually. Where it seems to have an issue is when i try to use it and there are walls that have been split using the "Split Element" tool in revit. When it encounters those walls it just errors out saying that "Could not create Reveal. Sweep position is outside of its wall. Please check sweep parameters." -
In the image below the wall was one wall and I used split element, then ran the script. Also included is a bit of the code for the placement - it is largely hardcoded and prototypish at the moment but I'm trying to make sure the concept works.
The behavior of the walls that have been more or less "created" from the split element tool is really confusing me. Has anyone run across this and can shed some light?
Thanks
Element wsType; wsType = wsTypeColl.FirstElement(); var wsStart = new WallSweepInfo(WallSweepType.Reveal, true); var wsEnd = new WallSweepInfo(WallSweepType.Reveal, true); Transaction curTrans = new Transaction(curDoc, "Create Reveals"); curTrans.Start(); foreach(Wall tw in tiltWalls) { //create var for location curve LocationCurve lc = tw.Location as LocationCurve; double wallLength=lc.Curve.Length; XYZ direction = tw.Orientation; double angle = direction.AngleTo(-XYZ.BasisX); bool iseast = Math.Abs(angle) < Math.PI/4; //test wall direction if(iseast) { //filter placement direction if(lc.Curve.GetEndPoint(0).Y - lc.Curve.GetEndPoint(1).Y > 0) { wsStart.Distance = 0; wsEnd.Distance = (wallLength-0.5); //wsEnd.DistanceMeasuredFrom.Equals(0) WallSweep.Create(tw,wsType.Id,wsStart); WallSweep.Create(tw,wsType.Id,wsEnd); } else { wsStart.Distance = 0.5; wsEnd.Distance = wallLength; WallSweep.Create(tw,wsType.Id,wsStart); WallSweep.Create(tw,wsType.Id,wsEnd); }