cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Collaborate forum

Expression with superscript 5

agroni
Contributor

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 24 & 22
User since Archicad 6.5 (2001)
5 REPLIES 5

runxel
Ace

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!

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«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 24 & 22
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 24 & 22
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 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

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.

Mostly AC 26 on Mac | Author of SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

Start a new conversation!

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!