Exemplo n.º 1
0
        /// <summary>
        /// Get anchor bolt orientation type: NormalOrientation = 0, 1 = DiagonalInside, 2 = DiagonalOutside, 3 = AllOutside, 4 = AllInside, 5 = InsideRotated, 6 = OutsideRotated
        /// </summary>
        /// <param name="anchorBolts">Input anchor bolts object </param>
        /// <returns name="orientation">An integer that represents the orientation</returns>
        public static int GetAnchorBoltOrientation(AdvanceSteel.Nodes.SteelDbObject anchorBolts)
        {
            int ret = -1;

            using (var ctx = new SteelServices.DocContext())
            {
                if (anchorBolts != null)
                {
                    Autodesk.AdvanceSteel.Modelling.AnchorPattern obj = Utils.GetObject(anchorBolts.Handle) as Autodesk.AdvanceSteel.Modelling.AnchorPattern;
                    if (obj != null)
                    {
                        ret = (int)obj.OrientationType;
                    }
                    else
                    {
                        throw new System.Exception("failed to get the connection object");
                    }
                }
                else
                {
                    throw new System.Exception("Steel Object or Point is null");
                }
            }
            return(ret);
        }
Exemplo n.º 2
0
 private void SetAnchorSetOutDetails(Autodesk.AdvanceSteel.Modelling.AnchorPattern anchors,
                                     Point3d RefPoint,
                                     Autodesk.AdvanceSteel.Arrangement.Arranger.eArrangerType anchorArr)
 {
     anchors.ArrangerType = anchorArr;
     anchors.BoundedSide  = Autodesk.AdvanceSteel.Modelling.AnchorPattern.eBoundedSide.kAll;
     anchors.RefPoint     = RefPoint;
 }
Exemplo n.º 3
0
        internal RectangularAnchorPattern(SteelGeometry.Point3d astPoint1, SteelGeometry.Point3d astPoint2, IEnumerable <string> handlesToConnect,
                                          SteelGeometry.Vector3d vx, SteelGeometry.Vector3d vy,
                                          List <Property> anchorBoltData, int boltCon)
        {
            lock (access_obj)
            {
                using (var ctx = new SteelServices.DocContext())
                {
                    Autodesk.AdvanceSteel.Modelling.AnchorPattern anchors = null;
                    string handle      = SteelServices.ElementBinder.GetHandleFromTrace();
                    var    astPointRef = astPoint1 + (astPoint2 - astPoint1) * 0.5;

                    if (string.IsNullOrEmpty(handle) || Utils.GetObject(handle) == null)
                    {
                        anchors = new Autodesk.AdvanceSteel.Modelling.AnchorPattern(astPoint1, astPoint2, vx, vy);
                        SetAnchorSetOutDetails(anchors, astPoint1 + (astPoint2 - astPoint1) * 0.5, Autodesk.AdvanceSteel.Arrangement.Arranger.eArrangerType.kBounded);

                        double aLengthX = Utils.GetRectangleLength(astPoint1, astPoint2, vx); // / (anchors.Nx - 1);
                        double aLengthY = Utils.GetRectangleLength(astPoint1, astPoint2, vy); // / (anchors.Ny - 1);
                        anchors.SetArrangerLength(aLengthX, 0);
                        anchors.SetArrangerLength(aLengthY, 1);

                        Utils.SetParameters(anchors, anchorBoltData);

                        anchors.WriteToDb();
                    }
                    else
                    {
                        anchors = Utils.GetObject(handle) as Autodesk.AdvanceSteel.Modelling.AnchorPattern;

                        if (anchors != null && anchors.IsKindOf(FilerObject.eObjectType.kAnchorPattern))
                        {
                            SetAnchorSetOutDetails(anchors, astPoint1 + (astPoint2 - astPoint1) * 0.5, Autodesk.AdvanceSteel.Arrangement.Arranger.eArrangerType.kBounded);

                            double aLengthX = Utils.GetRectangleLength(astPoint1, astPoint2, vx);
                            double aLengthY = Utils.GetRectangleLength(astPoint1, astPoint2, vy);
                            anchors.SetArrangerLength(aLengthX, 0);
                            anchors.SetArrangerLength(aLengthY, 1);

                            Utils.SetParameters(anchors, anchorBoltData);
                        }
                        else
                        {
                            throw new System.Exception("Not an anchor pattern");
                        }
                    }

                    FilerObject[] filerObjects = Utils.GetFilerObjects(handlesToConnect);
                    anchors.Connect(filerObjects, (AtomicElement.eAssemblyLocation)boltCon);

                    Handle = anchors.Handle;
                    SteelServices.ElementBinder.CleanupAndSetElementForTrace(anchors);
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Set orientation for anchor bolt object
 /// </summary>
 /// <param name="anchorBolts">Input anchor bolts object </param>
 /// <param name="orientation">Input Anchor Bolt Orientation location</param>
 /// <returns name="anchorBolts">The updated object</returns>
 public static SteelDbObject SetAnchorBoltOrientation(SteelDbObject anchorBolts, int orientation)
 {
     using (var ctx = new SteelServices.DocContext())
     {
         Autodesk.AdvanceSteel.Modelling.AnchorPattern obj = Utils.GetObject(anchorBolts.Handle) as Autodesk.AdvanceSteel.Modelling.AnchorPattern;
         if (obj != null)
         {
             obj.OrientationType = (Autodesk.AdvanceSteel.Modelling.AnchorPattern.eOrientationType)orientation;
             return(anchorBolts);
         }
         else
         {
             throw new System.Exception("failed to get the connection object");
         }
     }
 }