Ejemplo n.º 1
0
        public BasicWallEditor
            (Wall _wall,
            WallType _wt,
            Curve _offsetLocCurve,
            double _height,
            XYZ _orientation,
            bool _needDisjoinEnds,
            bool[] _joinEnd,
            Dictionary <string, ParameterEditRecorder> _params,
            OpContext _docOpsInfo)
        {
            this.Wall = _wall;
            this.WT   = _wt;
            this.newOffsetLocCurve = _offsetLocCurve;
            this.orientation       = _orientation;
            this.height            = _height;
            this.paramValues       = _params == null
                ? new Dictionary <string, ParameterEditRecorder>()
                : _params;
            this.needDisjoinEnds = _needDisjoinEnds;
            this.joinEnd         = _joinEnd == null
                ? getWallJoinEndStates(_wall)
                : _joinEnd;

            this.Context = _docOpsInfo;
        }
Ejemplo n.º 2
0
        public static LineBasedFamilyCreator_onPlanarFace CreateSimilar(FamilyInstance _fi, Document _tarDoc, double _hostSearchRange)
        {
            var          refDoc = _fi.Document;
            var          refDocId = refDoc.Identifier();
            var          tarDocId = _tarDoc.Identifier();
            var          locLine = _fi.LocationLine();
            var          offsetLocLine = LineBasedFamilyUtils.GetOffsetLocLine(_fi);
            var          param = _fi.GetAllEditableParams();
            DesignOption dop; string dopUid, dopName;

            OpContext.GetActiveDesignOptionInfo(_tarDoc, out dop, out dopUid, out dopName);
            var     opContext = new OpContext(refDocId, tarDocId, refDoc, _tarDoc, dopUid, dopName, _fi.Id);
            var     hostCat   = HostUtils.GetHostCategory(_fi);
            var     hostDir   = HostUtils.GetHostDir(_fi);
            var     faceNorm  = _fi.GetPlane().Normal;
            var     bb       = _fi.GetBoundingBoxInModelCS(null);
            var     bbFilter = Methods.GetBBIntersectFilter(bb, _hostSearchRange);
            var     search   = new HostSearchSession(_tarDoc, hostCat, bbFilter, hostDir, faceNorm, dop);
            Element host;
            var     hostFace = search.FindHostFace(locLine, out host);
            var     ctr      = new LineBasedFamilyCreator_onPlanarFace
                                   (_fi.Symbol, offsetLocLine, _fi.FacingOrientation, host, hostFace, param, opContext);

            Methods.GetCutsAndJoins(_fi, out ctr.Cuts, out ctr.CutBy, out ctr.Joins);
            ctr.CutsHost = HostUtils.CutsHost(_fi);
            return(ctr);
        }
Ejemplo n.º 3
0
        public static FaceBasedFamilyCreator CreateSimilar(FamilyInstance _fi, Document _tarDoc, double _hostSearchRange)
        {
            var          refDoc = _fi.Document;
            var          pos = _fi.GetPos();
            var          hostCat = HostUtils.GetHostCategory(_fi);
            var          bb = _fi.GetBoundingBoxInModelCS(null);
            var          bbFilter = Methods.GetBBIntersectFilter(bb, _hostSearchRange);
            XYZ          faceNorm = null;
            DesignOption dop; string dopUid, dopName;

            OpContext.GetActiveDesignOptionInfo(_tarDoc, out dop, out dopUid, out dopName);
            var     hostDir = HostUtils.GetHostDir(_fi);
            var     search  = new HostSearchSession(_tarDoc, hostCat, bbFilter, hostDir, faceNorm, dop);
            Element host;
            var     hostFace = search.FindHostFace(pos, out host);
            var     param    = _fi.GetAllEditableParams();
            var     refDocId = refDoc.Identifier();
            var     tarDocId = _tarDoc.Identifier();

            var opContext = new OpContext(refDocId, tarDocId, refDoc, _tarDoc, dopUid, dopName, _fi.Id);
            var ctr       = new FaceBasedFamilyCreator
                                (_fi.Symbol, _fi.Host, hostFace, pos, _fi.HandOrientation, _fi.FacingOrientation, param, opContext);

            return(ctr);
        }
