cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
License Delivery maintenance is expected to occur on Saturday, October 19, between 4 and 6 PM CEST. This may cause a short 60-minute outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool may not function properly. We apologize for any inconvenience.
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

project2 & cut fills

Anonymous
Not applicable
Hey all,

I've just started down the path of scripting my own objects, and I'm simply searching for a way to make the regular plan 2D view of the object look as it does in the Section or 3D Doc/Plan view.

I've attached an example file of what I'm trying so far. The upper block would ideally be filled with a user selected cut fill and the lower block would just be outlined.

(Basically the way I would want every object to be displayed by default, cut at the level of the floor plan view)

Thanks!


I can't seem to attach .gsm .....so here is the code:

2D-----------------------------------------------
SECT_ATTRS fill2, pen1,
pen2, pen2

PROJECT2{3} 2,270,2+16+4092,15


3D-----------------------------------------------
IF GLOB_CONTEXT =2 THEN
ADDz 1.5
CUTPLANE
DEL 1
ENDIF

MATERIAL mmat
BLOCK 1,1,1

ADD 1,1,1
BLOCK 1,1,1
DEL 1

IF GLOB_CONTEXT=2 THEN CUTEND

END

Screen Shot 2014-03-03 at 4.06.14 pm.png
8 REPLIES 8
Laszlo Nagy
Community Admin
Community Admin
I think you will have to use the extended version of this command:
PROJECT2{3} projection_code, angle, method, parts [, backgroundColor,
fillOrigoX, fillOrigoY, filldirection][[,]
PARAMETERS name1=value1, ..., namen=valuen]
So to achieve this particular result you need to provide not only the first 4 parameters, but at least the next 4 parameters as well. Those define the cut fill's background color and the origin and direction of its pattern.

These parantheses - [] - mean that those parameters included within them are optional parameters.

For example, this code:
PROJECT2{3} 2,270,2+16+4092,15, 19, 0, 0, 0
I suppose would set the background fill color to Pen 19 (usually white), the Fill's origin will be at 0, 0 in the X-Y plane of the Object, and its direction will be the direction of the X axis.
I did not try it, but let's hope that is what those values mean. The GDL Manual is not too verbose on these parameters and there is no example for their use either.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Anonymous
Not applicable
Thanks Las, but adding those parameters did not seem to change anything.

Does the SECT_ATTRS definition apply to shapes cut with the CUTPLANE?


After a bit more digging I found this:
http://www.masterscript.nl/3d-objects/38-object-slicer.html
(which seems like what I am trying to do)

and this discussion:
http://archicad-talk.graphisoft.com/viewtopic.php?t=25373&sid=e85f9fa3bf041751b42b4403e909a7de

Am I missing something obvious - doesn't everybody want their objects to simply be cut with the floor plan?
(and not waste time writing a duplicate script in 2D that has to be updated with any changes to the 3D shape)
David Maudlin
Rockstar
Richardng wrote:
Am I missing something obvious - doesn't everybody want their objects to simply be cut with the floor plan?
It just depends on the object and the desired plan view, the vast majority of objects I have created do not have a cut plane, mostly a simplified top down view.
Richardng wrote:
(and not waste time writing a duplicate script in 2D that has to be updated with any changes to the 3D shape)
Except for very complicated shapes where an accurate top down view is needed, a 2D Script is better: it runs faster without the overhead of creating a 3D view for each object's representation in plan view. A lot of objects using Project2 will take unnecessary resources for plan generation. Some of the code used for the 3D object can be reused for the 2D Script, with a change in command and editing some of the variables.

You should add a Signature to your Profile (click the Profile button near the top of this page) with your ArchiCAD version and operating system (see mine for an example) for more accurate help in this forum.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14
Pertti Paasky
Expert
"SECT_ATTRS fill2, pen1....", should be in 3d script, not in 2d.
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Anonymous
Not applicable
Ok, that makes sense. After playing around a bit more it seems that objects cut with a CUTPLANE do not count at cut polygons in PROJECT2{3}....?????

Changing the 4th parameter between 3,12 and 15 shows that the shapes are not recognised as being cut.


----------------2D----------------------
PROJECT2{3} 2,270,2+16+4096,15,19,0,0,0


----------------3D----------------------
ADDz 1.5
CUTPLANE
DEL 1

SECT_FILL fill2, pen1, pen2, pen2

MATERIAL mmat

BLOCK 1,1,1

ADD 1,1,1
BLOCK 1,1,1
DEL 1

CUTEND

END
Pertti Paasky
Expert
Here's an example. It takes it's time to go through it.
I try to attach "FloorPlanCutPlane.gsm" but no success...somebody help?
OK, Thank You, Lazlo!
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.
Laszlo Nagy
Community Admin
Community Admin
Create a ZIP file out of it, you will be able to upload that.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Anonymous
Not applicable
Thanks Pertti, that was a really helpful script - it seems to do everything.

For the moment I will stick to something a bit simpler, the key information was that it appears that CUTPLANE{2} has to be used to generate cut polygons - I had no idea.
As soon as I switched CUTPLANE for CUTPLANE{2} 0,0 it all looked good.