Example #1
0
        public override Autodesk.DesignScript.Geometry.Curve GetDynCurve()
        {
            lock (access_obj)
            {
                using (var ctx = new SteelServices.DocContext())
                {
                    var shearStud = Utils.GetObject(Handle) as Autodesk.AdvanceSteel.Modelling.Connector;
                    if (shearStud == null)
                    {
                        throw new Exception("Null shear stud pattern");
                    }

                    var coordSystem = shearStud.CS;
                    // Vx and Vy direction
                    var tempVx = new Vector3d(coordSystem.Values[0][0], coordSystem.Values[1][0], coordSystem.Values[2][0]);
                    var tempVy = new Vector3d(coordSystem.Values[0][1], coordSystem.Values[1][1], coordSystem.Values[2][1]);

                    var tempXlen = shearStud.Arranger.Dx * (shearStud.Arranger.Nx - 1) / 2.0;
                    var tempYlen = shearStud.Arranger.Dy * (shearStud.Arranger.Ny - 1) / 2.0;

                    var temp1 = tempVx * tempXlen;
                    var temp2 = tempVy * tempYlen;

                    var pt1 = new SteelGeometry.Point3d(shearStud.CenterPoint);
                    pt1.Add(temp1 + temp2);

                    var pt2 = new SteelGeometry.Point3d(shearStud.CenterPoint);
                    pt2.Add(temp1 - temp2);

                    var pt3 = new SteelGeometry.Point3d(shearStud.CenterPoint);
                    pt3.Add(-temp1 - temp2);

                    var pt4 = new SteelGeometry.Point3d(shearStud.CenterPoint);
                    pt4.Add(-temp1 + temp2);

                    {
                        List <DynGeometry.Point> polyPoints = new List <DynGeometry.Point>
                        {
                            Utils.ToDynPoint(pt1, true),
                            Utils.ToDynPoint(pt2, true),
                            Utils.ToDynPoint(pt3, true),
                            Utils.ToDynPoint(pt4, true)
                        };

                        return(Autodesk.DesignScript.Geometry.Polygon.ByPoints(polyPoints));
                    }
                }
            }
        }
Example #2
0
        public override DynGeometry.Curve GetDynCurve()
        {
            lock (access_obj)
            {
                using (var ctx = new SteelServices.DocContext())
                {
                    var anchorPattern = Utils.GetObject(Handle) as Autodesk.AdvanceSteel.Modelling.AnchorPattern;

                    if (anchorPattern == null)
                    {
                        throw new Exception("Null anchor pattern");
                    }

                    var temp1 = anchorPattern.XDirection * anchorPattern.Dx / 2.0;
                    var temp2 = anchorPattern.YDirection * anchorPattern.Dy / 2.0;

                    var pt1 = new SteelGeometry.Point3d(anchorPattern.RefPoint);
                    pt1.Add(temp1 + temp2);

                    var pt2 = new SteelGeometry.Point3d(anchorPattern.RefPoint);
                    pt2.Add(temp1 - temp2);

                    var pt3 = new SteelGeometry.Point3d(anchorPattern.RefPoint);
                    pt3.Add(-temp1 - temp2);

                    var pt4 = new SteelGeometry.Point3d(anchorPattern.RefPoint);
                    pt4.Add(-temp1 + temp2);

                    {
                        List <DynGeometry.Point> polyPoints = new List <DynGeometry.Point>
                        {
                            Utils.ToDynPoint(pt1, true),
                            Utils.ToDynPoint(pt2, true),
                            Utils.ToDynPoint(pt3, true),
                            Utils.ToDynPoint(pt4, true)
                        };

                        return(Autodesk.DesignScript.Geometry.Polygon.ByPoints(polyPoints));
                    }
                }
            }
        }
Example #3
0
        public override Autodesk.DesignScript.Geometry.Curve GetDynCurve()
        {
            lock (access_obj)
            {
                using (var ctx = new SteelServices.DocContext())
                {
                    var boltPattern = Utils.GetObject(Handle) as Autodesk.AdvanceSteel.Modelling.CountableScrewBoltPattern;

                    if (boltPattern == null)
                    {
                        throw new Exception("Null bolt pattern");
                    }

                    var temp1 = boltPattern.XDirection * boltPattern.Length / 2.0;
                    var temp2 = boltPattern.YDirection * boltPattern.Height / 2.0;

                    var pt1 = new SteelGeometry.Point3d(boltPattern.CenterPoint);
                    pt1.Add(temp1 + temp2);

                    var pt2 = new SteelGeometry.Point3d(boltPattern.CenterPoint);
                    pt2.Add(temp1 - temp2);

                    var pt3 = new SteelGeometry.Point3d(boltPattern.CenterPoint);
                    pt3.Add(-temp1 - temp2);

                    var pt4 = new SteelGeometry.Point3d(boltPattern.CenterPoint);
                    pt4.Add(-temp1 + temp2);

                    {
                        List <DynGeometry.Point> polyPoints = new List <DynGeometry.Point>
                        {
                            Utils.ToDynPoint(pt1, true),
                            Utils.ToDynPoint(pt2, true),
                            Utils.ToDynPoint(pt3, true),
                            Utils.ToDynPoint(pt4, true)
                        };

                        return(Autodesk.DesignScript.Geometry.Polygon.ByPoints(polyPoints));
                    }
                }
            }
        }
Example #4
0
        public static List <DynGeometry.Point> GetPointsToDraw(Autodesk.AdvanceSteel.Modelling.Grating grating)
        {
            var coordSystem = grating.CS;

            coordSystem.GetCoordSystem(out var origPt, out var vX, out var vY, out var vZ);

            var temp1 = vY * grating.Width / 2.0;
            var temp2 = vX * grating.Length / 2.0;

            var pt1 = new SteelGeometry.Point3d(grating.CenterPoint);

            pt1.Add(temp1 + temp2);

            var pt2 = new SteelGeometry.Point3d(grating.CenterPoint);

            pt2.Add(temp1 - temp2);

            var pt3 = new SteelGeometry.Point3d(grating.CenterPoint);

            pt3.Add(-temp1 - temp2);

            var pt4 = new SteelGeometry.Point3d(grating.CenterPoint);

            pt4.Add(-temp1 + temp2);


            List <DynGeometry.Point> polyPoints = new List <DynGeometry.Point>
            {
                Utils.ToDynPoint(pt1, true),
                Utils.ToDynPoint(pt2, true),
                Utils.ToDynPoint(pt3, true),
                Utils.ToDynPoint(pt4, true)
            };

            return(polyPoints);
        }