Family Instance Point Reference

Family Instance Point Reference

carolina.machado
Advocate Advocate
1,318 Views
2 Replies
Message 1 of 3

Family Instance Point Reference

carolina.machado
Advocate
Advocate

Hello!

 

I am using the solution from "The Building Coder" (below) to get the point reference from family instances and I noticed that some families does not have a point reference. Why is that so? Is there another way to get point reference. Can I create a point reference?

 

Thank you in advance.

 

  static Reference GetFamilyInstancePointReference(
    FamilyInstance fi )
  {
    return fi.get_Geometry( _opt )
      .OfType<Point>()
      .Select<Point, Reference>( x => x.Reference )
      .FirstOrDefault();
  }

 

0 Likes
1,319 Views
2 Replies
Replies (2)
Message 2 of 3

RPTHOMAS108
Mentor
Mentor

Is this code related to an adaptive component family, this is only template with point references as far as I know?

 

In general for most family instances Location (Element.Location) is Inherited by LocationPoint and LocationCurve so if you try to cast to one and get null then it is likely the other.

 

Some family instances don't have a location, see recent thread below:

 

https://forums.autodesk.com/t5/revit-api-forum/why-is-element-location-null-for-perfectly-valid-fami...

0 Likes
Message 3 of 3

carolina.machado
Advocate
Advocate

@RPTHOMAS108, it's not an adaptative component family... What I'm trying to do is get some point reference to transform into a Reference so I can create a dimension using it. The families with I intend to do this usually are Plumbing Fixtures, Pipe Accessories or Pipe Fittings.

Until now I didn't have problem to get the Location Point, but I thank you to let me know that this can be a problem in the future.

 

I was using the Revit Lookup (from The Building Coder) to snoop this families and below are the diference:

Withour Point ReferenceWithour Point Reference

 

With Point ReferenceWith Point Reference

 

 

 

0 Likes