Support Forum

[Frage] Attribut per Smartpart-Befehl definieren [Gelöst]

Schlagworte:

Hallo Zusammen
Ich würde gerne den Wert eines Parameters im Dialog-Fenster darstellen lassen. An sich ist das ja kein Problem, allerdings sollte der Wert des Parameters aus 2 anderen Parameterwerten zusammengesetzt werden. Der 1. Wert ist z.B. "0,900", der 2. Wert "1,100". Jetzt würde ich mir das gerne folgendermassen darstellen lassen:

0.900/1.100

Mit diesem Befehl funktioniert das ja:
PARAMETERS schachtdurchmesser_attribut = "0.900" + "/" + "1.100"

Wenn ich allerdings die Attribute einsetzte
PARAMETERS schachtdurchmesser_attribut = "di1_schacht_oval" + "/" + "di2_schacht_oval"

wird folgendes angezeigt:
di1_schacht_oval/di2_schacht_oval

Kann mir jemand helfen?

Vielen Dank schon im Voraus
yarn

Anhänge (1)

Typ: image/jpeg
53-mal heruntergeladen
Größe: 26,24 KiB

Lösung anzeigen Lösung verbergen

@Bertrand

Your solution would only work, if di1_schacht_oval and di2_schacht_oval holds string-values!

If this are numeric values, then you have to convert to string with STR:

PARAMETERS schachtdurchmesser_attribut = STR(di1_schacht_oval,1,3) + "/" + STR(di2_schacht_oval,1,3)

Hallo,

You put some double quotes (") and then this is as text and not as variable.
So, write like this:
PARAMETERS schachtdurchmesser_attribut = di1_schacht_oval + "/" + di2_schacht_oval


@Bertrand

Your solution would only work, if di1_schacht_oval and di2_schacht_oval holds string-values!

If this are numeric values, then you have to convert to string with STR:

PARAMETERS schachtdurchmesser_attribut = STR(di1_schacht_oval,1,3) + "/" + STR(di2_schacht_oval,1,3)

@Nemo, yes you are right!
It was late and I answered too quickly, sorry.
Sure, in this specific case, "STR" is needed.


Hallo Bertrand, Hallo Nemo
Vielen Dank für eure schnellen Antworten und die Korrektur, funktioniert perfekt :-)

Thank you for the feedback!



https://connect.allplan.com/ verwendet Cookies  -  Mehr Informationen

Akzeptieren