private void Initialize(IfcStore model)
        {
            units    = new UnitAssignmentRelation(model);
            material = new Material(model, "S235J0");

            //creating main project axis
            CartesianPoint3D  point    = new CartesianPoint3D(model, 0, 0, 0);
            DirectionVector3D mainAxis = new DirectionVector3D(model, 0, 0, 1);
            DirectionVector3D refAxis  = new DirectionVector3D(model, 1, 0, 0);

            projectAxis = new PlacementAxis3D(model, point, mainAxis, refAxis);
            context     = new GeometricRepresentationContext(model, "Model", 3, 0.00001, projectAxis);
            subContext  = new GeometricRepresentationSubContext(model, "Body", "Model", Xbim.Ifc2x3.RepresentationResource.IfcGeometricProjectionEnum.MODEL_VIEW, context);

            //creating project
            project = new Project(model, "RevitProject", context, units);

            //creating site
            sitePlacement = new LocalPlacement(model, null, projectAxis);
            site          = new Site(model, "Site", sitePlacement, IfcElementCompositionEnum.ELEMENT, 0);



            PostalAddress post = new PostalAddress(model, "IN YOUR MOMMA ROOM");

            buildingPlacement = new LocalPlacement(model, sitePlacement, projectAxis);
            building          = new Building(model, "Building", buildingPlacement, IfcElementCompositionEnum.ELEMENT, post);

            stories = new List <BuildingStorey>();

            InitializeRelations();
        }
        public RectangularCrossSection(ModelOptions modelOption, double x, double y, double depth)
        {
            //Position of the 2D rectangular section (Will remain fixed).
            CartesianPoint2D  p           = CartesianPoint2D.Origin(modelOption.Model);
            DirectionVector2D v           = DirectionVector2D.UnitX(modelOption.Model);
            PlacementAxis2D   postion     = new PlacementAxis2D(modelOption.Model, p, v);
            RectangleProfile  rectProfile = new RectangleProfile(modelOption.Model, x, y, Xbim.Ifc2x3.ProfileResource.IfcProfileTypeEnum.AREA, postion);


            //Local placement of the 3D definition shape of the column(Will remain fixed).
            CartesianPoint3D    Expoint        = CartesianPoint3D.Origin(modelOption.Model);
            DirectionVector3D   exMain         = DirectionVector3D.UnitZ(modelOption.Model);
            DirectionVector3D   exReff         = DirectionVector3D.UnitX(modelOption.Model);
            PlacementAxis3D     Exaxis         = new PlacementAxis3D(modelOption.Model, Expoint, exMain, exReff);
            DirectionVector3D   extVec         = DirectionVector3D.UnitZ(modelOption.Model);
            ExtrudedAreaSolid   solid          = new ExtrudedAreaSolid(modelOption.Model, depth, rectProfile, extVec, Exaxis);
            ShapeRepresentation representation = new ShapeRepresentation(modelOption.Model, modelOption.Environment.SubContext, new List <ExtrudedAreaSolid>()
            {
                solid
            });

            ProductShape = new ProductionDefinitionShape(modelOption.Model, new List <ShapeRepresentation>()
            {
                representation
            });



            //Local placement of the object placement of the column (This will be manipulated according to Autodesk Revit readings).
            CartesianPoint3D  point     = CartesianPoint3D.Origin(modelOption.Model);
            DirectionVector3D main      = DirectionVector3D.UnitZ(modelOption.Model);
            DirectionVector3D reff      = DirectionVector3D.UnitX(modelOption.Model);
            PlacementAxis3D   axis      = new PlacementAxis3D(modelOption.Model, point, main, reff);
            LocalPlacement    placement = new LocalPlacement(modelOption.Model, modelOption.Environment.Stories.FirstOrDefault().LocalPlacement, axis);
        }
        public TeklaPlatePlacementInitializer(IfcStore model, Model_info.Environment env, Point origin, Vector main, Vector reff)
        {
            this.origin = new CartesianPoint3D(model, origin.X, origin.Y, origin.Z);
            this.main   = new DirectionVector3D(model, main.X, main.Y, main.Z);
            this.reff   = new DirectionVector3D(model, reff.X, reff.Y, reff.Z);

            PlacementAxis3D axis = new PlacementAxis3D(model, this.origin, this.main, this.reff);

            localPlacement = new LocalPlacement(model, env.Stories.FirstOrDefault().LocalPlacement, axis);
        }
        public Building(IfcStore model, string name, LocalPlacement localPlacement, IfcElementCompositionEnum compositionType, PostalAddress postalAdress)
        {
            ifcBuilding = model.Instances.New <IfcBuilding>(p =>
            {
                p.Name            = name;
                p.ObjectPlacement = localPlacement.IfcLocalPlacement;
                p.CompositionType = compositionType;
                p.BuildingAddress = postalAdress.IfcPostalAdress;
            });

            this.name            = name;
            this.localPlacement  = localPlacement;
            this.compositionType = compositionType;
            this.postalAdress    = postalAdress;
        }
