Runtime Error when creating a FamilyInstance

Runtime Error when creating a FamilyInstance

Anonymous
Not applicable
424 Views
3 Replies
Message 1 of 4

Runtime Error when creating a FamilyInstance

Anonymous
Not applicable

Hello

 

I am creating a FamilyInstance that is very similar to a pipe, ie, is a cylinder with a start and end point. I am using the function NewFamilyInstance(Line, FamilySymbol, View).

 

My Problem: When I create my FamilyInstance using the aforementioned function I get a runtime error: "This method is only applicable for the curve based family".

 

Some background information; I am running my addin in revit 2013 and my addin is compiled using Revit 2013 DLL's (RevitAPI & RevitAPIUI). The family/family symbol I am loading is pretty much the following family that has been expanded: C:\ProgramData\Autodesk\RVT 2014\Libraries\Australia\Structural Framing\Steel\Robobat Specific\Pipes.rfa

 

Do you know what is going wrong and how I can successfully create my FamilyInstance (that is very similar to a pipe). Note I need to specify the FamilyInstances's strart and end points which is why I am using this specific NewFamilyInstance function version.

 

Line pipeGeom       = doc.Application.Create.NewLine(strt, end, false);
FamilyInstance pipe = doc.Create.NewFamilyInstance(pipeGeom, pipeSymbol, uiDoc.ActiveView); // Error occurs here

 

 

0 Likes
425 Views
3 Replies
Replies (3)
Message 2 of 4

augusto.goncalves
Alumni
Alumni

Just checking: was the family created with a 'line based' template? Such as 'Metric Generic Model line based.rft'?

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes
Message 3 of 4

Anonymous
Not applicable

Thanks for your reply 🙂 The family I am using is actually one that is there when I install Revit. So the family hasn't been created or altered by myself. I'm not sure how to determine what template a family uses/used though?

 

The family is located at: C:\ProgramData\Autodesk\RVT 2013\Libraries\Australia\Structure\Structural\Framing\Steel\Robobat Specific\pipes.rfa

 

 

0 Likes
Message 4 of 4

augusto.goncalves
Alumni
Alumni

When you open the .rfa, is there one Reference Line where the family starts?

 

Or when you insert, the Element.Location property is of type LocationCurve?

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes