ParseWall.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*-------------------------------------------------------------------------
  2. * 功能描述:ParseWall
  3. * 作者:xulisong
  4. * 创建时间: 2019/6/25 17:53:27
  5. * 版本号:v1.0
  6. * -------------------------------------------------------------------------*/
  7. using Autodesk.Revit.DB;
  8. using JBIM;
  9. using RevitExport.Export;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. using JWall = JBIM.Component.Wall;
  16. namespace RevitToJBim.ComponentParse
  17. {
  18. [UsableParse]
  19. public class ParseWall : ParseBase
  20. {
  21. public override List<string> FastIndex()
  22. {
  23. return new List<string>() { typeof(Wall).FullName };
  24. }
  25. public override bool Match(ElementWrapper wrapper)
  26. {
  27. return wrapper.RefElement is Wall;
  28. }
  29. protected override List<BimId> ParseInner(ElementWrapper wrapper, JBimParseContext context)
  30. {
  31. if (!(wrapper.RefElement is Wall wall))
  32. {
  33. return null;
  34. }
  35. JWall jObject = new JWall();
  36. ParseCore.AttachObject(jObject, wrapper);
  37. context.AddBimObject(jObject);
  38. jObject.Location = ParseCore.GetLocation(wall.Location);
  39. //if (fi.Host != null)
  40. //{
  41. // jObject.Owner = context.Parser.ParseElement(ElementWrapperFactory.CreateWrapper(fi.Host))?.FirstOrDefault();
  42. //}
  43. return new List<BimId>() { jObject.Id };
  44. }
  45. }
  46. }