Who knows, since this seems to be an ever changing program right now, it just may be revised again in the next release.
Well, I finally had enough of digging into the Point Settings in order to change the next point number. So I added a NEXTPT routine. It only took about 30 minutes - most of that writing the part that checks to see if the point number is already being used - and it means I don't have to wait for Autodesk to fix it.
It complements the FREEPT (list available point numbers) routine I posted yesterday. I have NEXTPT aliased to NX, and FREEPT aliased to FR, so it's quick and easy to run either one.
A DLL is posted
here.
/*
* Created by Richard Sincovec
* User: Sinc
* Date: 3/15/2007
* Time: 6:28 PM
*
*/
using System;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AECC.Interop.Land;
using Civil3DUtilities;
namespace Sincpac.PointNumbers
{
/// <summary>
/// Change the next point number in the Point Creation Settings.
/// </summary>
public class NextPointNumber
{
public NextPointNumber()
{
}
[CommandMethod("NEXTPT")]
public void NextPointNumberCommand()
{
C3DUtil c3dUtil = new C3DUtil();
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
AeccSettingsPointCreation settings = c3dUtil.AeccDb.Settings.PointSettings.CreationSettings;
PromptIntegerOptions piops = new PromptIntegerOptions("\nNext point number:");
piops.DefaultValue = settings.NextPointNumber.Value;
piops.AllowZero = false;
piops.AllowNegative = false;
piops.AllowArbitraryInput = false;
PromptIntegerResult pires;
bool tryAgain = true;
do {
pires = ed.GetInteger(piops);
if (pires.Status == PromptStatus.OK) {
try {
AeccPoint pt = c3dUtil.AeccDb.Points.Find(pires.Value);
ed.WriteMessage("\nPoint {0} already exists!", pt.Number);
} catch {
settings.NextPointNumber.Value = pires.Value;
tryAgain = false;
}
}
} while (tryAgain && (pires.Status == PromptStatus.OK));
}
}
}