Exemplo n.º 1
0
 public void SelectProcessCommand(ITechProcess techProcess, ProcessCommand processCommand)
 {
     if (processCommand.ToolpathObjectId.HasValue)
     {
         Acad.SelectObjectIds(processCommand.ToolpathObjectId.Value);
     }
     Acad.RegenToolObject(techProcess.Tool, processCommand.HasTool, processCommand.ToolLocation, techProcess.MachineType == MachineType.Donatoni);  //Settongs.IsFrontPlaneZero
 }
Exemplo n.º 2
0
        public void AddCommand(ProcessCommand command)
        {
            command.Owner  = _techOperation ?? (object)_techProcess;
            command.Number = ProcessCommands.Count + 1;
            ProcessCommands.Add(command);

            if (_techOperation != null && !_techOperation.ProcessCommandIndex.HasValue)
            {
                _techOperation.ProcessCommandIndex = ProcessCommands.Count - 1;
            }
        }
Exemplo n.º 3
0
        public void PartialProcessing(ITechProcess techProcess, ProcessCommand processCommand)
        {
            Acad.Write($"Выполняется формирование программы обработки по техпроцессу {techProcess.Caption} с команды номер {processCommand.Number}");

            var toolpathObjectIds = techProcess.ToolpathObjectIds.ToList();

            techProcess.SkipProcessing(processCommand);

            Acad.DeleteObjects(toolpathObjectIds.Except(techProcess.ToolpathObjectIds));
            Acad.Editor.UpdateScreen();
        }
Exemplo n.º 4
0
        public void GCommand(string name, int gCode, string paramsString = null, Point3d?point = null, double?x = null, double?y = null, double?z = null,
                             double?angleC = null, double?angleA = null, Curve curve = null, int?feed = null, Point2d?center = null)
        {
            var command = new ProcessCommand {
                Name = name
            };

            if (point == null)
            {
                point = new Point3d(x ?? ToolLocation.Point.X, y ?? ToolLocation.Point.Y, z ?? ToolLocation.Point.Z);
            }

            command.Text = GCommandText(gCode, paramsString, point.Value, curve, angleC, angleA, feed, center);

            if (ToolLocation.IsDefined)
            {
                if (curve == null && ToolLocation.Point.DistanceTo(point.Value) > 1)
                {
                    curve = NoDraw.Line(ToolLocation.Point, point.Value);
                }

                double length = 0;
                if (curve != null && curve.IsNewObject)
                {
                    if (Colors.ContainsKey(name))
                    {
                        curve.Color = Colors[name];
                    }
                    curve.LayerId = _layerId;
                    _currentSpace.AppendEntity(curve);
                    _transaction.AddNewlyCreatedDBObject(curve, true);
                    length = curve.Length();
                }
                command.ToolpathObjectId = curve?.ObjectId;

                if ((feed ?? _feed) != 0)
                {
                    command.Duration = (curve != null ? length : ToolLocation.Point.DistanceTo(point.Value)) / (gCode == 0 ? 10000 : feed ?? _feed) * 60;
                }
            }

            _GCode = gCode;
            ToolLocation.Set(point.Value, angleC, angleA);
            _feed = feed ?? _feed;

            command.HasTool      = _hasTool;
            command.ToolLocation = ToolLocation.Clone();

            _commands.Add(command);
        }
Exemplo n.º 5
0
 public void PartialProcessing(ITechProcess techProcess, ProcessCommand processCommand)
 {
     Acad.Write($"Выполняется формирование программы обработки по техпроцессу {techProcess.Caption} с команды номер {processCommand.Number}");
     techProcess.SkipProcessing(processCommand);
     Acad.Editor.UpdateScreen();
 }