Example #1
0
        public static MemberIncidence ParseTXT(string data)
        {
            //Example

            // MEMBER INCIDENCE
            // 1 1 3 ; 2 3 7 ; 3 2 6 ; 4 6 8 ; 5 3 4
            // 6 4 5 ; 7 5 6 ; 8 7 12 ; 9 12 14
            // 10 14 16 ; 11 15 16 ; 12 13 15 ; 13 8 13
            // 14 9 12 ; 15 9 14 ; 16 11 14 ; 17 11 15
            // 18 10 15 ; 19 10 13 ; 20 7 9
            // 21 9 11 ; 22 10 11 ; 23 8 10

            string temp = data.Trim().TrimEnd().TrimStart();
            temp = temp.Replace('\t', ' ');
            while (temp.IndexOf("  ") != -1)
            {
                temp = temp.Replace("  ", " ");
            }
            string[] values = temp.Split(new char[] { ' ' });
            if (values.Length != 3) throw new Exception("String Data is not correct format.");

            MemberIncidence membInci = new MemberIncidence();

            membInci.iMemberNo = int.Parse(values[0]);
            membInci.StartNode.NodeNo = int.Parse(values[1]);
            membInci.EndNode.NodeNo = int.Parse(values[2]);
            return membInci;
        }
Example #2
0
        public static MemberIncidence ParseAST(string data)
        {
            //Example

            // N002 UNIT 1.000 1.000 KIP FT KIP FT ELTYPE=2, MEMBER#, NODE1#, x[NODE1]*lfact, y[NODE1]*lfact, z[NODE1]*lfact, NODE2#, x[NODE2]*lfact, y[NODE2]*lfact, z[NODE2]*lfact
            // N002	2	1	1	0	0	0	3	0	20	0
            // N002	2	2	3	0	20	0	7	0	35	0
            // N002	2	3	2	30	0	0	6	30	20	0
            // N002	2	4	6	30	20	0	8	30	35	0

            string temp = data.Trim().TrimEnd().TrimStart();
            temp = temp.Replace('\t', ' ');
            while (temp.IndexOf("  ") != -1)
            {
                temp = temp.Replace("  ", " ");
            }
            string[] values = temp.Split(new char[] { ' ' });
            if (values.Length != 11) throw new Exception("String Data is not correct format.");

            MemberIncidence membInci = new MemberIncidence();

            membInci.iMemberNo = int.Parse(values[2]);
            membInci.StartNode.NodeNo = int.Parse(values[3]);
            membInci.EndNode.NodeNo = int.Parse(values[7]);

            return membInci;
        }
Example #3
0
 public MemberProperty()
 {
     miMember = new MemberIncidence();
     dYD      = 0.0d;
     dZD      = 0.0d;
     dIX      = 0.0d;
     dIY      = 0.0d;
     dIZ      = 0.0d;
     dArea    = 0.0d;
     dE       = "";
     sDEN     = "";
 }