9 hours ago
I would like to edit the Surface Label 25 to show the text of a surface before a delimiter. For example:
Surface Name is TC:Timber Cladding
Label to shown only TC
This is the code I have used to get this working on a wall label i wrote a while ago:
But I cant figure out where to catch the surface name and split it in this object. I think it might be happening in the macro label_content_macro. Any wizards out there that can figure this out??? @Barry Kelly ?
Of course this would not be required if GS would give us an ID field for surfaces the same as building materials.
Operating system used: Mac Intel-based 12
8 hours ago - last edited 7 hours ago
Yes, that is the correct place where the suface is gathered from.
from gdl
(they are just using a parameter with SURFACE_ in front of the desired gdl code in this list...
from the macro
which then gets the id of the surface
_iAvailableMaterialContent
that then convert's into a name
_nameSurface
which gets assigned to:
_sSegmentLocal
which gets assigned to
_sSegmentGlobal
which gets assigned to
sRowsOfLabel
which gets assigned to
tempsRowsOfLabel
Which gets returned from the macro using the "end returned_parameters" command...
I love the way Graphisoft make this easy to find...
P.S.
it looks like the typed prefex is in array point 1
and the material is in array point 5
using the following in a copy of the surface label
text2 0,1,_sContentStringsHead[1][1]
text2 0,2,_sContentStringsHead[1][5]
8 hours ago
Having a quick look at that surface label, it seems it calls a subroutine to "collect_content".
This returns the information for the surface that is stored in the parameter array ... _sContentStringsHead
So I am assuming you would need to perform your SPLIT routine on that parameter value to get the part of the name that you want.
There are 2 GOSUBs in the label, one to get the information and one to display it.
Your split routine needs to be done between those two GOSUBs.
The thing is that _sContentStringsHead parameter is an array, so you will have to figure out what part of that array the information is in for the surface name.
You then need to SPLIT that name and then replace it back in the array so it is then used in the 'position_and_draw_label' sub-routine.
At the moment I don't have the time to investigate further.
But hopefully that will give you a start.
Barry.
8 hours ago
Well I dont feel so silly not being able to trace that, now Ive seen how serpentine the structure is. Thankyou for your detective work @AllanP
8 hours ago
I will give this a shot @Barry Kelly, thanks for your time looking into this. I'll post the hacked label if I'm able to get it to work.
3 hours ago
Thanks for your PS @AllanP
I got it to work with this. It will be a very useful label now 🙂
I just need include an IF statement to check if there is a ":" in there and it will be good to go!