static void FindAllMimics(ScxV6DbClient.IScxV6Object group, ViewX.Application vwx, String SystemName, ScxV6DbClient.ScxV6Server db) { var groups = group.List("CGroup"); foreach (ScxV6DbClient.IScxV6Object childgroup in groups) { Console.WriteLine("Group, " + childgroup.FullName.Replace("\"", "\"\"")); FindAllMimics(childgroup, vwx, SystemName, db); } var mimics = group.List("CMimic"); foreach (ScxV6DbClient.IScxV6Object mimic in mimics) { ProcessMimic(vwx, SystemName, mimic, db); } }
static void Main(string[] args) { ViewX.Application a = new ViewX.Application(); a.Logon("Local", "s", "s"); a.Mimics.OpenFromServer(false, "Local", ""); a.Visible = true; ViewX.Mimic oMimic = (Mimic)a.Mimics.OpenFromServer(false, "Local", "New Mimic"); ViewX.DrwLayers oLayers = oMimic.Layers; oLayers.Add("Extra"); var oSquareRef = oLayers["Extra"].AddRectangle(100000, 150000, 500000, 650000); oLayers["Extra"].SelectObject((DrwObject)oSquareRef); oMimic.ActiveLayer = oLayers["Extra"]; oMimic.DeleteSelected(); oMimic.Save(); oMimic.Close(); }
static void Main(string[] args) { string SystemName = args[0]; string UserName = args[1]; string Password = args[2]; string MimicName = ""; if (args.Count() == 4) { MimicName = args[3]; } ViewX.Application vwx = new ViewX.Application(); vwx.Logon(SystemName, UserName, Password); Console.WriteLine("Logged in to ViewX"); ScxV6DbClient.ScxV6Server db = new ScxV6DbClient.ScxV6Server(); db.Connect(SystemName, UserName, Password); Console.WriteLine("Logged in to Server"); // Hide ViewX for performance vwx.Visible = false; if (MimicName == "") { var root = db.RootObject; Console.WriteLine("Got root object"); FindAllMimics(root, vwx, SystemName, db); } else { var mimic = db.FindObject(MimicName); ProcessMimic(vwx, SystemName, mimic, db); } vwx.Visible = true; Console.ReadKey(); }