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

Streamline your workflows and master BIM coordination! Program starts April 28!

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

PRINT Command...

Not applicable
Is there a good place to write the PRINT command to make it works with a string?

PRINT "Error, check the value"

do nothing...
The manual writes that it should appear a dialog with my "string"....

Thank you in advance.

Regards

PWD
20 REPLIES 20
David Larrew
Booster
The PRINT command should work from any of your primary scripts (2D, 3D, Master). If you just have the command placed in the "root" of the code (no "if/then" statements) then the dialog will appear as you access the object during placement or editing in AC.
David Larrew, AIA, GDLA, GSRC

Architectural Technology Specialist

a r c h i S O L U T I O N S



WIN7-10/ OSX 10.15.7

AC 5.1-25 USA
Not applicable
I placed the PRINT command in the "root" as you advise me to do, but it does not work...
AC8 recognizes it as an error not as code (that is ok) but at execution time...It give me the message: "Danger, you encountered problem during the last operation".
After that all is ok.

It's strange.

Thank you
PWD
You should not use the Print command except for debugging your script. Its annoying for the user, and will not work if they have that option unticked in their preferences.
if the user enters bad parameters, you can use the 2D symbol to flash up "Bad parameter!"
Best method of all is to use the Master script to correct the error to the nearest valid value, eg all values less than one can be equal to one, and then use the PARAMETERS command to push the correct value to the visible parameters table.
e.g.
IF len<=1.0 THEN len=1.0
PARAMETERS len=len

PWD wrote:
I placed the PRINT command in the "root" as you advise me to do, but it does not work...
AC8 recognizes it as an error not as code (that is ok) but at execution time...It give me the message: "Danger, you encountered problem during the last operation".
After that all is ok.

It's strange.

Thank you
PWD
Not applicable
You should not use the Print command except for debugging your script
OK David,

but PRINT does not work in debugging mode, too.
I can't use it neither for my uses...
I agree that It's annoying for the user...

Thank you
PWD
Djordje
Moderator Emeritus
PWD wrote:
You should not use the Print command except for debugging your script
OK David,

but PRINT does not work in debugging mode, too.
I can't use it neither for my uses...
I agree that It's annoying for the user...
If you posted the offending part of the script here, it would be easier to help?
Djordje



ArchiCAD since 4.55 ... 1995
HP Omen
PWD wrote:
You should not use the Print command except for debugging your script
but PRINT does not work in debugging mode, too.
I can't use it neither for my uses...
I agree that It's annoying for the user...
I normally make it a policy not to reply to people who use anonymous handles, but will do because you are from Parma, and your football team and town are in trouble, and you need help from anyone who can provide it.
PRINT is Extremely useful for debugging, eg, if a script persistently refuses to work, you can PRINT the parameters that you are getting from your calculation only to discover that the angles were allways coming out as infinity or zero or whatever. then you repair the calculation.
If its not working for you either, when debugging, then you have to check your Options>preferences>Imaging settings to check the box to allow you to see error messages. It illustrates what i meant when i said Print is weak for informing the user.
I havent used PRINT for notifying the user since about the 2nd week after learning GDL, realising how unreliable it could be. Master Script, master Script, master Script...... thats where you can solve errors.

(retires now, with flak helmet, to await reprimand from Djordje.)
Not applicable
but will do because you are from Parma, and your football team and town are in trouble, and you need help from anyone who can provide it.
Not only my football team, but PARMALAT also...
I use this handle now cause I used this since 7years an so this is my name for all... for my friend also.
In any case you know my real name...: I'm from Parma and I received your cookbook about 1month ago, I paid using a bank tranfer Do you remember?

Bye...
PWD
Thats what I meant - I assumed that Parmalat is the largest local employer. As your initials are MF, and your company initials are PCS, and your avatar is a Japanese kamikaze, how could you tell me that I should know who you are? is there only one ArchiCAD user in Parma? thats worrying!
I have forgotten your original question.... oh yes, about printing.
PWD wrote:
but will do because you are from Parma, and your football team and town are in trouble, and you need help from anyone who can provide it.
Not only my football team, but PARMALAT also...
I use this handle now cause I used this since 7years an so this is my name for all... for my friend also.
In any case you know my real name...: I'm from Parma and I received your cookbook about 1month ago, I paid using a bank tranfer Do you remember?
Not applicable
From now I will include my signature... so DAVID you will be sure about my name... only for you.

My original question...about printing a message or a variable using PRINT.

Now I' trying to put it into the MASTER_GDL.

Bye

Marco