GDL
About building parametric objects with GDL.
SOLVED!

using Data from 2D section for 3D cut

Martin Walter
Enthusiast
I created a user definded window with complex 3D data.
When I create a vertical section through the window then the 3D data is cut. And the result is not what I want for a vertical section view.
Is there a possibility to show data from the 2D section instead?
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
No. Sections use the 3d geometry of the window. Only in floorplan you can create 2d lines.
If you want a correct section representation, you will have to create the correct 3d geometry.

View solution in original post

5 REPLIES 5
Solution
Anonymous
Not applicable
No. Sections use the 3d geometry of the window. Only in floorplan you can create 2d lines.
If you want a correct section representation, you will have to create the correct 3d geometry.
Martin Walter
Enthusiast
But I have a model with a window, where the vertical section seems to be different from the 3D cutted model:
How is this possible?
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
From what did you create the window? from scratch or using an existing object?

The 2D and 3D components of any GDL object are completely separate unless you use the "Project2" command which generates the 2D from a projection of he 3D, though it is not advised as it slows regeneration.

If you want the section to be a more simplified representation of your detailed 3D geometry then you need to rationalise the geometry for that view (sections are a live 3D view). you do this by using the GLOB_VIEW_TYPE function to hide/simplify the pieces of 3D geometry you don't want to see in section.

for example, let say you have 4 pieces of geometry that make up the frame profile in 3D but in section you only want to see the main piece. then your code will look like this:


Geometry 1 (actual GDL script just represented by the term Geometry for this post)

if GLOB_VIEW_TYPE # 4 then
      Geometry 2
      Geometry 3 
      Geometry 4 
endif
GLOB_VIEW_TYPE 4 is for sections (refer to GDL manual for the rest, and don use this function in the parameter script)
# stands for "not equal to"

So in plain English (far less efficient) it reads:

execute Geometry 1

if the view is NOT a section view then
execute Geometry 2
execute Geometry 3
execute Geometry 4

You can also be far more clever with this function and simplify a single complex shape by using the PUT and GET functions to define the shape as this allows you to define the points of the shape prior to the shape command hence adding conditions to the points.

for example a C channel can be made into a simple rectangle as follows:

HEIGHT = 2.100
WIDTH = .050
DEPTH = .100
THICK = .002

put 0, 		0, 15
put WIDTH, 	0, 15
if GLOB_VIEW_TYPE # 4 then
	put WIDTH, THICK, 15
	put THICK, THICK, 15
	put THICK, DEPTH -THICK, 15
	put WIDTH, DEPTH -THICK, 15
endif
put WIDTH, DEPTH, 15
put 0, DEPTH, 15
prism_ nsp/3, HEIGHT,
	get(nsp)
it super easy and as you can see it gives you the ability to make your geometry responsive to all sorts of conditions.
personally i always use the PUT and GET functions for my geometry as it means i don't have to keep changing the value that sets the number of nodes (which gets frustrating) as i can use the "nsp/3" instead. But the main reason is it allows me to make the geometry far more conditional.
Creator of Cadswift's parametric GDL libraries
Creator of Infinite Openings and Component Catalogues
Push the envelope & watch it bend
website: https://cadswift.com.au/
YouTube: https://www.youtube.com/user/CADSwift/playlists
Martin Walter
Enthusiast
Hi, many thanks for your response!
With if GLOB_VIEW_TYPE = 4 then I know, if I am in a section view.
Would it be possible to recognize the direction of the 3D section?
I would like to know if a window is cut perpendicular.
AC23, Windows 10, i7-6700HQ, 8Gb RAM, 500Gb SSD
Barry Kelly
Moderator
Martin wrote:
Hi, many thanks for your response!
With if GLOB_VIEW_TYPE = 4 then I know, if I am in a section view.
Would it be possible to recognize the direction of the 3D section?
I would like to know if a window is cut perpendicular.

Not possible that I am aware of.


Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11