示例#1
0
        public static Brace GetBracesData(IIfcMemberStandardCase brace)
        {
            Point location = new Point();
            Point refDir   = new Point();
            Point axis     = new Point();

            location.X = ((brace.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.X;

            location.Y = ((brace.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.Y;

            location.Z = ((brace.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.Z;


            refDir.X = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.X;

            refDir.Y = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.Y;

            refDir.Z = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.Z;


            axis.X = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.X;

            axis.Y = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.Y;

            axis.Z = ((brace.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.Z;

            Brace brace1 = new Brace()
            {
                Location     = location,
                RefDirection = refDir,
                Axis         = axis,

                Name = brace.Name.Value.ToString(),

                Length = ((brace.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid).Depth,

                BottomLevel = location.Z,

                //TopLevel = location.Z+ ((inclined.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid).Depth*cos(angleBetween(axis,z-unitVec)),
                //Calculated in creation at revitplugin

                Width = (double)(((brace.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                                 .SweptArea as IIfcLShapeProfileDef).Width,

                Depth = (((brace.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                         .SweptArea as IIfcLShapeProfileDef).Depth,

                Thickness = (((brace.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                             .SweptArea as IIfcLShapeProfileDef).Thickness,
            };

            return(brace1);
        }
示例#2
0
        public static Inclined GetInclinesData(IIfcMemberStandardCase inclined)
        {
            Point location = new Point();
            Point refDir   = new Point();
            Point axis     = new Point();

            location.X = ((inclined.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.X;

            location.Y = ((inclined.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.Y;

            location.Z = ((inclined.ObjectPlacement as IIfcLocalPlacement)
                          .RelativePlacement as IIfcAxis2Placement3D).Location.Z;


            refDir.X = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.X;

            refDir.Y = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.Y;

            refDir.Z = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).RefDirection.Z;


            axis.X = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.X;

            axis.Y = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.Y;

            axis.Z = ((inclined.ObjectPlacement as IIfcLocalPlacement).RelativePlacement as IIfcAxis2Placement3D).Axis.Z;

            Inclined inc = new Inclined()
            {
                Location     = location,
                RefDirection = refDir,
                Axis         = axis,

                Name = inclined.Name.Value.ToString(),

                Length = ((inclined.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid).Depth,

                BottomLevel = location.Z,

                //TopLevel = location.Z+ ((inclined.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid).Depth*cos(angleBetween(axis,z-unitVec)),
                //Calculated in creation at revitplugin

                Width = (((inclined.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                         .SweptArea as IIfcRectangleProfileDef).XDim,

                Depth = (((inclined.Representation.Representations.FirstOrDefault() as IIfcShapeRepresentation).Items.FirstOrDefault() as IIfcExtrudedAreaSolid)
                         .SweptArea as IIfcRectangleProfileDef).YDim,
            };

            return(inc);
        }