示例#1
0
        public static void CreateBeam()
        {
            _AcGe.Point3d p0, p1, pside;

            //
            // Get some user input:
            //
            _AcEd.Editor ed = _AcAp.Application.DocumentManager.MdiActiveDocument.Editor;

            _AcEd.PromptPointOptions ppo = new _AcEd.PromptPointOptions("\nSelect start point of beam: ");
            ppo.UseBasePoint = false;

            _AcEd.PromptPointResult ppres = ed.GetPoint(ppo);
            if (ppres.Status != _AcEd.PromptStatus.OK)
            {
                return;
            }
            p0 = ppres.Value;

            ppo.UseBasePoint = true;
            ppo.BasePoint    = p0;
            ppo.Message      = "\nSelect end point of beam: ";
            ppres            = ed.GetPoint(ppo);
            if (ppres.Status != _AcEd.PromptStatus.OK)
            {
                return;
            }
            p1 = ppres.Value;

            ppo.BasePoint = p1;
            ppo.Message   = "\nSelect side of beam drawing direction (Press ESC for on centre line): ";
            ppres         = ed.GetPoint(ppo);
            if (ppres.Status == _AcEd.PromptStatus.Cancel)
            {
                pside = new Teigha.Geometry.Point3d(); // send empty point, could do better here with keywords for the propmt.
            }
            else
            {
                pside = ppres.Value;
            }

            //
            // Create the beam:
            //
            BeamData   beamData   = new BeamData(200, 120, 6000, p0, p1, pside);
            BeamDrawer beamDrawer = new BeamDrawer(beamData);

            beamDrawer.DrawBeam();
        }
示例#2
0
 public BeamDrawer(BeamData beamData)
 {
     _beamData = beamData;
 }