Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
Im placing batch family instances by reading cadlink/import instance data into revit, placing instances is working properly, however if i add/try to rotate instances after creation im getting an error saying "cant rotate element into this position", I know there's lot of discussion already about this issue but those solution doesn't seem to solve my problem. Any thoughts? Cheers!
foreach (ImportInstance instance in instances) { Transform transform = instance.GetTotalTransform(); XYZ origin = transform.Origin; XYZ vectorTran = transform.OfVector(transform.BasisX.Normalize()); double rotation = transform.BasisX.AngleOnPlaneTo(vectorTran, transform.BasisZ.Normalize()); rotation = rotation * (180 / Math.PI); if (!selectedSymbol[0].IsActive) { selectedSymbol[0].Activate(); } FamilyInstance newInstance = doc.Create.NewFamilyInstance(origin, selectedSymbol[0], Autodesk.Revit.DB.Structure.StructuralType.NonStructural); Line axis = Line.CreateBound(origin, XYZ.BasisZ); ElementTransformUtils.RotateElement(doc, newInstance.Id, axis, rotation); }
Solved! Go to Solution.