cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

GDL objects - Materials vs surfaces

Jim Allen
Expert

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

Yes, I did get confused - what's that all about?

Archicad 27 UKI | OS X 12.7.1 Monterey

I added some new script to request the surface from the material definition, and I assigned that to the cprism parameters, and the 3d materials issue is also fixed now - so thanks!

Archicad 27 UKI | OS X 12.7.1 Monterey

Still struggling with the hotspots.

 

I want the object origin at 0,0,0, but to stretch it in the z direction. 


The script below works fine (when I stretch vertically, the base point doesn't move) but the vertical stretch hotspot is the component height above the origin, so it's not usable.

hotspot 0, 0, 0, hsID3=hsID3+1, ZZYZX, 4+128 !base
hotspot 0, 0, ZZYZX, hsID3=hsID3+1, ZZYZX, 2 !moving - stretch hotspot for depth
hotspot 0, 0, -1, hsID3=hsID3+1, ZZYZX, 3 !reference
The script below inverts the ZZYZX axis so the hotspot is at -ZZYZX like this:
Screenshot 2024-01-10 at 15.40.09.png

This is the script:

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

I can stretch the object in the z axis, but when I do, it moves in the z axis based on the direction of stretching.

 

How do I 'lock' the z position when dragging the hotspot??

 

 

 



 
Archicad 27 UKI | OS X 12.7.1 Monterey