Message 1 of 12
New Alignment Method does not work
Not applicable
01-27-2020
01:29 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I´m working with the NewFamilyInstance method, using Lines (to create FamilyInstances) and Face (To rotate and place correctly). That works perfectly. But I have problems in some scenarios, for example, the host that has a slope.
I would need to correct the alignment, getting a new face as a reference, similar to use Align function in Revit.
This is my code, I didn`t have any description of the problem, just the line that causes the exception.
Reference reference3 = uiDoc.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Face, "Select Face 1");
Reference reference4 = uiDoc.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Face, "Select Face 2");
using (Transaction transaction = new Transaction(doc, "Align"))
{
transaction.Start();
doc.Create.NewAlignment(doc.ActiveView, reference3, reference4);
transaction.Commit();
}
