GDL
About building parametric objects with GDL.
SOLVED!

GDL solid geometry commands - groups and geometry offsets

Jim Allen
Advisor

I'm in the process of building a GDL joist hanger and I've come across a problem using groups.

 

I'm using 2 simple prisms to create the basic shape, and using 2 more prisms to cutting out the geometry using the GDL version of SEOs.

 

This is what my geometry currently looks like:

Screenshot 2025-01-28 at 17.15.22.png

 

I've shaded the prisms which represent the subtraction geometry. I've used ADDX, ADDY and ADDZ to move the origin to create the prisms and the positions and dimensions are correct.

 

I'm using a 3d sphere to show the origin for debugging.

 

However when I copy the script and make the prisms in groups and place them (their counterparts are the wire frame geometry), none of the offsets I used to create the original geometry are respected. I can't use ADDn commands to reposition the groups.

 

I can't find anything in the GDL cookbook about this. I'm hoping I have missed something obvious.

 

Is it just a limitation I have to deal with by using absolute coordinates for the base geometry in the group definitions?

 

Archicad 28 UKI | OS X 14.7 Sonoma
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
AllanP
Expert

Hi Jim,

All the transformations inside the group are ignored after the group is made (effectively an automatic del the number of transformations in the group).

 

the group is always set at the origin point and it assumes you will move the local origin before you use the placegroup command (effectively moving the new element to its new location)

in the example i move the elements in the group so it is  0.5,0.5,0.5 from the local origin of the group.

 

you see that the local coordinate shown by coordinate arrow only moves by the transformation outside the group.

i.e.

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup
placegroup ("body of object to be cut")
material 2
add 0.1,0.1,0.1
block 0.1,0.2,0.5

 

AllanP_1-1738100226460.png

 

 

so if your local coordinates for the group don't match then things wont cut.

there is no movement of the local origin of the cutting group so it sits at the global origin.

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    material 5
    block 0.4,0.5,1
endgroup

placegroup ("body of object to be cut")
placegroup ("object to do cutting")

 

AllanP_2-1738100445703.png

 

 

in this example the global origin is still 0,0,0 shown by coordinate arrows, and the cutting object is offset an extra 0.1,0.1,0.1 to do the cut

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.6,0.6,0.6
    material 5
    block 0.4,0.5,1
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

 

 

AllanP_3-1738100676144.png

 

 

you see if the global coordinates move in-between transformations, it doesn't effect local coordinates in the groups(i made the cutting element a bit smaller in the one so you can see the cut element is a little bigger, but in the same position

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup
add 0.1,0.1,0.1
group "object to do cutting"
    add 0.5,0.5,0.5
    material 5
    block 0.4,0.5,0.95
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

AllanP_5-1738101067008.png

 

the answer is you have to put the transformation inside the cutting group,

but you can place the original group inside a new group

and remember the kill group commands at the end.

block 0.1,0.2,0.5
group "body of object to be cut"
    add 0.5,0.5,0.5
     material 4
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.1,0.1,0.1
     material 5
    placegroup "body of object to be cut"
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

killgroup "object to do cutting"
killgroup "body of object to be cut"

 

 

AllanP_6-1738101461406.png

 

i was just showing the cutting element for effect

without placing the cutting element to get:

block 0.1,0.2,0.5
group "body of object to be cut"
    add 0.5,0.5,0.5
     material 4
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.1,0.1,0.1
     material 5
    placegroup "body of object to be cut"
endgroup

placegroup subgroup("body of object to be cut","object to do cutting")

killgroup "object to do cutting"
killgroup "body of object to be cut"

AllanP_7-1738101626094.png

 

I hope this helps

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 28
Member of Architalk since 2003, but missed the migration to Graphisoft.

View solution in original post

4 REPLIES 4
Solution
AllanP
Expert

Hi Jim,

All the transformations inside the group are ignored after the group is made (effectively an automatic del the number of transformations in the group).

 

