We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-12-12 06:57 PM - edited 2023-12-20 04:23 PM
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:
I have a 2D representation which looks like this:
This is the Section view:
It has a lot of configurable options:
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:
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.
2023-12-18 11:28 AM
Yes, I did get confused - what's that all about?
2023-12-18 01:07 PM
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!
2024-01-10 04:47 PM
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
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??