Message 1 of 3
Wall.Create throwing exception

Not applicable
12-18-2012
06:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having trouble figuring out why the new Wall.Create method is throwing an ArgumentNullException against my curve. What's throwing me off is that the deprecated method of creating a wall works just fine with the same curve.
I'm getting the curve from another element's location property (and previously ensuring it has a curve based location and not a locationpoint)
LocationCurve lCurve = (LocationCurve)elem.Location; curves.Append(lCurve.Curve);
My curve is not null and is of type Autodesk.Revit.DB.Line (see attachment) but throws an exception when I try to create a wall using the static Wall.Create method.
foreach (Curve c in curveArray) {
// This works but is deprecated Wall w = uidoc.Document.Create.NewWall(c, uidoc.ActiveView.GenLevel, false);
// This throws an ArgumentNullException (see attachment) Wall wall = Wall.Create(uidoc.Document, c, uidoc.ActiveView.GenLevel.Id, false); }
Is there something else that changed with the new Wall.Create method or am I missing something else? Has anyone else seen this?