Getting Reference from Connector

Getting Reference from Connector

yushikato
Explorer Explorer
1,111 Views
4 Replies
Message 1 of 5

Getting Reference from Connector

yushikato
Explorer
Explorer

I'm trying to get Reference from Connector in Mechanical Equipment as below.

yushikato_0-1615135687879.png

 

At first, I created a point from Connector origin and get reference from point

but it returns null.

 

 

Reference connectorRef = Point.Create(connector.origin).Reference

 

 

 

 

Next, I'm using GetReferences() from Mecanical Equipment Family Instance. But I'm not sure FamilyInstanceReferenceType for connector. But this method returns null too.

 

 

 

famInstance.GetReferences(FamilyInstanceReferenceType.StrongReference)

 

 

 

Any idea?

0 Likes
1,112 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

A reference provides a persistent reference to persistent piece of existing BIM geometry.

 

If you create a new Point object in memory, it is not persistent, so it cannot provide a reference. It also has nothing to do with the BIM or the database, which is another reason it cannot provide a reference.

  

The second approach looks much more promising.

  

However, the description for StrongReference says, 

  

Reference plane whose "Is Reference" parameter is set to "Strong Reference", or reference line whose "Reference" parameter is set to "Strong Reference". There may be multiple such reference planes and lines in the family. These references are not stable: if there is a dimension to such reference, and the instance's family is replaced, the dimension is not guaranteed to survive.

  

Your connector point is not a plane or a line, so this description cannot apply, so StrongReference is useless for your case.

  

Maybe you will fare better with the GetFamilyPointPlacementReferences method?

  

If a family instance has point placement references then they are returned by this method, otherwise an empty collection is returned. Examples of FamilyInstance objects that contain placement references are Panels and Flexible Components.
   
However, after reading about the above, I looked at the Connector object itself and discovered its AllRefs property:
 
 
That looks much more promising!
 
Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

yushikato
Explorer
Explorer

Thanks @jeremy_tammik 

 

I feel like we're on the same way.

GetFamilyPointPlacementReferences

 

I've tested but it returns empty list. So it's not the way I'm looking for.

 

As my understanding, AllRefs return Connectorset class which contains connector itself, not reference...

Or Is there a way to get Reference class?

0 Likes
Message 4 of 5

jeremy_tammik
Alumni
Alumni

Oh yes, of course you are right there as well. AllRefs returns connectors, not references.

 

Thinking more about this, a connector is not part of the element geometry.

 

Therefore, it is impossible to obtain a reference to it. 

 

Reference objects provide stable references to BIM element geometry, and nothing else.

 

So you cannot get a reference to a connector at all.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 5

snajjar
Contributor
Contributor

I'm dabbling with the same problem trying to dimension MEP elements, and stumbled upon  this observation:

The points for the unconnected connectors of an MEP family instance (a duct fitting for example) can be obtained from the geometry element.

snajjar_0-1624436812824.png

 

But once the family is connected the points will no longer be available

snajjar_1-1624436999699.png

 

For MEPCurves (Ducts, Pipes, etc...) , the points don't show in the geometry element regardless of the connection state.

0 Likes