What is curve based family?

What is curve based family?

chendong.jy
Participant Participant
617 Views
4 Replies
Message 1 of 5

What is curve based family?

chendong.jy
Participant
Participant

When I use this API

NewFamilyInstance Method (Line, FamilySymbol, View)

run this 

doc.Create.NewFamilyInstance(line.unwrap(), fis[1].Symbol, views[0])

in PythonRevitShell, 

 

It complained "This method is only applicable for the curve based family."

 

>>> doc.Create.NewFamilyInstance(line.unwrap(), fis[1].Symbol, views[0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
Exception: This method is only applicable for the curve based family.

618 Views
4 Replies
Replies (4)
Message 2 of 5

RPTHOMAS108
Mentor
Mentor

Anything driven by a location curve rather than a location point.

 

However that particular overload has the following information in the RevitAPI.chm.

 

"Add a line based detail family instance into the Autodesk Revit document, using an line and a view where the instance should be placed."

 

Also refer to the exceptions information within RevitAPI.chm as that will provide further guidance for a particular exception encountered.

Message 3 of 5

chendong.jy
Participant
Participant

I guess it caused by the second parameter - FamilySymbol. 

 

And this second parameter - FamilySymbol is not curve based. 

 

Is there a way to check what type of family it is if it's not curve based family?

0 Likes
Message 4 of 5

chendong.jy
Participant
Participant
I searched information "This method is only applicable for the curve based family." in this documentation portal - in https://www.revitapidocs.com/2022/e3bbc463-dccb-6964-e8ef-697c9ed07a27.htm and returned back no result.

Also, I looked through the Exception Namespace from this online doc - in https://www.revitapidocs.com/2022/e3bbc463-dccb-6964-e8ef-697c9ed07a27.htm.

However, this Exception I encountered is a general Exception with some string description. So I also can't find useful information from Revit API exception namespace.
"Exception: This method is only applicable for the curve based family."




0 Likes
Message 5 of 5

RPTHOMAS108
Mentor
Mentor

The exceptions are general covering non-specifics however if you look up the NewFamilyInstance overload you are using you can see the further details of the exceptions expected for that overload at the bottom of the page and why they occur. However as noted above the overload in question describes at the top of the page what it is for.

 

In FamilySymbol.Family you will see:

FamilyCategory = OST_DetailComponents

FamilyPlacementType = CurveBasedDetail

 

However I would suggest you first filter for FamilySymbols of Category  OST_DetailComponents then check the FamilyPlacementType member on the Family member of the objects returned.

 

 

0 Likes