Ejemplo n.º 4
0
 public FamilyCreator
     (FamilySymbol _fs,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
 {
     this.fs          = _fs;
     this.paramValues = _params;
     this.Context     = _opContext;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// create new instance on host face, with a face reference as input.
 /// </summary>
 public LineBasedFamilyCreator_onPlanarFace
     (FamilySymbol _fs,
     Line _offsetLocLine,
     XYZ _facing,
     Reference _hostFaceRef,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_fs, _params, _opContext)
 {
     this.OffsetLocLine   = _offsetLocLine;
     this.Facing          = _facing;
     this.hostFaceRef     = _hostFaceRef;
     this.referenceString = _hostFaceRef.ConvertToStableRepresentation(_fs.Document);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// create new instance on host face.
 /// </summary>
 public LineBasedFamilyCreator_onPlanarFace
     (FamilySymbol _fs,
     Line _offsetLocLine,
     XYZ _facing,
     Element _host,
     PlanarFace _hostFace,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_fs, _params, _opContext)
 {
     this.OffsetLocLine = _offsetLocLine;
     this.Host          = _host;
     this.hostFace      = _hostFace;
     this.Facing        = _facing;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// create new instance on level.
 /// </summary>
 public LineBasedFamilyCreator_onLevel
     (FamilySymbol _fs,
     Line _offsetLocLine,
     XYZ _facing,
     Level _hostLevel,
     StructuralType _sType,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_fs, _params, _opContext)
 {
     this.offsetLocLine = _offsetLocLine;
     this.Facing        = _facing;
     this.hostLevel     = _hostLevel;
     this.sType         = _sType;
 }
Ejemplo n.º 8
0
 public WallBasedFamilyCreator
     (FamilySymbol _fs,
     Wall _hostWall,
     XYZ _pos,
     XYZ _hand,
     XYZ _facing,
     StructuralType _sType,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_fs, _params, _opContext)
 {
     this.hostWall = _hostWall;
     this.pos      = _pos;
     this.Hand     = _hand;
     this.Facing   = _facing;
     this.sType    = _sType;
 }
Ejemplo n.º 9
0
 public FaceBasedFamilyCreator
     (FamilySymbol _fs,
     Element _host,
     Face _hostFace,
     XYZ _pos,
     XYZ _hand,
     XYZ _facing,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _docOpsInfo)
     : base(_fs, _params, _docOpsInfo)
 {
     this.host     = _host;
     this.HostFace = _hostFace;
     this.Pos      = _pos;
     this.Hand     = _hand;
     this.Facing   = _facing;
 }
Ejemplo n.º 10
0
 public FaceBasedFamilyCreator
     (FamilySymbol _fs,
     Reference _hostFaceRef,
     XYZ _pos,
     XYZ _hand,
     XYZ _facing,
     Dictionary <string, ParameterEditRecorder> _params,
     bool _flipFacing,
     OpContext _opContext)
     : base(_fs, _params, _opContext)
 {
     this.HostFaceRef = _hostFaceRef;
     this.Pos         = _pos;
     this.Hand        = _hand;
     this.Facing      = _facing;
     this.flipFacing  = _flipFacing;
 }
Ejemplo n.º 11
0
        public static LineBasedFamilyCreator_onLevel CreateSimilar(FamilyInstance _fi, Document _tarDoc, int _hostLevel)
        {
            var          hostLevel = _fi.Host as Level;
            var          offsetLocLine = LineBasedFamilyUtils.GetOffsetLocLine(_fi);
            var          param = _fi.GetAllEditableParams();
            var          refDoc = _fi.Document;
            var          refDocId = _fi.Document.Identifier();
            var          tarDocId = _tarDoc.Identifier();
            DesignOption dop; string dopUid, dopName;

            OpContext.GetActiveDesignOptionInfo(_tarDoc, out dop, out dopUid, out dopName);
            var opContext = new OpContext(refDocId, tarDocId, refDoc, _tarDoc, dopUid, dopName, _fi.Id);
            var ctr = new LineBasedFamilyCreator_onLevel
                          (_fi.Symbol, offsetLocLine, _fi.FacingOrientation, hostLevel, _fi.StructuralType, param, opContext);

            return(ctr);
        }
Ejemplo n.º 12
0
 public LineBasedFamilyEditor(
     FamilyInstance _fi,
     FamilySymbol _fs,
     Line _offsetLocLine,
     XYZ _facing,
     bool _cutHost,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_cutHost)
 {
     this.FI            = _fi;
     this.FS            = _fs;
     this.OffsetLocLine = _offsetLocLine;
     this.facing        = _facing;
     this.paramValues   = _params;
     this.Context       = _opContext;
     this.Context       = _opContext;
 }
Ejemplo n.º 13
0
 public PointBasedFamilyEditor(
     FamilyInstance _fi,
     XYZ _translation,
     FamilySymbol _fs,
     XYZ _hand,
     XYZ _facing,
     bool _cutHost,
     Dictionary <string, ParameterEditRecorder> _params,
     OpContext _opContext)
     : base(_cutHost)
 {
     this.FI          = _fi;
     this.translation = _translation;
     this.FS          = _fs;
     this.hand        = _hand;
     this.facing      = _facing;
     this.paramValues = _params;
     this.Context     = _opContext;
 }
Ejemplo n.º 14
0
        public static WallBasedFamilyCreator CreateSimilar(FamilyInstance _fi, Document _tarDoc, double _hostSearchRange)
        {
            var          refDoc = _fi.Document;
            var          param = _fi.GetAllEditableParams();
            var          refDocId = refDoc.Identifier();
            var          tarDocId = _tarDoc.Identifier();
            DesignOption dop; string dopUid, dopName;

            OpContext.GetActiveDesignOptionInfo(_tarDoc, out dop, out dopUid, out dopName);
            var opContext = new OpContext(refDocId, tarDocId, refDoc, _tarDoc, dopUid, dopName, _fi.Id);
            var hostCat   = HostUtils.GetHostCategory(_fi);
            var hostDir   = HostUtils.GetHostDir(_fi);
            var bb        = _fi.GetBoundingBoxInModelCS(null);
            var bbFilter  = Methods.GetBBIntersectFilter(bb, _hostSearchRange);
            var posPoints = HostUtils.GetPointsInsideWallHost(_fi);
            var search    = new HostSearchSession(_tarDoc, hostCat, bbFilter, hostDir, null, dop);
            var hostWall  = search.FindHostWall(posPoints);
            var ctr       = new WallBasedFamilyCreator
                                (_fi.Symbol, hostWall, _fi.GetPos(), _fi.HandOrientation, _fi.FacingOrientation, _fi.StructuralType, param, opContext);

            return(ctr);
        }
Ejemplo n.º 15
0
 public BasicWallCreator
 (
     WallType _wt,
     Level _baseLevel,
     Curve _offsetLocCurve,
     double _height,
     XYZ _orientation,
     bool _structural,
     bool[] _joinEnd,
     Dictionary <string, ParameterEditRecorder> _param,
     string _designOptionUid = null,
     OpContext _docOpsInfo   = null)
 {
     this.wt              = _wt;
     this.baseLevel       = _baseLevel;
     this.offsetLocCurve  = _offsetLocCurve;
     this.height          = _height;
     this.Orientation     = _orientation;
     this.structural      = _structural;
     this.joinEnd         = _joinEnd;
     this.paramValues     = _param;
     this.DesignOptionUid = _designOptionUid;
     this.Context         = _docOpsInfo;
 }
Ejemplo n.º 16
0
 public ElementRemover(Element _elem, OpContext _docOpsInfo = null)
 {
     this.Elem    = _elem;
     this.Context = _docOpsInfo;
 }