public ClsResults(Document doc, int instId, int hostId, ClsParameter h, ClsParameter i, String hName, String iName) { _Doc = doc; _InstanceId = instId; _HostId = hostId; _HostParameter = h; _InstanceParameter = i; _HostValue = h.Value; _InstanceValue = i.Value; _HostName = hName; _InstanceName = iName; }
void RunComparison() { ClsCategory catInst = this.comboInst.SelectedItem as ClsCategory; foreach (Element elem in catInst.InstanceElements) { try { FamilyInstance inst = elem as FamilyInstance; if (inst != null) { Element host = inst.Host; ClsParameter paramInst = new ClsParameter(inst.get_Parameter(this.comboInstProp.SelectedItem.ToString())); ClsParameter paramHost = new ClsParameter(host.get_Parameter(this.comboInstProp.SelectedItem.ToString())); if (paramInst.ParameterObject != null && paramHost.ParameterObject != null) { _Results.Add(new ClsResults(_Settings.Doc, inst.Id.IntegerValue, host.Id.IntegerValue, paramHost, paramInst, host.Name, inst.Name)); } else { Element instType = _Settings.Doc.GetElement(inst.GetTypeId()); Element hostType = _Settings.Doc.GetElement(host.GetTypeId()); paramInst = new ClsParameter(instType.get_Parameter(this.comboInstProp.SelectedItem.ToString())); paramHost = new ClsParameter(hostType.get_Parameter(this.comboInstProp.SelectedItem.ToString())); if (paramInst.ParameterObject != null && paramHost.ParameterObject != null) { _Results.Add(new ClsResults(_Settings.Doc, inst.Id.IntegerValue, host.Id.IntegerValue, paramHost, paramInst, host.Name, inst.Name)); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } LoadResults(); }