/// <summary> /// Associate the parameters of the selected family to the current family /// </summary> public void Wire() { if (!doc.IsFamilyDocument || !famParam.Any()) { return; //Only work in Family Document that has parameters to associate with } var wireFamily = Utils.PickObject(uidoc, "Pick a Nested Family."); //Get the family to associate to if (wireFamily == null) { return; } var fam = doc.GetElement(wireFamily) as FamilyInstance; if (fam == null) { return; //We could get a random selection, we haven't implemented a Filter (which we could TO DO) } AssociateParameters(fam, ParamType.Instance); //Associate all possible Instance parameters AssociateParameters(fam, ParamType.Type); //Associate all possible Type if (!String.IsNullOrEmpty(AlertMessage)) { DialogUtils.Alert("Warning", AlertMessage); //Finally, alert the user if we had any issues } if (!String.IsNullOrEmpty(SuccessMessage)) { DialogUtils.OK("Wire successful", SuccessMessage); //And, issue an OK message the user for all the successfully processed parameters } }
/// <summary> /// The Main method. Pushes selected parameters into a nested family /// </summary> public void Push() { if (pushParameters == null) { return; //No parameter to be pushed, return } if (familyInstance == null) { return; //If we failed to collect a family instance from user in the previous step, return } foreach (FamilyParameter paramToPush in pushParameters) { SuccessMessage += ExecutePushParamters(familyInstance, paramToPush); //Execute Push Parameter for each Selection and each Selected Paramter } if (!String.IsNullOrEmpty(AlertMessage)) { DialogUtils.Alert("Warning", AlertMessage); //Finally, alert the user if we had any issues } if (!String.IsNullOrEmpty(SuccessMessage)) { DialogUtils.OK("Push successful", SuccessMessage); //And, issue an OK message the user for all the successfully processed parameters } }
/// <summary> /// The Main method. Pushes selected parameters into a nested family /// </summary> public void Pull() { if (!doc.IsFamilyDocument) { return; //Only execute in FamilyDocument } if (pullParameters == null) { return; //No parameter to be pushed, return } foreach (ParameterSelectorModel parameterToPull in pullParameters) { ExecutePullParamters(parameterToPull); //Execute Push Parameter for each Selection and each Selected Paramter } if (!String.IsNullOrEmpty(AlertMessage)) { DialogUtils.Alert("Warning", AlertMessage); //Finally, alert the user if we had any issues } if (!String.IsNullOrEmpty(SuccessMessage)) { DialogUtils.OK("Pull successful", SuccessMessage); //And, issue an OK message the user for all the successfully processed parameters } }