Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple new IFC with extruded rectangle #18

Open
kbworkza opened this issue Nov 5, 2024 · 1 comment
Open

simple new IFC with extruded rectangle #18

kbworkza opened this issue Nov 5, 2024 · 1 comment

Comments

@kbworkza
Copy link

kbworkza commented Nov 5, 2024

Greetings,
Is there s forum I could post this to?
I just want to include am extruded rectangle in the IFC file (in the Project).
This fails at SHAPEREPRESENTATION - exception value cannot be null
it probably needs a few more objects to complete the inclusion of the extrusion in the Project.

` ifc.Repository.CurrentModel = new ifc.Model(Name: "hello_project_output");
ifc.Project project = new ifc.Project();
project.Name = new ifc.Label("my first ifc-project");
project.EndOfLineComment = new ifc.Label("creating the project");

        ifc.Building building = new ifc.Building(GlobalId: null, Name: new ifc.Label("my first ifc-model"));

        new ifc.RelAggregates(RelatingObject: project, RelatedObjects: new ifc.Set1toUnbounded_ObjectDefinition(building));

        var MRect = new ifc.RectangleProfileDef() {
            ProfileType = ifc.ProfileTypeEnum.AREA,
            XDim = 5.0,
            YDim = 5.0
        };

        var MREx = new ifc.ExtrudedAreaSolid() {
            SweptArea = MRect,
            ExtrudedDirection = new ifc.Direction(0, 0, 1),
            Depth = 5.0
        };

        var SRep = new ifc.ShapeRepresentation() { 
            ContextOfItems = project.RepresentationContexts.FirstOrDefault(),
            RepresentationType = "SweptSold",
            RepresentationIdentifier = "Body",
            Items = new ifc.Set1toUnbounded_RepresentationItem(MREx)
        };

        ifc.Repository.CurrentModel.ToStepFile();

`

@bsbock
Copy link
Collaborator

bsbock commented Nov 26, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants