프로젝트

일반

사용자정보

개정판 77a33d5f

ID77a33d5febc4e2debb4e1621c4c1530a0657bdd3
상위 f4571b5d
하위 c0d7e7e3

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #1231 : symbol uda

Change-Id: I3412275c54892828852a63473b6053da35b72805

차이점 보기:

DTI_PID/APIDConverter/AutoModeling.cs
909 909
        public static void TESTStatic(ObjectId objectId)
910 910
        {
911 911
            // Get the current document and database, and start a transaction
912
            Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
913
            Database acCurDb = acDoc.Database;
914
            Editor acDocEd = acDoc.Editor;
915

  
916
            using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
917
            {
918
                Entity objDb = (Entity)acTrans.GetObject(objectId, OpenMode.ForWrite);
919
                Entity startNodeEntityForPipe = Pipe.GetStartNodeEntityForPipe(objDb);
920

  
921
                //ArrayList arrayList = new ArrayList();
922
                //ArrayList arrayList2 = new ArrayList();
923
                //PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2);
924
                //PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2);
925
                //NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject");
926

  
927
                XData xData = XDataUtilities.GetXData<Entity>(objDb);
928
                XData xData2 = XDataUtilities.GetXData<Entity>(startNodeEntityForPipe);
929
                acTrans.Commit();
930
            }
931

  
932
            
912
            //Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
913
            //Database acCurDb = acDoc.Database;
914
            //Editor acDocEd = acDoc.Editor;
915

  
916
            //using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
917
            //{
918
            //    Entity objDb = (Entity)acTrans.GetObject(objectId, OpenMode.ForWrite);
919
            //    Entity startNodeEntityForPipe = Pipe.GetStartNodeEntityForPipe(objDb);
920

  
921
            //    //ArrayList arrayList = new ArrayList();
922
            //    //ArrayList arrayList2 = new ArrayList();
923
            //    //PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2);
924
            //    //PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2);
925
            //    //NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject");
926

  
927
            //    XData xData = XDataUtilities.GetXData<Entity>(objDb);
928
            //    XData xData2 = XDataUtilities.GetXData<Entity>(startNodeEntityForPipe);
929
            //    acTrans.Commit();
930
            //}
931

  
932
            //PLABFO
933 933
        }
934 934
        #endregion
935 935
    }
DTI_PID/APIDConverter/DB/Project_DB.cs
956 956

  
957 957
            return dt;
958 958
        }
959

  
960
        public static DataTable SelectUDADetails()
961
        {
962
            DataTable dt = new DataTable();
963

  
964
            using (SqlConnection connection = new SqlConnection())
965
            {
966
                connection.ConnectionString = GetAvevaConnectionString_Admin();
967
                connection.Open();
968
                using (SqlCommand cmd = connection.CreateCommand())
969
                {
970
                    cmd.CommandText = string.Format(@"
971
                    SELECT * FROM {0}
972
                    ;", "UDADetails");
973

  
974
                    using (SqlDataReader dr = cmd.ExecuteReader())
975
                        dt.Load(dr);
976
                }
977
                connection.Close();
978
            }
979

  
980
            return dt;
981
        }
959 982
        #endregion
960 983

  
961 984
    }
DTI_PID/APIDConverter/Utils/APIDUtils.cs
5 5
using System.Threading.Tasks;
6 6
using System.IO;
7 7
using System.Reflection;
8
using System.Data;
8 9
using Autodesk.AutoCAD.EditorInput;
9 10

  
10 11
using AVEVA.PID.Components;
......
136 137

  
137 138
            return list;
138 139
        }
140
        public static Dictionary<PID.Utilities.PipeLabelName, PID.Utilities.PipeLabelHelper.PipeDisplayLabelField> GetPipeAttribute()
141
        {
142
            return PID.Utilities.PipeLabelHelper.GetPipeDisplayLabelFields().ToDictionary(x => x.Key, y => y.Value);
143
        }
144
        public static DataTable GetSymbolAttributes()
145
        {
146
            DataTable dt = new DataTable();
147
            dt.Columns.Add("Name");
148
            dt.Columns.Add("DisplayType");
149
            dt.Columns.Add("Type");
150
            
151
            #region UDA
152
            DataTable udaDT = Project_DB.SelectUDADetails();
153
            DataRow[] rows = udaDT.Select("LovDescription != 'Project Symbol' AND LovDescription != 'Standard Symbol'");
154
            foreach (DataRow item in rows)
155
                udaDT.Rows.Remove(item);
156
            udaDT = udaDT.DefaultView.ToTable(true, "UDAName");
157

  
158
            foreach (DataRow item in udaDT.Rows)
159
                dt.Rows.Add(item["UDAName"], "User Defined Attribute", "UDA");
160
            #endregion
161

  
162
            return dt;
163
        }
164

  
165

  
139 166
        #endregion
140 167
    }
141 168
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)