Design forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Desctivating a cutplane from 2D script

Nader Belal
Advisor
Hi there,

I´m creating a complex object that is being controlled by a myriad of parameters and conditions ... to which I have used cutplane and project2{4} to generate it's cut view in plan.

So I tried to generate an elevation view on plane of the object using project2 (along side the plan cut), and as expected , the elevation view on plan was presented with a cut.

Can anyone of you tell me how to bypass this bummer ?
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.
1 ACCEPTED SOLUTION

Solution
Nader Belal
Advisor
@Lingwisyer & @Barry Kelly

I think I have just found the solution , that can by pass my problem, but it's not optimised although it will work perfectly.

This solution needs a little bit of imagination.

Solution:
  • First, create 2 groups, one for the object in it upright position "object_untrimmed", and the other for the cutting plane & the previous defined group "object_trimmed"; all at the top of the "3D Script".
  • Second, always place the group "object_trimmed", that way you will always get the correct cut plan representation in plans.
  • Third, create a parameter for activating elevation on plan.
  • Fourth, in the "3D Script" create an "if" condition that will place the "object_untrimmed" rotated around one of the X or Y or Z axis.
    That way you will always use the same "PROJECT2" (or one of its variants) for the same purpose view type.
  • Fifth, in case you need to modify the Elevation on plan in the 2D view, you will have to remember that you will have to control it in the "3D Script".
  • Sixth, don't forget to kill the groups.
Please if you have a better idea than this one, I will gladly hear/read it.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

View solution in original post

18 REPLIES 18

Lingwisyer
Virtuoso
If GLOB_VIEW_TYPE = 2 THEN				!Plan view
	CUTPLANE 0, cutplane_height
endIf

Though, why are you using a cutplane? Project2{4} already creates cutplanes. If it is due to the object being a windows / doors instead of a "wall with openings" include:

If GLOB_VIEW_TYPE = 2 THEN				!Plan view
	Rotx 90
endIf

The cutplane in Project2{4} only works in the z-axis, so for doors and windows which are modelled in the x/y-axis, you need to rotate the object for the cutplanes to work. Rather annoying as you can choose a view type which is made redundant in this version due to the above fact....

generate an elevation view on plane of the object using project2 (along side the plan cut)

If you are talking about creating multiple views of your object in the floor plan, this should also fix that as then the cutplane is contained withing the projection rather than externally to it.



Ling.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
I think I didn't make myself clear