Esempio n. 5
0
        public Site(IfcStore model, string name, LocalPlacement localPlacement, IfcElementCompositionEnum compositionType, double relativeElevation)
        {
            ifcSite = model.Instances.New <IfcSite>(p =>
            {
                p.Name            = name;
                p.ObjectPlacement = localPlacement.IfcLocalPlacement;
                p.CompositionType = compositionType;
                p.RefElevation    = relativeElevation;
            });

            //this.ownerHistory = ownerHistory;
            this.name              = name;
            this.localPlacement    = localPlacement;
            this.compositionType   = compositionType;
            this.relativeElevation = relativeElevation;
        }
        public BuildingStorey(IfcStore model, string name, LocalPlacement localPlacement, IfcElementCompositionEnum compositionType, double elevation)
        {
            this.Model = model;

            ifcBuildingStorey = model.Instances.New <IfcBuildingStorey>(p =>
            {
                p.Name            = name;
                p.ObjectPlacement = localPlacement.IfcLocalPlacement;
                p.CompositionType = compositionType;
                p.Elevation       = elevation;
            });

            this.name            = name;
            this.localPlacement  = localPlacement;
            this.compositionType = compositionType;
            this.elevation       = elevation;
        }
Esempio n. 7
0
        public TeklaPlate(ModelOptions modelOption, LocalPlacement objectPlacement, double xDimension, double yDimension, double depth, string name = "COLUMN")
        {
            this.Model = modelOption.Model;
            RectangularCrossSection section = new RectangularCrossSection(modelOption, xDimension, yDimension, depth);

            this.productRepresentation = section.ProductShape;
            this.name            = name;
            this.description     = productRepresentation.Representations[0].ExtrudedSolidList[0].Profile.ProfileName;
            this.objectType      = description;
            this.objectPlacement = objectPlacement;


            ifcColumn = Model.Instances.New <IfcColumn>(c =>
            {
                c.Name            = name;
                c.Representation  = productRepresentation.IfcProductionDefShape;
                c.ObjectPlacement = ObjectPlacement.IfcLocalPlacement;
                c.ObjectType      = objectType;
                c.Description     = description;
            }
                                                        );
        }
Esempio n. 8
0
 public RobotComponentBean(int id, string name)
 {
     this.localPlacement = null;
     this.name           = name;
     this.id             = id;
 }
Esempio n. 9
0
 //CONSTRUCTOR
 public RobotComponentBean(int id, string name, LocalPlacement localPlacement)
 {
     this.localPlacement = localPlacement;
     this.id             = id;
     this.name           = name;
 }
        static void Main(string[] args)
        {
            //CHANGE PATH HERE.
            string path = @"C:\Users\Scorias\Desktop\IFC trails";

            var editor = new XbimEditorCredentials
            {
                ApplicationDevelopersName = "xBIM Team",
                ApplicationFullName       = "xBIM Toolkit",
                ApplicationIdentifier     = "xBIM",
                ApplicationVersion        = "4.0",
                EditorsFamilyName         = "MoSalah",
                EditorsGivenName          = "sane",
                EditorsOrganisationName   = "Independent"
            };

            RevitSeeker seeker;

            string filename = "RF";
            string filepath = @"C:\Users\Scorias\Desktop\IFC trails";

            using (var stepModel = IfcStore.Open($"{filepath}\\{filename}.ifc"))
            {
                seeker = new RevitSeeker(stepModel);
            }



            using (IfcStore model = IfcStore.Create(editor, IfcSchemaVersion.Ifc2X3, XbimStoreType.InMemoryModel))
            {
                using (var txn = model.BeginTransaction("Initialise Model"))
                {
                    Environment  env    = Environment.Create(model);
                    ModelOptions option = new ModelOptions(model, env);



                    //Local placement of the main storey.
                    LocalPlacement storeyPlacement = new LocalPlacement(model, env.Building.LocalPlacement, env.ProjectAxis);
                    BuildingStorey storey          = new BuildingStorey(model, "Story", storeyPlacement, IfcElementCompositionEnum.ELEMENT, 0);
                    env.AddStorey(model, storey);


                    //Assigning the material and the main column.
                    Material material = new Material(model, "S235JR");


                    var RevitColumns = seeker.RevitColumns;
                    List <TeklaPlate> StoryComponants = new List <TeklaPlate>();
                    TeklaPlatePlacementInitializer plateInitializer;

                    foreach (var rColumn in RevitColumns)
                    {
                        List <RevitPlate> rColumnComp = rColumn.Components;
                        foreach (var revitPlate in rColumnComp)
                        {
                            plateInitializer = new TeklaPlatePlacementInitializer(model, env, revitPlate.Origin, revitPlate.Axis, revitPlate.ReffDirection);
                            TeklaPlate plate = new TeklaPlate(option, plateInitializer.LocalPlacement, revitPlate.OverallWidth, revitPlate.OverallDepth, revitPlate.Height);
                            StoryComponants.Add(plate);
                            plate.AssignMaterial(material);
                        }
                    }
                    storey.AddModelObject(StoryComponants.ToArray());
                    txn.Commit();
                }
                model.SaveAs($"{path}\\TheRealMindWurks.ifcxml");
            }
        }