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

enigmatic COOR command

Aussie John
Newcomer
I've wasted a great part of the day trying to get a material (with associated vectorial hatch) to work on an object.

Using the COOR command I can get the hatch to show but not move it (the hatch is always setout from the origin).

I have made a scaled down version of what I am trying to achieve, can anyone see where I have gone wrong?

Thanks
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]
8 REPLIES 8
Anonymous
Not applicable
Hi Aussie,

Your VERT and COOR commands seem correct.
You should place them at the end of the script.
This way you can play with the origin.

Think to add a DEL 3 at the end, to delete transformations,
and for the cursor comes back to the origin.
Anonymous
Not applicable
About COOR, i have to add that this command is still
mysterious and badly documented.

If you have five minuts to waste, try this :

In the v2 library compare the Round Opening (W Round Opening)
and the Octogonal Opening (W Octogonal Opening 70)
Hope you have the same on your version.

Place them in a curved wall with a brick texture,
and choose radial opening, (not parallel).

For Round Opening, at the end of the 3D script, you will
notice a COOR2 command. This is the right and official syntax.
Unfotunately, the texture alignment is wrong.
Replace it by COOR22 and it works.

For Octogonal Opening, at the end of the 3D script, you will
notice a COOR22 command. (undocumented anywhere)
Curiously, the texture alignment is right.
Replace it by COOR2 and the texture alignment is wrong.

Search the error!
I ask GS since years for an explanation, without success.
Only Laszlo (Thanks) answered me that he thinks it is a syntax error.
I don't think so, because the previous example.

May be thanks to this forum, some programers will hilight us,
if it is not classified secret defense.
Aussie John
Newcomer
thanks Oliver- it took a while but i finally got there
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]
Anonymous
Not applicable
Aussie,

This altered script may work better, things to note:

The coor command should be after the geometry but before the second Body statement.
It is easier (for me) to add and rotate before using a standard coor xyz statement rather than trying to figure out the xyz.

Body -1 lets archicad figure out whether the object is curved hollow etc,
lazy but much simpler!


! Altered Script
c=zzyzx
d=zzyzx/2
body -1
unid=1
addy b/2
hotspot 0,0,zzyzx,unid,offset,1+128:unid=unid+1
hotspot 0,offset,zzyzx,unid,offset,2:unid=unid+1
hotspot 0,0,zzyzx,unid,offset,3:unid=unid+1
del 1

roty 90
rotx 90
rotz 90

Cprism_ MT,MT,MT,6,-b,
0,0,15,
0,d,15,
a/2,c,15,
a,d,15,
a,0,15,
0,0,15

DEL 3

ADDY offset

vert 0,0,0
vert 1,0,0
vert 0,1,0
vert 0,0,1
coor 2+256,-1,-2,-3,-4

Del 1

body -1


I hope this helps,
Laszlo Nagy
Community Admin
Community Admin
I checked what Olivier mentioned. What I found is that there are no COOR2 and COOR22 commands in GDL. The line in the Round Window's Script goes like this:

coor 2,-1,-3,-4,-2

COOR is the name of the GDL command and 2 is its first parameter, which is wrap. wrap: wrapping mode + projection type
Since this value is 2, it means that wrapping mode = 2 and projection mode =0
I guess if projection mode is zero, the whole COOR command has no effect. But if you write this:

coor 22,-1,-3,-4,-2

it means that wrapping mode = 2 and projection mode =20

What I can imagine is that if projection mode <> 0 then it will assume you want to use the default projection mode (projection mode = 256) and this is why it works. Another possible thing might be that there is a 20 value for projection mode, which is valid and has a certain effect.

But I think there are no COOR2 or COOR22 GDL commands.
Try it, write this:

coor2 2,-1,-3,-4,-2

or

coor22 2,-1,-3,-4,-2

it won't work. AC will tell you it cannot find the COOR2 or COOR22 macros, which means COOR2 and COOR22 are not reserved keywords but can be the names of macros.
I hope this clarifies things a bit more.

Also, I agree with what Bill wrote. You should always place the COOR statement after the GDL command defining the body you want to apply it to, just as stated in the GDL Manual. It is always safe and recommended to place a BASE command before the VERT (or TEVE) statements and a BODY command after the COOR statement so it will be one independent unit of body definition and will surely not get mixed with other bodies in the same 3D Script.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Anonymous
Not applicable
Hi Laszlo,

Sorry for the typing error, of course it is COOR 2 and COOR 22.
I agree that without space it can not work.
The examples which i refered do have a space. So my apologies.

Your explanation about the wrapping mode = 2 and posible
projection mode = 20 is very interesting.
About the example of the round opening in a curved wall,
following the investigation, i found that "wrap" works
with 3+0 or 3+256, or 2+20, but not with 2+0, or 2+256.

With the adequate value of "wrap", in rendering mode,
texture is correct for the two faces of the wall but never for the middle part.

And, yes, BASE and BODY statements are very important.
Bill explained this better i could do.
Thanks for the highlight.
Oleg
Expert
Interestingly. After experiments, it seems the wrapping modes with 21 to 25 definitely exist.
It is not documented anywhere and only GS can explain their purpose.
Anonymous
Not applicable
Hello Oleg,
To achieve, this, it works for me from 22 to 25, or 22+256 to 25+256.
Best result are with 23 to 25. Texture alignment for the center part of
the wall is not in the way i should want, but at least there is no break,
as it is with 22.