فهرست منبع

xls:修改==重写

huo_ch1186 5 سال پیش
والد
کامیت
75bfbe0a0a
4فایلهای تغییر یافته به همراه11 افزوده شده و 9 حذف شده
  1. 4 4
      JBIM/JBIM/BimId.cs
  2. 5 2
      JBIM/JBIM/Common/BimObjectUtil.cs
  3. 1 2
      JBIM/RevitToJBim/JBimParseContext.cs
  4. 1 1
      JBIM/RevitToJBim/TestExport.cs

+ 4 - 4
JBIM/JBIM/BimId.cs

@@ -55,17 +55,17 @@ namespace JBIM
         }
         public static bool operator ==(BimId a, BimId b)
         {
-            if (a == null)
+            if ((object)a == null)
             {
-                return b == null;
+                return (object)b == null;
             }
             return a.Equals(b);
         }
         public static bool operator !=(BimId a, BimId b)
         {
-            if (a == null)
+            if ((object)a == null)
             {
-                return (b != null);
+                return ((object)b != null);
             }
             return !a.Equals(b);
         }

+ 5 - 2
JBIM/JBIM/Common/BimObjectUtil.cs

@@ -56,8 +56,11 @@ namespace JBIM.Common
             if (propertyInfo == null)
             {
                 //缓存解析出来的属性元数据,以便提高解析速度
-                var property = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public);
-                PropertyCache.SetProperty(key, property);
+                propertyInfo = type.GetProperty(propertyName, BindingFlags.Instance | BindingFlags.Public);
+                if(propertyInfo!=null)
+                {
+                    PropertyCache.SetProperty(key, propertyInfo);
+                }
             }
             return propertyInfo;
         }

+ 1 - 2
JBIM/RevitToJBim/JBimParseContext.cs

@@ -141,7 +141,6 @@ namespace RevitToJBim
         private void UpdateRelationShipInfo(ElementRelationShip ship)
         {
             var relatingid = GetBimId(ship.RelatingObject);
-            RelationshipBase useShip = null;
             if (relatingid == null)
             {
                 return;
@@ -158,7 +157,7 @@ namespace RevitToJBim
                 
                 if (relatedid != null)
                 {
-                    BimObjectUtil.AcceptRelation(bimObject, ship.PropertyName, relatingid);
+                    BimObjectUtil.AcceptRelation(bimObject, ship.PropertyName, relatedid);
                 }
 
             }

+ 1 - 1
JBIM/RevitToJBim/TestExport.cs

@@ -35,7 +35,7 @@ namespace RevitToJBim
             context.Parser.Parse(report);
             var result = context.Serialize();
             string fileName = DateTime.Now.ToString("yyyyMMddhhmmss");
-            string path = Path.Combine("C", $"{fileName}.json");
+            string path = Path.Combine(@"D:\", $"{fileName}.json");
             File.WriteAllText(path, result);
         }
     }