//[AcTrx.CommandMethod("Land_InsertBlocksAlongLine")] public static void InsertBlocksAlongLine() { AcEd.PromptPointOptions ppo = new AcEd.PromptPointOptions("Вкажіть першу точку:"); AcEd.PromptPointResult ppr = CurrentCAD.Editor.GetPoint(ppo); if (ppr.Status == AcEd.PromptStatus.OK) { AcGe.Point3d startPoint = ppr.Value; ArraysBlocks arrBlock = new ArraysBlocks("11", 1, 0, startPoint); ppo.Message = "Вкажіть напрямок:"; ppo.UseBasePoint = true; ppo.BasePoint = startPoint; ppr = CurrentCAD.Editor.GetPoint(ppo); AcGe.Point3d dirPoint = ppr.Value; arrBlock.DisplayAlongLine(dirPoint, 0, 50, 100); } }
public static void DisplayIntersectionGridLines() { string strMsg = "Побудова перетину ліній координатної сітки > Масштаб креслення (1:1000 - 1.0, 1:500 - 0.5 ...) :"; AcEd.PromptDoubleOptions pdo = new AcEd.PromptDoubleOptions(strMsg) { AllowNegative = false, AllowZero = false, AllowNone = false }; AcEd.PromptDoubleResult pdr = CurrentCAD.Editor.GetDouble(pdo); if (pdr.Status == AcEd.PromptStatus.OK) { double scaleDrawing = pdr.Value; AcEd.PromptPointResult ppr = CurrentCAD.Editor.GetPoint("Побудова перетину ліній координатної сітки > Вкажіть першу точку:"); if (ppr.Status == AcEd.PromptStatus.OK) { AcGe.Point3d basePoint = ppr.Value; AcEd.PromptCornerOptions pco = new AcEd.PromptCornerOptions("Побудова перетину ліній координатної сітки > Вкажіть другу точку:", basePoint); ppr = CurrentCAD.Editor.GetCorner(pco); if (ppr.Status == AcEd.PromptStatus.OK) { AcGe.Point3d сornerPoint = ppr.Value; double stepGrid = scaleDrawing * 100; double newX = (double)((int)(basePoint.X / stepGrid)) * stepGrid; double newY = (double)((int)(basePoint.Y / stepGrid)) * stepGrid; if ((сornerPoint.X - basePoint.X) > 0) { newX += stepGrid; } if ((сornerPoint.Y - basePoint.Y) > 0) { newY += stepGrid; } AcGe.Point3d startPoint = new AcGe.Point3d(newX, newY, 0); int numCol = (int)((сornerPoint.Y - startPoint.Y) / stepGrid); int numRow = (int)((сornerPoint.X - startPoint.X) / stepGrid); double stepCol = stepGrid; double stepRow = stepGrid; if (numCol < 0) { stepCol *= -1; } if (numRow < 0) { stepRow *= -1; } ArraysBlocks arrBlock = new ArraysBlocks("11", scaleDrawing, 0, startPoint); arrBlock.DisplayArrays(Math.Abs(numCol) + 1, Math.Abs(numRow) + 1, stepCol, stepRow); } } } }