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.

GDL objects - Materials vs surfaces

Jim Allen
Advisor

I'm a GDL novice but I'm building a parametric 2D/3D manhole object and I have some queries that I know many of you will be able to answer quickly 😉

 

I have a 3d representation which looks like this:

 

Screenshot 2023-12-12 at 17.04.15.png

 

I have a 2D representation which looks like this:

 

Screenshot 2023-12-12 at 17.03.34.png

This is the Section view: 

Screenshot 2023-12-12 at 16.56.38.png

It has a lot of configurable options:

Screenshot 2023-12-08 at 14.03.27.png

 

Screenshot 2023-12-12 at 17.40.46.png

You can input the cover level in metres and based on the depth, it will calculate the invert level. The dimensions should be based on the configuration. Deeper manholes with more connections are larger.

 

There's still quite a bit to do, but the object is almost usable as is. It is intended that people take it and modify it to suit their requirements. Most of us draw manholes from time to time, it would be cool to drop these in, configure them in 3D and connect them with either custom components that label the gradient or the MEP pipe tool  (once it's working properly...) and create a manhole schedule linked to a standard drawing.

 

The things I need some help with are:

 

1. Why are the building material hatches as defined in the file not showing in section? The surfaces are applied properly from the materials in the 3D view

2. I can't get the text labels to be permanently horizontal if both the view and symbol are rotated. I've tried so many different things that I suspect I'm getting 'snow blind' with this.
This is the subroutine for the text: 

 

 

 

"2dtext":
! textHeight_2d=textHeight_2d*1000
rr = request ("View_Rotangle", "", ang_view_rotation)
rs = request("Height_of_style", "fontType", text_height)
! text_height = text_height * PAPER_TO_MODEL  ! only used for 'add2'
! rot2  -ang_view_rotation ! rotate text to horizontal when view is rotated
! Actual rotation of the 2D symbol:	
_totalRotate = (SYMB_ROTANGLE + ang_view_rotation) MOD 360

rot2 -ang_view_rotation ! doesn't work with rotated symbol and rotated view
!rot2 _totalRotate ! God knows what this is doing...
pen TextPen
define style "LabeltextNormal"    fontType,   textHeight_2d*10,  7, 	0
define style "LabeltextBold"    fontType,   textHeight_2d*10,  7, 	1
define style "LabeltextItalic"    fontType,   textHeight_2d*10,  7, 	2
define style "BodytextNormal"     fontType,   textHeight_2d*10,  7, 	0
define style "BodytextBold"     fontType,   textHeight_2d*10,  7, 	1
define style "BodytextItalic"     fontType,   textHeight_2d*10,  7, 	2

if fontstyle1="normal" then style "LabeltextNormal"
if fontstyle1="bold" then style "LabeltextBold"
if fontstyle1="italic" then style "LabeltextItalic"
Text2 A/2,0, MHnum
Add2 0,-textHeight_2d*1.5
if fontstyle2="normal" then style "BodytextNormal"
if fontstyle2="bold" then style "BodytextBold"
if fontstyle2="italic" then style "BodytextItalic"
Text2 A/2,0, MHTypeRef
Add2 0,-textHeight_2d*1.5
Text2 A/2,0, CL_label
Add2 0,-textHeight_2d*1.5
Text2 A/2,0, IL_label
del top
RETURN

 

 

 

It doesn't work for me, it's possible I've done something stupid, I'm sure some of you GDL experts can fix this really quickly!

 

3. Hotspots. I really, really struggle with these, they aren't working.

 

This is my to do list:

 

  1. Change text to stay horizontal with rotated view and rotated symbol {Edit: DONE]
  2. Add hotspots to text to make text movable {Edit: DONE]
  3. Update manhole size definition {Edit: DONE]
  4. Change text so it scales with model {Edit: DONE]
  5. Update hotspots to corners of manhole geometry {Edit: DONE]
  6. fix 3d material display {Edit: DONE]
  7. fix 2d section material hatch display {Edit: DONE]
  8. Create custom UI {Edit: ALMOST DONE]
  9.  Add option to automatically create cover level based on reference levels {Edit: DONE]
  10. Add option to define number of branches and draw connector lines 
  11. Fix 3D cover location to align with centre of narrow dimension of manhole. {Edit: DONE]

I'm quite happy for this to be a public community project if others want to take it and improve it. 

The file link is here: https://www.icloud.com/iclouddrive/0f4rkH_jttEICgU59WmSEPiDQ#GDL_Manhole

 

I've learned a lot building this but it's taking a long time. It's going to be a long term project for me I think simply because I'm learning as I go. Quite frankly I'm surprised I've done this much!

 

I think ultimately it will be a really useful object to have. Adding snappable points for drawing connecting pipework would be pretty cool.

 

In the meantime, I'll keep working on it.

 

 

Archicad 27 UKI | OS X 12.7.1 Monterey
12 REPLIES 12
Ruben V
Advocate

