buildingSMART Forums

IfcRelConnectsPortToElement

Previously the connection between a distribution element (eg. Space Heater) and a port was given by the IFC Relation ‘IfcRelConnectsPortToElement’. However BuildingSMART provides in the IFC4 CHANGE that IfcRelConnectsPortToElement is now specialized for use of dynamically connected ports and the normal connection is provided by IfcRelNest. Is it possible to dynamically connect ports in Revit? If yes, what does they mean by this and how is it done. Or does every connection result in the relation IfcRelNest?
IfcRelConnectsPortToElement:(https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifcproductextension/lexical/ifcrelconnectsporttoelement.htm)
IfcRelNest https://standards.buildingsmart.org/IFC/DEV/IFC4_2/FINAL/HTML/schema/ifckernel/lexical/ifcrelnests.htm

IfcRelConnectsPortToElement connect a port to an IfcDistributionElement and all the derived entities.
IfcDistributionElement is derived from IfcProduct, so IfcRelConnectsPortToElement you only can use for IfcDistributionElement-instances, not for types.

If you want to connect a port to a type like IfcPipeSegmentType, IfcRelConnectsPortToElement will not work, because IfcPipeSegmentType is not derived from DistributionElement.

IfcPipeSegmentType is derived from ObjectDefinition and for connecting derived classes of ObjectDefinition works IfcRelNests.

Short:
IfcRelConnectsPortToElement is possible for assigning ports to instances of IfcDistributionElement’s.
IfcRelNests is possible for assigning ports to IfcDistributionElementTypes’s.

Maybe a new entity like “IfcRelConnectsPortToElementType” (with a self explaining name) would have been better than IfcRelNests.
“IfcRelConnectsPortToElementType” also would make sense for a new entity with a constraint only for IfcElementType.
IfcRelNests works for both, IfcElementType and IfcElement, wich both are derved from ObjectDefinition.

1 Like

Thanks for your answer!
Although when I look at a recently exported ifc file from Revit 2020 I get following lines. Here IfcRelNests is used for IfcSpaceHeater.
Did I then used a wrong connection in Revit or did I exported it in a wrong way such that I got IfcRelNest?
Is there any advice how to become IfcRelConnectsPortToElement in my Ifc file (because this is what I need for my export to BEM)?

#524=IFCSPACEHEATER(‘1PNPbO_wTE2RsbEkkPLHIl’,#42,‘RSen_56_ME_FB_radiator_gen_witas:radiator_gen_lxwxd 1200x500x90:9179313’,$,‘RSen_56_ME_FB_radiator_gen_witas:radiator_gen_lxwxd 1200x500x90’,#522,#512,‘9179313’,.RADIATOR.);

#5908=IFCDISTRIBUTIONPORT(‘3KRkZq2vr0$wyy37xd3lVn’,#42,‘InPort_9179313’,‘Flow’,,#5906,,.SINK.,,);

#5936=IFCDISTRIBUTIONPORT(‘3n4bA36ij9v9j8tkfTPYud’,#42,‘OutPort_9179313’,‘Flow’,,#5935,,.SOURCE.,,);

#6636= IFCRELNESTS(‘2peTSwhQD5MR_FB1iJ_QKj’,#42,‘NestedPorts’,‘Flow’,#524,(#5908,#5936));

In addition on the website of BuildingSMART they say:

So my question is if it is still possible to use IfcRelConnectsPortToElement for eg. IfcSpaceHeater? (With this information, it looks like it isn’t)

1 Like

My knowledge around ports isn’t particularly strong, so take my advice with a grain of salt :slight_smile:

My current interpretation is that any IfcDistributionElement or subclass may be associated to a port with IfcRelNests in IFC4. The small STEP code you pasted from Revit looks like compliant IFC behaviour. A port may be connected to another port using IfcRelConnectsPorts.

I also interpret that IfcRelConnectsPortToElement is now less common, but not illegal - it is valid for “dynamically connected ports”.

Specific to your question about Revit, from my understanding the default Revit IFC exporter does not allow you to export an IFC4 with IfcRelConnectsPortToElement, as it defaults to IfcRelNests and assumes a fixed connection. It is not possible to define a dynamic connection in Revit.

In IFC2X3, Revit will default to IfcRelConnectsPortToElement instead, and not allow you to use IfcRelNests.

The particular code that demonstrates this hard-coded logic where fixed ports are assumed is here.

in IFC4 IfcRelNests (an ordered 1:N relationship) shall be used for assigning ports to its parent element. It works for both, ports to an element, and ports to an element type, so that type objects can be published with ports already assigned.

IfcRelConnectsPortToElement is essentially deprecated in IFC4.

1 Like

@TLiebich if IfcRelConnectsPortToElement is deprecated, then the documentation need to be fixed, currently on this page it says nothing about deprecation and in fact specifies how to use it:

The objectified relation IfcRelConnectsPortToElement is now specialized for use of dynamically connected ports.

This page also describe to use it, and so does this page.

There may be more pages in the documentation that need to be fixed.

I would be more than happy to help fix it, if I knew where to submit documentation changes. I was previously told by @jonm that there was a Github branch to do so, but I am now told that that is no longer the case.

Edit: I have moved this proposal into issue 50.

1 Like

Thanks @Moult - this one definitely belongs into the IFC improvement and simplification github theme.

If your reading software needs ifcRelConnectsPortToElement, have you tried to add additional ifcRelConnectsPortToElement-entities at the end of file (before the footer) like the following lines?

#NewLine=IFCRELCONNECTSPORTTOELEMENT(’…’,,,,#5908,#524); #NewLine=IFCRELCONNECTSPORTTOELEMENT('...',,,,#6636,#524);