the group is always set at the origin point and it assumes you will move the local origin before you use the placegroup command (effectively moving the new element to its new location)

in the example i move the elements in the group so it is  0.5,0.5,0.5 from the local origin of the group.

 

you see that the local coordinate shown by coordinate arrow only moves by the transformation outside the group.

i.e.

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup
placegroup ("body of object to be cut")
material 2
add 0.1,0.1,0.1
block 0.1,0.2,0.5

 

AllanP_1-1738100226460.png

 

 

so if your local coordinates for the group don't match then things wont cut.

there is no movement of the local origin of the cutting group so it sits at the global origin.

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    material 5
    block 0.4,0.5,1
endgroup

placegroup ("body of object to be cut")
placegroup ("object to do cutting")

 

AllanP_2-1738100445703.png

 

 

in this example the global origin is still 0,0,0 shown by coordinate arrows, and the cutting object is offset an extra 0.1,0.1,0.1 to do the cut

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.6,0.6,0.6
    material 5
    block 0.4,0.5,1
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

 

 

AllanP_3-1738100676144.png

 

 

you see if the global coordinates move in-between transformations, it doesn't effect local coordinates in the groups(i made the cutting element a bit smaller in the one so you can see the cut element is a little bigger, but in the same position

block 0.1,0.2,0.5
group "body of object to be cut"
    material 3
    add 0.5,0.5,0.5
    block 0.4,0.5,1
endgroup
add 0.1,0.1,0.1
group "object to do cutting"
    add 0.5,0.5,0.5
    material 5
    block 0.4,0.5,0.95
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

AllanP_5-1738101067008.png

 

the answer is you have to put the transformation inside the cutting group,

but you can place the original group inside a new group

and remember the kill group commands at the end.

block 0.1,0.2,0.5
group "body of object to be cut"
    add 0.5,0.5,0.5
     material 4
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.1,0.1,0.1
     material 5
    placegroup "body of object to be cut"
endgroup

placegroup ("object to do cutting")

placegroup subgroup("body of object to be cut","object to do cutting")

killgroup "object to do cutting"
killgroup "body of object to be cut"

 

 

AllanP_6-1738101461406.png

 

i was just showing the cutting element for effect

without placing the cutting element to get:

block 0.1,0.2,0.5
group "body of object to be cut"
    add 0.5,0.5,0.5
     material 4
    block 0.4,0.5,1
endgroup

group "object to do cutting"
    add 0.1,0.1,0.1
     material 5
    placegroup "body of object to be cut"
endgroup

placegroup subgroup("body of object to be cut","object to do cutting")

killgroup "object to do cutting"
killgroup "body of object to be cut"

AllanP_7-1738101626094.png

 

I hope this helps

I have been using ArchiCAD continually since ArchiCAD 4.5, 4.5.5, 5, 5.1, 6, 6.5, 7, 8, 8.1, 9, 10, 11, 12, 13, 15, 18, 21, 22, 25, now testing 28
Member of Architalk since 2003, but missed the migration to Graphisoft.

Perfect  - detailed and clear, thanks!

Archicad 28 UKI | OS X 14.7 Sonoma

All working in 3d - just the 2d to complete!

 

Screenshot 2025-01-29 at 11.56.40.png

Archicad 28 UKI | OS X 14.7 Sonoma

All done and uploaded to BimComponents.

 

Modifications actively encouraged!

 

I haven't added options for skewed hangers, that would take quite a lot of my time and there's only so much swearing my colleagues in the office can tolerate, especially now use of Microsoft Teams is common...

 

What would be cool would be a joist component with hangers at the ends. Or just one.

 

I could do that, in fact I might because I do want to create an object which is an array of elements like the railing tool or joist tool object, but is more flexible and easier to use for joists, posts, battens, panels, rafters etc.

 

But not right now.

Archicad 28 UKI | OS X 14.7 Sonoma