Could you share the part of your 3D scripts where you define your materials/surfaces.

 

GDL uses following directives for these:

  • [SET] BUILDING MATERIAL
    All the shapes generated afterwards will represent the surface, cut fill type (in Section/Elevation), foreground and background pens of the set building material.
  • [SET] MATERIAL
    All the surfaces generated afterwards will represent that material until the next MATERIAL statement.

 

For connecting to MEP-elements, I would suggest looking into Create Custom MEP Part, and especially using the "MEP Connection Object". Remember: you can copy/paste code between GDL-scripts, or even drag objects into the script-window (up until AC26)... In Archicad 27, you can generate 2D/3D based on a (floor plan) selection.

 

Hope this helps/clarifies.

 

(òÓ,)_\,,/
www.studiov2.be
Archicad 26/27 + Rhino/Grasshopper
BIMcollab ZOOM
>>> Read my book!<<<

I was using this: 

cprism_ buildingMat_base, buildingMat_base, buildingMat_base,
 	4, baseThk,
 	Corner1_X, 	Corner1_Y,  15,
 	Corner2_X, 	Corner2_Y, 	15,
 	Corner3_X,	Corner3_Y, 	15,
 	Corner4_X,	Corner4_Y,	15

But the materials didn't work in section.

I have added the following line before the cprism definition, and it works fine now - thanks a lot!

SET building_material buildingMat_base, fill_pen1,fill_pen2, 0
Archicad 27 UKI | OS X 12.7.1 Monterey
Jim Allen
Advisor

Most things are working properly.

 

The text is fixed and 2d hotspots all work fine.

 

Next issue is 3D hotspots. I'm using this script:

hotspot 0, 0, -frameDpth+groundOffset, hsID3=hsID3+1   !corner 1
hotspot mhLength, 0, -frameDpth+groundOffset, hsID3=hsID3+1 !corner 2
hotspot mhLength, mhWidth, -frameDpth+groundOffset, hsID3=hsID3+1 !corner 3
hotspot 0, mhWidth, -frameDpth+groundOffset, hsID3=hsID3+1 !corner 4


hotspot 0, 0, 0, hsID3=hsID3+1, ZZYZX, 1+128 !base hotspot
hotspot 0, 0, 0.1, hsID3=hsID3+1, ZZYZX, 3  !reference
hotspot 0, 0, -ZZYZX, hsID3=hsID3+1, ZZYZX, 2 !stretch hotspot for depth

The first 4 hotspots are simply 'dumb' hotspots that allow the object to be selected more easily in 3D - they seem to be fine.

The last 3 are for stretching the object in the z axis. This works, but when I stretch the object, it moves in the z axis at the same time.

 

What am I doing wrong? 

 

Archicad 27 UKI | OS X 12.7.1 Monterey

I'm going to make a new 3d pipe object I think, which labels the diameter and gradient.

I can use that to connect manhole objects together.

I don't want to get too complicated with MEP parts when I'm still taking beginner steps with 'standard' objects!

Archicad 27 UKI | OS X 12.7.1 Monterey

yes - top_material, bottom_material, ... in CPRISM is referring to... surfaces 😅

(òÓ,)_\,,/
www.studiov2.be
Archicad 26/27 + Rhino/Grasshopper
BIMcollab ZOOM
>>> Read my book!<<<

making a connection with existing pipes should be easy - just add the object I mentioned earlier at the position you want to connect (and set system etc.).

(òÓ,)_\,,/
www.studiov2.be
Archicad 26/27 + Rhino/Grasshopper
BIMcollab ZOOM
>>> Read my book!<<<

Did you make the geometry in the negative "quadrant" as well?

(òÓ,)_\,,/
www.studiov2.be
Archicad 26/27 + Rhino/Grasshopper
BIMcollab ZOOM
>>> Read my book!<<<

There are 2 problems with that:

1. The pipe object doesn't have automatic labels with the size or gradient. Showing the gradient on a drain is really useful.

2. I added just 4 MEP pipe objects and it caused my model to hang every time. I'm not using any of that stuff until the next AC27 build at least.

Archicad 27 UKI | OS X 12.7.1 Monterey

I think so, because when I use the vertical stretch in 3d - it's fine.

 

These are the 3d hotspots to make the object stretchy in 3D:

 

hotspot 0, 0, 0, hsID3=hsID3+1, ZZYZX, 1+128 !base hotspot
hotspot 0, 0, 0.1, hsID3=hsID3+1, ZZYZX, 3  !reference
hotspot 0, 0, -ZZYZX, hsID3=hsID3+1, ZZYZX, 2 !stretch hotspot for depth

 

For the reference hotspot I've used a positive z axis coordinate, and for the stretch hotspot I've used -ZZYZX which I think ought to work fine.

It does in 3D, but in 2D it moves the whole object in the direction of stretch.

 

Archicad 27 UKI | OS X 12.7.1 Monterey