Hello - I’m having some difficulty trying to insert a Generic Model onto a reference plane successfully. Minimum reproduceable example attached below. Essentially I’m using Add Component (Location) to insert a pre-existing Generic Model family (which has the tickbox checked to allow inserting on reference planes) onto a selected reference plane as the host.
When this family is inserted manually through the Revit UI, all behaves as expected: I can insert the family onto a reference plane (named ‘CurtainBase’ in this example), and in the properties of the instance in Revit under Constraints I see the Work Plane parameter is equal to “Reference Plane: CurtainBase”. The ‘Pick New’ button is live in the Revit toolbar and I can move the family to a new face or work plane. Adjusting the height of the reference plane CurtainBase moves the family up and down.
Now, if I insert the same family using the grasshopper script attached, there are no errors, but things are not quite working. The family inserts at Z=0 rather than at the height of the reference plane, and once inserted in the properties of the instance in Revit under Constraints I see the Work Plane parameter is equal to “CurtainBase” - note the slight difference. The ‘Pick New’ button in the Revit toolbar is greyed out so the work plane or face cannot be changed. Adjusting the height of the reference plane has no affect on the family - in other words, it’s as if the family hasn’t been associated at all with the reference plane except that the Work Plane parameter in the family has some reference to it.
I’ve played around with different ways of using the Host input on the Add Component (Location) button but no joy. Am I doing something wrong or is this a bug somewhere?
I should also say I’m afraid I can’t share the family, but I’m fairly confident it’s not the family as the same results occur with any given Generic Model family I’ve tried, including a new one from template containing nothing other than a box.
How would I set the workplane or rehost the object after creation? I can’t see an obvious way to do this from searching around the component list or online. Attempting to set the Work Plane parameter using the Element Parameter block returns an error ‘Can’t set parameter. “Work Plane” is read-only’ - which I suppose I’d sort of expect because you can’t edit this parameter directly in the Revit properties window either.
Manually. Placing without the host and setting the workplane will keep tracking, the workplane, ability to set location in Gh as well as change the WP in the Revit UI.
I’m creating a bug report for the tracking behavior when switching Hosts (creates a new Element in certain situations). Will see how it goes after that, there appear to be some Revit API limitations.
Ah, okay, I thought you might have meant there was a way to place on a workplane from within the patch rather than manually back in Revit. Unfortunately that’s going to be quite tedious for us given the number of things we need to insert; I’ll look into alternative approaches for now and look forward to any potential bugfix - thanks!
Note that you can select multiple families and use the Pick New Revit UI feature.
Its kind of funny, I’m working with another user who wants the exact opposite. Take hosted families (made from hosted family templates) and turn them into non-hosted.
In my project the best would be if some families could be hosted by levels instead of other families.
Bacause I want family to stay in the same place and only change hosts, after picking the new host I need to calculate the new offset distance but that should be easy.