I have already created the plan view using a cut (because I couldn't find the right combination of parameters values using project2{4} and with it, it will fit just nice).

I have already used the GLOB_VIEW_TYPE, but what I need/wish is to be able to deactivate the cutplane in the 2D script (or another trick that would have the same result) so that I the elevation representation on Plan, alongside with the cut plan view.

Anyway, the a trial that wasn't good enough, is to pass the 2D & 3D script that generate those view to the Master Script, but it didn't work as was planned, as the cutend messes things up in the plan view
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Barry Kelly
Moderator
If you want the cut plane active only in the plan view then
If GLOB_VIEW_TYPE = 2 THEN				!Plan view
	CUTPLANE 0, cutplane_height
endIf

... 3D model script ...

If GLOB_VIEW_TYPE = 2 THEN				!Plan view
	CUTEND
endIf

So this way both the cutplane and cutend will only activate in plan view.

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Lingwisyer
Virtuoso
PROJECT2{4} 3, -90,						!projection_code, angle,
	0, 1+2,							!useTransparency, statusParts,		
	1,							!numCutplanes,
	gs_fw_lower + gs_int_fw + 2*gs_louvre_width,		!cutplaneHeight1, ..., cutplaneHeightn,

	3+32, 1+2+4+8+64,					!method1, parts1,
	gs_fill_type,						!cutFillIndex1,
	gs_fill_pen, gs_back_pen,				!cutFillFgPen1, cutFillBgPen1,
	0, 0, 0,						!cutFillOrigoX1, cutFillOrigoY1, cutFillDirection1,
	gs_cut_pen,	1,					!cutLinePen1, cutLineType1,
	65,							!projectedFillIndex1,
	19, 19,							!projectedFillFgPen1, projectedFillBgPen1,
	0, 0, 0,						!projectedFillOrigoX1, projectedFillOrigoY1, projectedFillDirection1,
	gs_pen_2D, 1,						!projectedLinePen1, projectedLineType1

	4+64, 1+2,						!method1, parts1,
	gs_fill_type,						!cutFillIndex1,
	gs_fill_pen, gs_back_pen,				!cutFillFgPen1, cutFillBgPen1,
	0, 0, 0,						!cutFillOrigoX1, cutFillOrigoY1, cutFillDirection1,
	gs_cut_pen,	4,					!cutLinePen1, cutLineType1,
	65,							!projectedFillIndex1,
	19, 19,							!projectedFillFgPen1, projectedFillBgPen1,
	0, 0, 0,						!projectedFillOrigoX1, projectedFillOrigoY1, projectedFillDirection1,
	gs_pen_2D, 4						!projectedLinePen1, projectedLineType1

add2 0, 0.05
PROJECT2 4, -90, 3
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
Using a cutplane in 3D script and the following code


project2{4}	3,	270,	0,	0,	1,		__h,

			3,	1+2+8,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,

			3,	1+2+4+8,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1

And I get this result:
But without the cutplane and with the modifications of @Lingswisyer, I get the following result

project2{4}	3, 270,	0, 0,	1,		__h,
			3+64,	1+2+8+64,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,

			3+64,	1+2+4+8,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1,
			1,	1,	1,	0.0,	0.0,	0.0,	1,	1

So I need the a way to get the first result, without recurring to a cutplane.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Nader Belal
Advisor
Another thing that I tried to do is to create a condition in the 3D script that in some way should have forced to excute the 2D script twice.

Once for the cut plan view with cutplane, and the second with the elevation on plan without the cutplane.

And I have failed .
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Lingwisyer
Virtuoso
Did you include this at the start of your 3D script?

If GLOB_VIEW_TYPE = 2 THEN				!Plan view
	Rotx 90
endIf



Ling.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
@Lingwisyer
rotating around the X-axis is not the solution, and yes I have already tried it out.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Lingwisyer
Virtuoso
What is the object type?
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
wall accesory
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Nader Belal
Advisor
Hi everyone,

My last trial was base on this idea:

Since GDL does still many legacy parts that haven't been deactivated, I though that if I passed my code from 3D & 2D script to master script, then I may be able to activate and deactivate the cut planes at will (without forgetting the corresponding modifications)

Results:
Although it worked fine in 3D, the object's GUI didn't work as before the modifications were enacted.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Nader Belal
Advisor
@Lingwisyer & @Barry Kelly

I have opened this thread in GDL Center (http://gdl.graphisoft.com/forums/topic/desctivating-a-cutplane-from-2d-script-or-similar-method)
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Solution
Nader Belal
Advisor
@Lingwisyer & @Barry Kelly

I think I have just found the solution , that can by pass my problem, but it's not optimised although it will work perfectly.

This solution needs a little bit of imagination.

Solution:
  • First, create 2 groups, one for the object in it upright position "object_untrimmed", and the other for the cutting plane & the previous defined group "object_trimmed"; all at the top of the "3D Script".
  • Second, always place the group "object_trimmed", that way you will always get the correct cut plan representation in plans.
  • Third, create a parameter for activating elevation on plan.
  • Fourth, in the "3D Script" create an "if" condition that will place the "object_untrimmed" rotated around one of the X or Y or Z axis.
    That way you will always use the same "PROJECT2" (or one of its variants) for the same purpose view type.
  • Fifth, in case you need to modify the Elevation on plan in the 2D view, you will have to remember that you will have to control it in the "3D Script".
  • Sixth, don't forget to kill the groups.
Please if you have a better idea than this one, I will gladly hear/read it.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

View solution in original post

Nader Belal
Advisor
Update

A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Lingwisyer
Virtuoso
Still wonder why Project2{4} was not working for you... Would have been so much easier, but why mine was not working is different to why yours was not so we are still lost on that...



Ling.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
@Lingwisyer

Correction, it worked for you and for me, the difference was in the needs that required different answers.

Your script for "Project2{4}" made clear that the cut part of your object may be costumed specified by the user as s/he pleases, which was not my case.

In my script I needed to maintain the building material indices, fills colours and pens unaltered by the 2D script, and when you couple that with the methods and parts specification that I have used with the different types of holes and voids that can specified by the user, your options would simply don't work in my case.

Unless there is a condition that is altering the results in my object that we aren't aware of.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Lingwisyer
Virtuoso
Right, the pens are the main disadvantage of Project2. Really do not get why it has to overwrite all of the pen weights...



Ling.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Nader Belal
Advisor
followup

http://gdl.graphisoft.com/forums/topic/desctivating-a-cutplane-from-2d-script-or-similar-method#post...
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Didn't find the answer? Start a new discussion

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!