12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using Autodesk.Revit.DB;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FWindSoft.Revit
- {
- /// <summary>
- /// 元素包装器
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class ElementWrapper<T> where T:Element
- {
- public ElementWrapper(T element )
- {
- Instance = element;
- }
- public T Instance { get; private set; }
- }
- /// <summary>
- /// 定位点元素包装器
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class PointElementWrapper<T>: ElementWrapper<T> where T : Element
- {
- public PointElementWrapper(T element):base(element)
- {
- Point = element.GetLocationPoint();
- }
- /// <summary>
- /// 定位点
- /// </summary>
- public XYZ Point { get; private set; }
- }
- /// <summary>
- /// 定位线元素包装器
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class CurveElementWrapper<T> : ElementWrapper<T> where T : Element
- {
- public CurveElementWrapper(T element) : base(element)
- {
- Curve = element.GetLocationCurve();
- }
- /// <summary>
- /// 定位线
- /// </summary>
- public Curve Curve { get; private set; }
- }
- /// <summary>
- /// 直线元素包装器
- /// </summary>
- /// <typeparam name="T"></typeparam>
- public class LineElementWrapper<T> : ElementWrapper<T> where T : Element
- {
- public LineElementWrapper(T element) : base(element)
- {
- Line = element.GetLocationLine();
- }
- /// <summary>
- /// 定位线
- /// </summary>
- public Line Line { get;private set; }
- }
- }
|