Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get Primary Connector from MEP Family

2 REPLIES 2
Reply
Message 1 of 3
RickyBell
1151 Views, 2 Replies

Get Primary Connector from MEP Family

I'm retrieving family connectors and some of their attributes using this method:  

 

ConnectorSetIterator csi = myFamilyInstance.MEPModel.ConnectorManager.Connectors.ForwardIterator();
while (csi.MoveNext())
{
   Connector myConnector = csi.Current as Connector;
}

 

 

I'd like to query the ConnectorElement.IsPrimary value from each connector.  I can't seem to convert a Connector to a ConnectorElement to get the value.

 

Any help is appreciated!  Thanks!

2 REPLIES 2
Message 2 of 3
ollikat
in reply to: RickyBell

Hi

As far as I known there's no physical relation between Connector object and the corresponding ConnectorElement object.

If you desperately need to know which connector is in question, I think you need to open the family, get the connector element and compare the locations (transforming from coordinate to another is required). Draw back of this approach is that opening the family document is a time consuming process. Another option is to use connector description to identify the different connectors but it's obviously a bit shaky solution (and the Description property was added to Connector class quite recently...I think it was 2015).

Hope these help.
Message 3 of 3
Revitalizer
in reply to: ollikat

Dear ollikat, dear RickyBell,

 

I think comparing the locations will not function.

In the FamilyInstance, Connectors' locations may depend on parameter values.

Parameters may be named with any name, and their "default" locations cannot be evaluated:

 

In the Family, you cannot reconstruct which parameter(s) affects(s) a ConnectorElement.

Only those Connectors' default locations would match with ConnectorElements' locations.

 

So no chance this way.

 

 

Best regards,

Revitalizer

 

 




Rudolf Honke
Software Developer
Mensch und Maschine





Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report