Understanding Reference Direction in NewFamilyInstance

Understanding Reference Direction in NewFamilyInstance

ChristianMolino
Enthusiast Enthusiast
183 Views
1 Reply
Message 1 of 2

Understanding Reference Direction in NewFamilyInstance

ChristianMolino
Enthusiast
Enthusiast

Hello all, I am working on a program that will insert family instances of structural connections into the a concrete double tee family. The double tee family has 2 nested families in it, one that is flat and one that is warped. For purposes of inserting, I have the code flatten out the warped tee when it inserts connections and then re-warp it so everything inserts properly.

 

In that flat state, there is still a small amount of camber in the tee so it makes a slight curve creating a cylindrical face while the flat tee is inserting onto a planar face.

 

The connections insert with absolutely no problem on the flat tee in the proper orientation no matter what the rotation of the tee is, however the warped tee I cannot figure out what the rhyme/reason is for the rotation of the connection being inserted. When the NewFamilyInstance is used for both flat and warped tees, it uses the exact same reference direction, yet it seems that they just insert at some other angle in the warped tee (see image below - the flat is the bottom tee and warped is top tee)

 

ChristianMolino_0-1747765128434.png

 

There has to be something I am missing in understanding how the reference direction works. Currently I am just getting the vector direction of the length of the tee and passing that as the reference direction, which works no problem for the planar face but not for the cylindrical one.

 

Thanks in advance!

0 Likes
184 Views
1 Reply
Reply (1)
Message 2 of 2

longt61
Advocate
Advocate

Without the family and the code, it is hard to pin point the cause of the problem. As far as I see it, you have a complex family with complex dimension/ align/ lock/ parameters etc.. From my experience, these kinds of problem generally have 2 main causes:


1. Family template and API confusion/ limitation

   If this is the case, you might need to read the documentation of the family template, remarks of used API to see if there is anything that you might have missed, or the API is used as its original intentions. Some API can be used as  work around, or have some limitation that are hard to explain or pin point the exact issue. For example, the BooleanOperationUtils.Union() method sometime can not combine complex solids such as floors with their vertices elevation modified (you can try this in Revit by create a Floor, then try modify its Sub Elements)

 

2. Errors in Family design

   Yes, it happens. Some families have issues of transformation due to the selection of "define origin" reference plane, some families have issues of finding reference dimensions due to the reference type settings of reference plane, some have issues due to over constrain the locks and dimension in family design, some have rotation issue due to angular dimension is not properly constrained (it might be lock to a movable or extendable line instead of a fixed reference plane, ,therefore when the line is moved or extended, the rotation center point is changed, indirectly making the final rotation wrong), etc ..

 

I hope my suggestions can be of some help. Cheers.

0 Likes