I'm working on an add-in tool that would be very similar to the stock Add Line Point Tool with the goal of adding line points between a start and end point on the selected fabric points. The goal is to add a batch of line points at once on these selected fabric points. It appears that I need to use ICadastralLinePoints, AddLinePoint method. This method is not working. At this point, I think there is a problem with my CadastralPacket. I don't have any kind of a new parcel started when I use the tool, it's just some selected fabric points. Does anyone have an example or guidance? I hacked code from the NewParcel Parcel Fabric Code Snippet. The line in the while loop fails either because the packet is null or depending on how I try to get the packet, with an exception having no meaningful message.
ICadastralExtensionManager pCadExtMan = (ICadastralExtensionManager)ArcMap.Application.FindExtensionByCLSID(pUID);
ICadastralEditor pCadEd = (ICadastralEditor)ArcMap.Application.FindExtensionByCLSID(pUID);
ICadastralPacketManager pCadPacketMan = (ICadastralPacketManager)pCadEd;
bool bStartedWithPacketOpen = pCadPacketMan.PacketOpen;
if (!bStartedWithPacketOpen)
{
pEd.StartOperation();
}
ICadastralMapEdit pCadMapEdit = (ICadastralMapEdit)pCadEd;
pCadMapEdit.StartMapEdit(esriMapEditType.esriMEMapExtent, "Batch Add Line Points", false);
ICadastralPacket pCadaPacket = pCadPacketMan.JobPacket; //Get job packet
ICadastralPacketStatistics pStatistics = (ICadastralPacketStatistics)pCadaPacket;
ICadastralLinePoints pCadLinePoints = (ICadastralLinePoints)pCadaPacket;
pEnumIDs.Reset();
int oid;
while ((oid = pEnumIDs.Next()) != -1)
{
pCadLinePoints.AddLinePoint(startID, endID, oid);
}