Show spot height (elevation) labels: contd

As a continuation to the topic, http://forums.sketchup.com/t/show-spot-height-elevation-labels, is there some straightforward way to automatically add a label in LayOut showing the spot elevation, i.e. z value, of a surface, e.g. as follows?

Capture

Good example of why data should stay with the model, not the presentation of the model - -of course you can use TIGS extension in SU, and display in LO [but Trimble never really sorted out displaying SU text and dims in LO] , or wait for trimble to make the LO API useful

@gsharp, using TIG’s plugin, how exactly would one bring the values into LO producing a label at a given location? Label should read e.g. ”+10.88”. There should be just the label, no arrows, no boxes.

I didn’t suggest it would be perfect, you could modify the script to remove those elements… but at least your tag would be integral with the model and therefore accurate…

Yes, (relative) heights are always the biggest problem in construction.
In the Netherlands, we use the sign (+,-) to indicate the height relatively from the ‘finished floor of the first level’
But when the client decides to go for a 1” thick solid wood and the fire department of the building committee adds a few cm’s to the slab, things get tricky.

To get proper results in Sketchup for exporting to IFC, you need to set a dummy component at the origin of the drawing axes. Because everything is nested, they all refer to that origin.
A simple Autotext Tag in LayOut would suffice (<Z>), for relative,
a configurable one would be needed.

Data extracted from the model is then always guaranteed (just be sure to use the right model) and manually altering for representation ( adding signs etc) is not needed, reducing the fail factor.
@Anssi dynamic component for elevation might work, but it still would be sort of a ‘hack’ and you would need to place them in the Model, right?

4 Likes

Yes. My workaround involves a DC that looks like our standard elevation symbol and calculates a text attribute based on its blue (Z) position value, allowing the user to add a constant if the model origin is not at the actual “sea level”. Then, in LayOut , a label is set to display this attribute.

4 Likes

Usually (for me) slabs and floors are drawn as groups or new components and the attributes should be added, every time.
Do you have some sort of dummy floor component?
Curious…

Check this thread, also:

The original question is how to bring the elevation information into Layout, with TIG’s plugin I get the following. Neither the line nor word “Height” can be removed. Any suggestions, did someone have a workaround?

The end result, which I am trying to accomplish in LO is as follows, which shows two elevations, the original and the planned. (the SU model contains two surfaces for this purpose).

One, could of course do it manually, by hand, and input the results with text boxes.

The height tag code in the #heighttool_datum.RB file’s code can be readily edited… use Notepad++ on PC or on a MAC use a plaintext editor like TextWrangler or BBedit…

Simply remove the 'Height: '*** text from the strings in various places…

So in line#74
txt="Height: #{z}"
become
txt="#{z}"

Later on it also occurs in line#103 AND line #109 as:
e.set_text("Height: "+(e.point.z+@datum).to_l.to_s)
which becomes
e.set_text((e.point.z+@datum).to_l.to_s)

And then in line#127 AND line#184
t.set_text("Height: "+(t.point.z+datum).to_l.to_s)
becomes
t.set_text((t.point.z+datum).to_l.to_s)

You don’t need to change line#61 as it’s a transitory message displayed at the cursor as you place the tag…

To change the ‘leader’ details you can edit the code - e.g. the offset ‘vector’ can be [0,0,0], in line#42
@vec=[2,2,2]
becomes
@vec=[0,0,0]

OR to remove the leader lines/dot… line#82 AND #180
t.display_leader=true
becomes
t.display_leader=false

OR to remove the leader line #82 AND #181
t.leader_type=1
becomes
t.leader_type=0

OR to avoid just the ‘dot’ line#83 AND #182
t.arrow_type=2
becomes
t.arrow_type=0

For full details see here: Class: Sketchup::Text — SketchUp Ruby API Documentation

PS:
*** If you want to add a ‘+’ to the start of the height’s text, then consider replacing the text-string 'Height: ’ with '+ ’

4 Likes

@TIG, thanks! Do you know if it possible to add text right above the mouse pointer (no leader)?

The picked point is the origin of the Text object.
If there’s a leader it’s the arrowhead.

My previous code showed how to avoid the leader.

The picked origin is the bottom-left of the text, not the center-left.
The text block varies as its size is zoom dependent.

You could recast the code to make a 3d-text label…
In some ways that is simpler - look up other examples - e.g. my 2Dtools > Text…

Obviously we need to get the point’s height !

Sorry TIG, didn’t mean to drop you in it…

looks like nothing can suppress your amazing talents

And thanks for confirming my advice wasn’t misplaced :slight_smile:

So if I understand correctly, the labels are added in the SketchUp Model.
Until certain features aren’t implemented in LayOut, workarounds, extensions and hacks in SketchUp will always be needed. Simple basic information like heights, area and volume should be part of the dynamic-data-extracting combo of SketchUp and LayOut, IMO.

It may not apply for users that work alone, but in many cases, models are shared. Some need Area, some only Volume. If you import a (part of a) Model as reference and all the Metadata is there in a visible, personally styled ‘Face me’ label, be it organised by layers or scenes, many users would like to implement their own style. Some in LayOut, some in other programs.

We could wait for the LayOut API, but I would like basic stuff handled correctly, natively.

And yes, TIG (sh,c)ould be Prime-minister :slight_smile:

1 Like

What a bunch of steps that everyone has provided in this thread… Just surprised that there is no easy way of doing this with a plugin already made or that sketchup hasn’t provided this easy option. Setting a datum height is a very common requirement for building designers.

A tool for this function is definately something that would be very useful.

I am looking to replicate the code variations listed above, thank you TIG.

I know very little about scripts. The rbz file that is currently downloadable does not appear the same in Notepad++ as listed.

Is there a way to achieve the same results with this file.

I place elevation marker components into my model and then add an autotext label in LayOut:
In section:
image
In plan:
image
No programming is involved, except that the marker is a dynamic component in order to format the text in meters in an otherwise millimeter-using model.

1 Like

Very nice! Doesn’t require Ruby code, but does require a dynamic component as you described back here, yes?

The “dynamic” part is only about text formatting. I use millimeters with a high precision in my SKPs, and our standard requires spot heights in meters. The <coordinates(z)> autotext uses the units setting from the model.
Here, for comparison, labels using the autotext tag:
image

Numbers formatting for LayOut would be IMO a good feature request.

Curious, can you achieve the same result using “Live Components” ?

would they be better? PS nice solution @Anssi