Edit a Profile Family's DetailCurves in background

I’m having trouble with this, and it may not be possible. I’ve looked at many other posts but none seem to have been resolved.

Right now, the user has to look at the Mullion, find the Profile family in the browser, Edit the Profile Family, and run a script in that Family environment, then load it back in. It works but it’s clunky. I want them to be able to edit the Family directly from the Model environment.

What I’d like to do:

(In a .rvt model)

  1. Select a mullion, find the Profile Family its using (done)
  2. Open the Family in the background (done)
  3. Delete all DetailCurves out of the Family (where I’m stuck)
  4. Create new DetailCurves from curves in a Polycurve (that is generated elsewhere)
  5. Load the Family back into the model
  6. Close the Family in the background, saving irrelevant

Here’s a picture and my full script. I’m using ChatGPT to help with the Python but it can’t seem to overcome the errors. It started suggesting copying the new Polycurve to a new Family and using that to overwrite, instead of deleting the DetailCurves from the original Family.


STADIUM_Edit Parabolic Tier Profile.dyn (37.7 KB)

Edit: I was apparently looking for the wrong terms. Jacob Small wrote this already: