private static void AddNetInfos(IStep step, IODBLayer parentLayer, String NetName, IODBObject netItem) { if (NetName.Length == 0) //the default net { NetName = "$NONE$"; } int lastNetNr = step.GetNets().Count; INet outNet = step.GetNet(NetName); int netNr = -1; if (outNet == null) { netNr = step.AddNet(NetName, "", out outNet); } else { netNr = outNet.GetNetNumber(); } netItem.PcbNetNumber = outNet.GetNetNumber(); //set the netinformation to the object int newNr = outNet.AddLayerRef(parentLayer.GetLayerName(), lastNetNr); //each net saves a list of all layers are used. if (newNr == lastNetNr) { lastNetNr++; } parentLayer.SetNetNumber(NetName, netItem.PcbNetNumber); //for each object the layer needs information that this net is used. outNet.AddFID(PCBI.FidType.Copper, parentLayer.GetLayerName(), netItem.GetIndexOnLayer(), ""); //this is specific to ODB++, if you don't use it and save the data as ODB++ some information get lost. }