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-13 10:49 AM
Could you share the part of your 3D scripts where you define your materials/surfaces.
GDL uses following directives for these:
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.
2023-12-16 06:40 PM
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
2023-12-16 06:47 PM
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?
2023-12-16 06:50 PM
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!
2023-12-17 11:53 PM
yes - top_material, bottom_material, ... in CPRISM is referring to... surfaces 😅
2023-12-17 11:54 PM
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.).
2023-12-17 11:56 PM
Did you make the geometry in the negative "quadrant" as well?
2023-12-18 10:39 AM
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.
2023-12-18 11:27 AM
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.