Announcements

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

Get Primary Connector from MEP Family

RickyBell
Enthusiast
Enthusiast

Get Primary Connector from MEP Family

RickyBell
Enthusiast
Enthusiast

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!

0 Likes
Reply
1,149 Views
2 Replies
Replies (2)

ollikat
Collaborator
Collaborator
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.
0 Likes

Revitalizer
Advisor
Advisor

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