GeometryGym / GeometryGymIFC

C# classes to generate and parse OpenBIM IFC files
Other
269 stars 97 forks source link

Cannot connect IfcCurveSegment with IfcShapeRepresentation #36

Open seb-esser opened 3 years ago

seb-esser commented 3 years ago

I'm trying to assign an IfcCurveSegment as the representation of an IfcAligmentSegment (according to RC2)

grafik

It seems to be a problem with some IfcGeometricRepresentationContext link. Would you mind spending a look? I am working on the Nuget-Package atm.

jmirtsch commented 3 years ago

HI Sebastian,

I did push an update to the nuget package and opensource repository today. I didn't add a shaperepresentation constructor that takes a single curve segment although I can for the next release. You can use some code like this though in the meantime:

IfcGeometricRepresentationSubContext axisContext = database.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis);

alignmentSegment.Representation = new IfcProductDefinitionShape(new IfcShapeRepresentation(axisContext, curveSegment, ShapeRepresentationType.Curve2D));