We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

Expression with superscript 5

agroni
Booster

Hi everyone,

 

I have an expression to show the height of Elements in stories including the prefix -, ± and +. In one project, we encountered a problem that this expression was not showing the 5mm values as a superscript. If the true value was 2,105m it was rounding it up to 2,11m. The correct display would be 2,10^5.

agroni_0-1648557801860.png

Here is the expression that I have:

 

CONCAT ( IF ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ) > 0; "+"; IF ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ) = 0; "±"; "" ) ); IF ( ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ) ) >= 1; STR ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ); 2 ); IF ( ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ) ) = 0; STR ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ); 2 ); IF ( ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ) ) <= - 1; STR ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ); 2 ); STR ( STRTONUM ( STRCALCUNIT ( {Property:Öffnung/Mittlere Höhe zu Projektursprung} ) ); 2 ) ) ) ) )

 

Here it is a bit better readable:

agroni_1-1648558038612.png

 

I have tried 2^5, but it did not work since apparently it is a String. For this reason, I was trying to add the 2^5 to STRCALCUNIT, but without success. Which interpretation has the 2^5 for Archicad (Float, Integer)???

 

Is anyone capable of helping me extend this expression?

I would be very thankful.

cheers

The BIMster @ AllesWirdGut
Currently: Archicad 26
User since Archicad 6.5 (2001)
5 REPLIES 5
runxel
Legend

Technically superscript is markup (like bold or itatlic) so there is sadly not direct way to achieve this.

You can cheat however by using a true Unicode superscript 5: "⁵"

This however has one caveat: Some fonts might not have a glyph for this. So use with caution!

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

The font that I use allows generating a superscript as "⁵", so I don't believe it is a problem of the font.

I have another expression in Archicad that can actually do it. It is used for other elements, and it is already long in itself to do the superscript. Embedding this script in my first script will be simply a horror (too long!).

I wanted to know, if there was a possibility to extend my expression, in order to integrate the "⁵".

The BIMster @ AllesWirdGut
Currently: Archicad 26
User since Archicad 6.5 (2001)

For some reason my comment got lost! Someone deleted it?

 

Nontheless, here I go again.

The Font that I am using does allow a superscript, so I would not say it is the problem of the font. There are other expressions that I use and they have the superscript included. Sadly I cannot use those expressions for this particular case.

agroni_0-1648738873030.png

 

 

As I was researching and in communication with GS Germany, I am coming to a conclusion that this 5mm aspect won't work in Archicad. It is not programmable, or it is exceeding my programming capabilities. This is really sad and a disaster, because we are not capable of documenting the 5mm with labels in our plans.

The BIMster @ AllesWirdGut
Currently: Archicad 26
User since Archicad 6.5 (2001)

@agroni wrote:

For some reason my comment got lost! Someone deleted it?


For some reason it got caught by the spam filter.

I have released it now.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Sorry, but what are you talking about?

While it might not be the easiest thing it is absolutely doable. I don't understand how your conclusion was this would not work in Archicad? 🙂

 

IF ( {Property:Allgemeine Parameter/Höhe} < 1,0 m; 
	IF ( RIGHT ( SPLITRIGHT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); ","; 2 ); 1 ) = "0"; 
		LEFT ( SPLITRIGHT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); ","; 2 ); 2 );
		CONCAT ( LEFT ( SPLITRIGHT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); ","; 2 ); 2 ); "⁵" ) );
	IF ( RIGHT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); 1 ) = "0"; 
		LEFT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); 
			LEN ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ) ) - 1 );
		CONCAT (
			LEFT ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ); 
				LEN ( STR ( MROUND ( {Property:Allgemeine Parameter/Höhe} / 1 m; 0,005 ); 3 ) )- 1 );
			"⁵" ) ) )

 

How to achieve the leading "+" is left as an exercise for the reader.

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»