Esempio n. 1
0
        /// <summary>
        /// Get assembly location: Unkown = -1, 0 = On Site, 1 = Site Drilled, 2 = In Shop
        /// </summary>
        /// <param name="screwBolts">Input connection object </param>
        /// <returns name="assemblyLocation">An integer that represents the assembly location</returns>
        public static int GetBoltAssemblyLocation(AdvanceSteel.Nodes.SteelDbObject screwBolts)
        {
            int ret = -1;

            using (var ctx = new SteelServices.DocContext())
            {
                if (screwBolts != null)
                {
                    Autodesk.AdvanceSteel.Modelling.ScrewBoltPattern obj = Utils.GetObject(screwBolts.Handle) as Autodesk.AdvanceSteel.Modelling.ScrewBoltPattern;
                    if (obj != null)
                    {
                        ret = (int)obj.AssemblyLocation;
                    }
                    else
                    {
                        throw new System.Exception("failed to get the connection object");
                    }
                }
                else
                {
                    throw new System.Exception("Steel Object or Point is null");
                }
            }
            return(ret);
        }
Esempio n. 2
0
 /// <summary>
 /// Set assembly location
 /// </summary>
 /// <param name="screwBolts">Input connection object </param>
 /// <param name="connectionType">Input assembly location</param>
 /// <returns name="screwBolts">The updated screwBolts object</returns>
 public static SteelDbObject SetBoltAssemblyLocation(SteelDbObject screwBolts, int connectionType)
 {
     using (var ctx = new SteelServices.DocContext())
     {
         Autodesk.AdvanceSteel.Modelling.ScrewBoltPattern obj = Utils.GetObject(screwBolts.Handle) as Autodesk.AdvanceSteel.Modelling.ScrewBoltPattern;
         if (obj != null)
         {
             obj.AssemblyLocation = (AtomicElement.eAssemblyLocation)connectionType;
             return(screwBolts);
         }
         else
         {
             throw new System.Exception("failed to get the connection object");
         }
     }
 }