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

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

PARAGRAPH Problems

Anonymous
Not applicable
I am having difficulties with the PARAGRAPH command, specifically with the name definition. In the Cadimage Tools GDL Handbook it states that the name "can be either a variable value or a constant enclosed in quotation marks."

I am trying to create a series of Paragraphs and TextBlocks on the fly, but am hung up on the naming. The following code is what I am attempting. This was I can generate a unique name for each PARAGRAPH but I keep getting an error in expression. This also happens if I remove the leading quotes (which I thought were required to make variable work with the PARAGRAPH command). Any ideas?
FOR loop1= 1 to unknownNumber1
     FOR loop2=1 to unknownNumber2
          stringValue1=STR(loop1, 1, 0)
          stringValue2=STR(loop2, 1, 0)
          PARAGRAPH ""+stringValue1+"_"+stringValue2 ...
     NEXT loop2
NEXT loop1
4 REPLIES 4
Anonymous
Not applicable
A couple of things off the top...

First: Use either the variable itself (without quotes) or a constant value which in the case of strings is text within quotes. This is typical for all GDL scripting (though there are a couple of confusing conditions like the VALUES statement which expects the variable name as a string constant in quotes).

Second: The PARAGRAPH function is a tricky bu**er. Have you had it working before? I can't tell from your code if you have done the other contextual stuff you need for to make it work.
Anonymous
Not applicable
Matthew,

For simplicity sake, I left off the other parts of the PARAGRAPH command, as well as the TEXTBLOCK and RICHTEXT2 stuff.

I have successfully used PARAGRAPH before with a static name, I just can't get it to work with a variable name. I was throwing in the blank quotes because PARAGRAPH requires it for the text input if you use variable. I thought it might need it for the name too, but it seems to balk at everything I try. I have also tried to concat the stingValues before using it as the PARAGRAPH name, but that didn't work either.
Anonymous
Not applicable
Have you defined the variables in master script? I just had a similar problem where I tried to request a parameter value from an object for a label and use this value in a paragraph. It did not work when I did the request and variable definition in the 2d script, but when I placed the request and variable definition in master script, the paragraph started working like magic...

--EDIT

I spoke too soon, in my overwhelming enthusiasm. This does not work. Crap. If anyone knows how to get a string variable actually working inside a paragraph, please share your wisdom.

--EDIT2

It seems that in my case the paragraph variable did not work because the variable I used was not initialized as a string. I got it to working now.
You might try initializing your stringValue1 and stringValue2 (before the paragraph part) as follows:

stringValue1=""
stringValue2=""
(Sorry about the extensive editing )
Anonymous
Not applicable
Thanks for your help. I ended up concating the 2 strings to one variable before assinging it as the PARAGRAPH name, and this seemed to make it work.