2 questions about FamilyType.ByGeometry

QUESTION 1

I am trying to use the FamilyType.ByGeometry node in such a way that it creates
1 family with 3 Solid Geometries in it.

But when I feed 3 solids, it creates a family with 1 solid, 3 times.

Does anyone know if it’s possible?

QUESTION 2

The FamilyType.ByGeometry node also has a “material” input, but it’s not working for me.
The material is being created inside the family but the material is not being applied to the geometry.
Does anyone else experience this? Can it be solved?

Thanks in advance

For your question 1, the solution is to use Solid.ByUnion node

About the second one, I actually don’t know, maybe it’s a bug.
Let’s see if someone knows something, maybe @Kulkul or @JacobSmall?

Hi, maybe this post will answer your question :

It’s about the former version of this node when it wasn’t an OOTB node but a custom one.

1 Like

Does the material exist in the family template you are using? If not then this explains the issue.

@JacobSmall

Does the material exist in the family template you are using?

No, it doesn’t.

But in my previous screenshot you can see that the material (“Earth”) has been created by the node inside the family.
So I guessed that there was no need for it to exist beforehand.
Am I wrong?

In the example I posted I used the material “default”, which exists in the template.

@lucamanzoni
Did it work? Was the material assigned to the geometry?

Nope, it’s not assigned even if it exists in the template. I have no idea how to solve it

Did you run this from the family environment with a family which was created by the same family template, or the project environment?

From the project environment.
Probably it’s better to use it in the family environment and then load it in the project, am I right?

Project environment

So it stands that the material selected in your project environment will be a different element ID than the material in the given family template - ergo you’re not feeding a material but likely an invalid element id (in my template, the ‘Default’ material is something like element ID 258).

I can’t recall if I used to have a work-around for this by either back ground opening the template and feeding a matching material, feeding in a string, or something else. I do recall that in the end I wound up manually assigning material parameters to each geometry so I could manage materials in the project environment instead of the family one.

1 Like

@JacobSmall
I understand. Though i was expecting the node to have a workflow like:

-Create a new material inside the family, similar to the project material that was fed into the node
-Then assign this newly created material inside the family to the family geometry (so there would be no element ID mismatch)

Much in a similar way as that the node duplicates project environment geometry into the family.

I’m not sure what you mean by duplicating project environment geometry into the family. Assuming you mean to say that you’re pulling project environment elements into Dynamo, getting their geometry, doing Dynamo stuff to them, and then writing to the family environment? In this case you’re not duplicating the geometry by default, but telling Dynamo to duplicate the geometry in the new environment.

In any case, the best solution for now is likely to use a Springs.FamilyInstance.ByGeometry node, which is found in the springs package and works better in the project environment. From there you’d have the family type, with the correct material if it exists in the template (fed in by name), and the first instance of said type in your project. If the instance isn’t desired then simply delete it (Springs.Doc.DeleteElements works, also springs). Additional instances can then be created upstream by using the family output of the node.

1 Like

Sooooo… I played around a bit, and it winds up that this is doable in a somewhat hacky manor, without too much effort or going too far off the rails. It’s pretty well buried under the idiosyncrasies of Revit though. Basically, a Revit Family File and a Revit Family Template have the same content and format under the hood, with a modified extension so Revit handles them differently when opening. This means that you can change the extension of a Revit Family File from .rfa to .rft and get a Revit Family Template file.

Overall, the workflow looks like this:

Steps are basically this:

  1. Before starting in Revit, create a family with no geometry, and all the parameters your office typically wants, and at least one type parameter for material information.
  2. Get the material you want to use from the project.
  3. Load that family into the project, get the original type from the family (remember you’re in the project environment now), set the name, and assign the material parameter to the material which was selected in step 1.
  4. Get the family element from the family type, and save the family out using the File.Save family node in the orchid package. Use a wait for method to ensure the family finishes saving out before you pass along the directory path you saved it to. By adding the material to a parameter value in the project environment before saving we ensure the material is preserved.
  5. Generate two file paths from the family name and the directory path - one for the family file (.rfa) which would have just been saved, and one for a matching family template file (.rft).
  6. Copy the family file to the family template path, and then pass the family template path. We now have a path to a family template which we can use for the Springs.FamilyInstance.ByGeometry node.
  7. Pass whatever geometry, family name, category, and the name of the material from step 1 into the Springs.FamilyInstance.ByGeometry node.
  8. If you don’t want the family instance, use a Springs.Doc.DeleteElements node. If you do want it, skip the node or toggle the Boolean to false so it doesn’t execute.

Thanks to the package authors (@erfajo, @Andreas_Dieckmann and @Dimitar_Venkov) who’s work make this possible.

Push Materials from Project into Family Geometry.dyn (76.2 KB)

4 Likes

That’s great! Many thanks for your support, @JacobSmall.
I will look at this, and try to implement, later on. Caught up on another problem right at this moment.

1 Like

maybe i should start a new topic… i have been working with this node all day…
Now i just changed the template that is used for the node and i get an error…
I changed it back to the original that worked and now i still get an error.

Saving is not allowed, File has been opend by another Revit instance.

the file is on a dropbox location, but i restarted my computer and disabled the dropbox.

strange it dissapeared as quickly as it came