Beispiel #1
0
        //ref
        public bool CreateConnection(Beam primary, Beam secondary)
        {
            var beamsize = GetSecondaryBeamProfile(secondary);

            //var attribute = string.Concat(code, "_", beamsize);
            try
            {
                Tekla.Structures.Model.Connection C = new Tekla.Structures.Model.Connection();
                C.Name   = "Test End Plate";
                C.Number = 141;
                C.LoadAttributesFromFile("standard");

                C.SetPrimaryObject(primary);
                C.SetSecondaryObject(secondary);

                if (!C.Insert())
                {
                    Console.WriteLine("Connection Insert failed ");
                    return(false);
                }
                else
                {
                    Console.WriteLine(C.Identifier.ID);
                }

                return(true);
            }
            catch (Exception x)
            {
                Console.WriteLine(x.GetBaseException().Message);
                return(false);
            }
        }
Beispiel #2
0
        public bool CreateConnection(Beam primary, ArrayList secondaries, int component, string code, int boltweldstype, int angletype)
        {
            var beamsize  = GetSecondaryBeamProfile(((Beam)secondaries[0]));
            var attribute = string.Concat(code, "_", beamsize);

            try
            {
                Tekla.Structures.Model.Connection C = new Tekla.Structures.Model.Connection();
                // C.Name = "Test End Plate";
                C.Number = component;
                C.LoadAttributesFromFile(attribute);

                C.SetPrimaryObject(primary);
                C.SetSecondaryObjects(secondaries);

                C.PositionType = PositionTypeEnum.COLLISION_PLANE;

                if (component == 141)
                {
                    C.SetAttribute("btab5", angletype);     //angle
                    C.SetAttribute("atab1", boltweldstype); //bolts/welds
                }


                //C.SetAttribute("btab5",angletype);//angle
                //C.SetAttribute("atab1",boltweldstype);//bolts/welds


                if (!C.Insert())
                {
                    Console.WriteLine("Connection Insert failed ");
                    return(false);
                }
                else
                {
                    Console.WriteLine(C.Identifier.ID);
                }

                return(true);
            }
            catch (Exception x)
            {
                Console.WriteLine(x.GetBaseException().Message);
                return(false);
            }
        }
        /// <summary>
        /// Method that creates connection (1004) between two given objects
        /// </summary>
        /// <param name="PrimaryObject"></param>
        /// <param name="SecondaryObject"></param>
        private static void CreateBasePlate(ModelObject PrimaryObject, ModelObject SecondaryObject)
        {
            Connection BasePlate = new Connection();

            BasePlate.Name   = "Stiffened Base Plate";
            BasePlate.Number = 1014;
            BasePlate.LoadAttributesFromFile("standard");
            BasePlate.UpVector     = new Vector(0, 0, 1000);
            BasePlate.PositionType = PositionTypeEnum.COLLISION_PLANE;

            BasePlate.SetPrimaryObject(PrimaryObject);
            BasePlate.SetSecondaryObject(SecondaryObject);
            BasePlate.SetAttribute("cut", 1);  //Enable anchor rods

            if (!BasePlate.Insert())
            {
                Console.WriteLine("Insertion of stiffened base plate failed.");
            }
        }
Beispiel #4
0
        public bool CreateConnection(Beam primary, Beam secondary, string code)
        {
            var beamsize = GetSecondaryBeamProfile(secondary);

            //var attribute = string.Concat(code, "_", beamsize);
            try
            {
                Tekla.Structures.Model.Connection C = new Tekla.Structures.Model.Connection();
                C.Name   = "Test End Plate";
                C.Number = 143;
                C.LoadAttributesFromFile("standard");
                //C.LoadAttributesFromFile(attribute);
                //C.UpVector = new Vector(0, 0, 1000);
                //C.PositionType = PositionTypeEnum.COLLISION_PLANE;

                C.SetPrimaryObject(primary);
                C.SetSecondaryObject(secondary);


                //C.SetAttribute("e2", 10.0);
                //C.SetAttribute("e1", 10.0);

                if (!C.Insert())
                {
                    Console.WriteLine("Connection Insert failed ");
                    return(false);
                }
                else
                {
                    Console.WriteLine(C.Identifier.ID);
                }

                return(true);
            }
            catch (Exception x)
            {
                Console.WriteLine(x.GetBaseException().Message);
                return(false);
            }
        }