family instance on reference plane with API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Trying to place a family instance of electrical fixture onto a reference plane with Revit 2013 API. I get the following ArgumentsInconsistentException "Reference direction is parallel to face normal at insertion point.", "Parameter name: multiple".
using (Transaction trans = new Transaction(Doc, "TEST")) { trans.Start();
XYZ bubbleEnd = new XYZ(5, 0, 0); XYZ freeEnd = new XYZ(-5, 0, 0);
XYZ cutVec = new XYZ(0, 0, 1);
ReferencePlane plane1 = Doc.Create.NewReferencePlane(bubbleEnd, freeEnd,
cutVec, Doc.activeView) //floor plan, top-down view
XYZ refDir = new XYZ(0, 0, -1);
FamilySymbol fs = new FilteredElementCollector(Doc)..yada..get duplex receptacle familysymbol
FamilyInstance fi = Doc.Create.NewFamilyInstance(plane1.Reference, XYZ.Zero, refDir, fs);
trans.Commit(); }
The reference plane drawn is a vertical reference plane stretching length-wise along the world x-axis and height-wise along the world z-axis. If I were to add a receptacle using the revit interface it would connect on the -y face of the reference plane...the underside of the plane if looking down on the floor plan. I've tried every possible reference direction for the newfamilyinstance in the code. I tried refDir as positive and negative for each X, Y, and Z axis...and not one reference direction worked. I also made an exact replica command as Jeremy's post here... http://thebuildingcoder.typepad.com/blog/2012/02/hosting-a-light-fitting-on-a-reference-plane.html and nothing worked here either. Always the same above-mentioned exception.
Any help is appreciated.