Place 3D text (Generic Model Family) on face of Part

Hi All,

Need a little help, please.

GOAL
To place a 3D Text onto the face of a part (wall/floor/roof). This 3D text will have associated family parameters included in the Family so that the 3D text will show the selected parameters of the part. Basically, like trying to apply a 3D annotation. The reason why I want to do this is that I want to export parameters to 3D IFC, to be used further down the line as references (I work with CLT manufacturing)

I have thought of a few different ways to solve this.

Using a Boundary box to find the center point and apply mapped 3D text. So this positioned the 3D text on the center point of each part however the 3D text is not aligned to the surface of the part and the center point is in the center of the part.

After this, I thought I should find a surface to position the 3D text on. To do this I decided that I’ll find the largest surface area and use 1 of the 2 largest surface areas. Knowing that the 2 largest surfaces area would be the exterior/interior surface of the part, So this works, I find 1 surface that I would like to position the 3D text on.

The problem I have now is that I need to find the center point of this surface BUT I don’t have surfaces anymore, I have a list of numbers (areas). So not sure how to use this data to get points.

I also realize that maybe it’s better to use a face-based family, I did try this using the surfaces from the Element.Faces method but the result was worst - all the 3D text were inserted on Level 0 (last iamge)

any ideas?


Hello,

Is this realy nessercary? Can not just constrain the 3D view and Tag all components?

KR

Andreas

The main want is to have exportable annotations. The reason for this are:

  • To give the site installation team a model where they can see the installation number (part mark) and other properties that may be of use (weight of element etc.) I know they can just click the element in the IFC to find the properties but this isn’t really the easiest way.
  • As a way to reference the properties after they have been converted in CNC CLT manufacturing software. The export/import translators from IFC are not so advanced yet, meaning properties get lost in the translation. Having annotations that can export to IFC and import to AutoCAD would be beneficial.

I know that there is IfcAnnotation ability but can’t see to get this to work and not sure how it would export all the parameters anyways.

The solution I’m thinking of is t have 3D model text, as this is easily exported to IFC and dwg

I can follow you. That sounds like work. If you have fixed number of components and you use libraries. you could export a overview of annotations as .dwg.

You could import the .dwg in the families, explode the text into lines(before import)…create 3D-text as modellines.

tragily i don`t know a dynamo-package of creating text in family-templates.

I was creating Letters for a task in 3D but it took a lot of time…

KR

Andreas

@chris.thompsonWUR6K let me point out first that Model Text will affect your Revit performance, that being said,
A face based generic model family is used in the following example,
The biggest faces by area are extracted from elements,
The faces can be reduced to 1 instead of 2 (1 Model Text instead of 2 per element),
The rotation is being repeated 2 times because some model texts require a 0 degree rotation instead of 180 degrees, maybe a Python solution can be more elegant instead of repeated nodes,
Clockwork and DynaMEP packages are used.
Hope it works for you:



test.dyn (66.7 KB)

2 Likes

3D text test.rvt (1.9 MB)
3D text.rfa (404 KB)

@Elie.Trad

Thanks loads, that’s almost the result! Some nodes that I’ve neve used. So much to lean :smiley: .I added the mapping of associated parameters. So now the 3D text reads/writes a parameters from the host element, which is great!

2 things to sort.

Note that I am wanting to apply the 3D text to Parts, in most cases there are multiple parts to a wall/floor/roof.

  • Some of the 3D text are coming on the opposite side. Ideally all the text stays on the same side. any idea?
  • There seems to be an extra 3D text being generated, I think this is to do with the original part being subdivided. So for example there is 1 wall that originally was 1 part, then that 1 part was subdivided into 4 parts. I think the script is reading the original 1 part also.

@chris.thompsonWUR6K Change the value to 1 to get only one model text, the thing is I cannot control which should be the “outside” face facing your camera, this is why I gave the idea of extracting 2 faces, if it is enough to be in Wireframe mode to check the Model Text family, then this approach is better:

Edit: I see you did that, need to investigate what you are saying, regarding the extra family (second point)

@chris.thompsonWUR6K sorry for the late reply,
1-To unify the position (side) of the families, I used a reference point.
2-Apparently, All Elements Of Category will collect all parts (Original and Children), I did not find any node that will collect only the children while collecting parts, but I did manage to do it using Python, maybe someone else can do a more elegant approach:

import clr

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

elems = UnwrapElement(IN[0])
col = []
for elem in elems:
	parts = PartUtils.GetAssociatedParts(doc, elem.Id, True, True)
	for p in parts:
		if p != None:
			col.append(p)

OUT = [doc.GetElement(c) for c in col]

P.S.: if no families are required to be rotated using 0 Degree, the script will return an error, but it should be fine.
If it is works for you, please mark it as a solution.


Model Text.dyn (94.5 KB)

Hi @Elie.Trad

That’s no issue at all, thank for taking the time to look at this!

The solution is great, I’ve substituted the “All Elements of Category” for a “Select Model Elements of Category” which gives more flexibly on selecting what elements should be enhanced with the 3D text. Weirdly I didn’t include the python script but it still only collects the children, so not sure why that works but it’s a good thing.

Is there a way to include a node that can flip the side that the 3D text gets generated on? So if I run the scrip and I see the 3D text is on the wrong side, I would delete the text and change a parameter in the script then re-run so that the text comes on the other side.

Thanks again for helping out


3D text test.rvt (2.0 MB)
Uploading: 3D text Updated.dyn…

@chris.thompsonWUR6K Select Model Elements will definitely select what is in the Viewport only, so no need for the Python script, I thought you wanted more of a one-shot Run :slight_smile: , nevertheless, as long as it is working that would be great.
Regarding the flipping, the (-2) integer I mentioned earlier is to get 2 faces, now if you want the other sideS instead of the facing ones, you just set unique (it’s a node) between the result of the ClosestPointTo node and the TakeItems node.
Remember if you are having a hard time with the reference point, it should be away and higher of all of your elements, setting it like that will assure you get consistent orientation.

Thanks for the help!

1 Like

I am getting error what could be the cause?

I change the “Parts” to “Wall”

Please look into it here is the Revit file…
Project1.rvt (6.2 MB)

I intend to write a script that will automatically place model text of choice, example “Cool Element” on any element. Thanks.

I used the dynamo file here

Hello,
Here is a potential solution (to be improved)
It is very greedy in execution time (Only try on 5 walls)
As my walls are made in depth, the positioning of -1.25m is negative.
the Identifiers fields must be filled in

I join you family and script

family:
etiquette 3D.rfa (348 KB)
script:
20 Aout forum anglais rep4.dyn (115.3 KB)


Cordially
christian.stan