Can't create wall foundation

Can't create wall foundation

Sydra7
Contributor Contributor
814 Views
1 Reply
Message 1 of 2

Can't create wall foundation

Sydra7
Contributor
Contributor

Sample code:

public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{

try
{
var document = commandData.Application.ActiveUIDocument.Document;

 

Transaction transaction = new Transaction(document, "Create Footing");
transaction.Start();

var wall = (new FilteredElementCollector(document).OfClass(typeof(Wall))).ToList()[0] as Wall; //I placed a wall with hand!

 

var foundationType = document.GetElements<ContFootingType>().ToList()[0];

 

var continuousFooting = document.Create.NewFoundationWall(foundationType, wall);

 

transaction.Commit();
}

catch
{
return Result.Failed;
}

return Result.Succeeded;
}

Exception:

"A first chance exception of type 'System.Runtime.InteropServices.SEHException' occurred in RevitAPI.dll

Additional information: External component has thrown an exception."

What is wrong with the footing creation?

(I use Revit 2013 API)

Regards
David Schmidt

0 Likes
Accepted solutions (1)
815 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear David,

I am sorry to inform you that there was an issue with the NewFoundationWall method in Revit 2013.

It has been fixed in Revit 2014.

I found this information searching through my old ADN issues and encountering case 07700489 [Error when creating a new foundation wall] and SPR #230113 [NewFoundationWall does not work] that I explored back in October 2012.

Sorry for the bad news for Revit 2013, and happy to let you know it should work fine in Revit 2014.

Best regards,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes