- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to place a new element next to another element.
To do this I have the target element location, which I use to create the new element in the exact same position, as a start... But here is where thing go wrong!
var targetLocation = targetElement.Location as LocationPoint;
var newElement = doc.Create.NewFamilyInstance(targetLocation.Point, familySymbol, targetElement.LevelId, StructuralType.NonStructural);
When I debug and set a break point after the element has been created newElement has position 0, 0, 0! This gets updated after the transaction has been committed, which is fine I guess...
After the commit the element X and Y-coordinates are correct, but not Z which now is a much larger (I've made sure the targetElement.LevelId is correct for the newElement).
Why has the element got correct coordinates in X and Y but not in Z?
Bonus question: Why is the new element position 0, 0, 0 after creation before transaction has been committed?
I'm currently testing my code with Revit 2018.3.3.
Thanks!
Solved! Go to Solution.