Esempio n. 1
0
        // Token: 0x060000E9 RID: 233 RVA: 0x000091B8 File Offset: 0x000073B8
        protected internal override void InitializeFromAssembly(AssemblyInstance assemblyInstance)
        {
            bool flag = assemblyInstance == null;

            if (!flag)
            {
                Wall                wall         = assemblyInstance.getMainElement() as Wall;
                ItGeMatrix3d        mat          = ItGeMatrix3d.rotation(-1.5707963267948966, ItGeVector3d.kXAxis, ItGePoint3d.kOrigin);
                ItGeMatrix3d        itGeMatrix3d = ItGeMatrix3d.translation(new ItGeVector3d(0.0, 0.0, wall.thickness()));
                Position            position     = Position.Undefined;
                RevitElement <Part> part         = assemblyInstance.getPart(null);
                bool                flag2        = part.isNotNull();
                if (flag2)
                {
                    position = part.getViewsidePosition();
                }
                ItGeMatrix3d mat2  = ItGeMatrix3d.kIdentity;
                bool         flag3 = position != Position.Right;
                if (flag3)
                {
                    ItGeBoundBlock3d localExtents = assemblyInstance.getLocalExtents();
                    ItGePoint3d      itGePoint3d  = localExtents.midPoint;
                    itGePoint3d = itGeMatrix3d * mat * itGePoint3d;
                    mat2        = ItGeMatrix3d.rotation(3.1415926535897931, ItGeVector3d.kYAxis, itGePoint3d);
                }
                base.MatAssemblyToPalette = mat2 * itGeMatrix3d * mat;
                base.InitializeFromAssembly(assemblyInstance);
            }
        }
Esempio n. 2
0
        // Token: 0x06000042 RID: 66 RVA: 0x00003AB0 File Offset: 0x00001CB0
        public ItBracedGirderData(RevitElement <FamilyInstance> famInst, ItGeMatrix3d matWcsToPalette, double minZOfPartOnPalette)
        {
            bool flag = famInst.IsInvalid() || famInst.Element.Symbol.isNull() || matWcsToPalette.isNull();

            if (flag)
            {
                ItDebug.assert(false, "Constructor");
            }
            else
            {
                this.famInst = famInst;
                LocationCurve locationCurve = famInst.isNotNull() ? (famInst.Element.Location as LocationCurve) : null;
                bool          flag2         = locationCurve.isNull() || locationCurve.Curve.isNull() || !locationCurve.Curve.IsBound || locationCurve.Curve.Length.Eq(0.0, -1.0);
                if (flag2)
                {
                    ItDebug.assert(false, "Location of the girder is not a Curve Type or other geometric inconsistency");
                }
                else
                {
                    ItGeMatrix3d     mat              = matWcsToPalette * famInst.Element.ecs();
                    ItGeBoundBlock3d localExtents     = famInst.Element.getLocalExtents();
                    ItGeBoundBlock3d itGeBoundBlock3d = localExtents.transformBy(mat);
                    localExtents.transformBy(mat);
                    this.installationHeight = itGeBoundBlock3d.minPoint.z - minZOfPartOnPalette;
                    this.height             = itGeBoundBlock3d.maxPoint.z - itGeBoundBlock3d.minPoint.z;
                    XYZ point  = locationCurve.Curve.Evaluate(0.0, true);
                    XYZ point2 = locationCurve.Curve.Evaluate(1.0, true);
                    this.midline = new ItGeLineSeg3d(point.asPoint(), point2.asPoint());
                    this.midline.transformBy(matWcsToPalette);
                    bool flag3 = this.midline.startPoint.x.Eq(this.midline.endPoint.x, -1.0);
                    if (flag3)
                    {
                        bool flag4 = this.midline.startPoint.y > this.midline.endPoint.y;
                        if (flag4)
                        {
                            this.midline.reverseParam();
                        }
                    }
                    else
                    {
                        bool flag5 = this.midline.startPoint.y.Eq(this.midline.endPoint.y, -1.0);
                        if (flag5)
                        {
                            bool flag6 = this.midline.startPoint.x > this.midline.endPoint.x;
                            if (flag6)
                            {
                                this.midline.reverseParam();
                            }
                        }
                    }
                    Parameter parameter  = famInst.Element.Symbol.getParameter(ItBracedGirderData._lclParamHeight, true);
                    Parameter parameter2 = famInst.Element.Symbol.getParameter(ItBracedGirderData._lclParamLinealWeight, true);
                    Parameter parameter3 = famInst.Element.Symbol.getParameter(ItBracedGirderData._lclParamUpperChordDiam, true);
                    bool      flag7      = parameter.isNotNull();
                    if (flag7)
                    {
                        this.height = parameter.AsDouble();
                    }
                    bool flag8 = parameter2.isNotNull();
                    if (flag8)
                    {
                        this.linealWeight = parameter2.AsDouble();
                    }
                    bool flag9 = parameter3.isNotNull();
                    if (flag9)
                    {
                        this.upperChordDiameter = parameter3.AsDouble();
                    }
                }
            }
        }