The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Topics specific to the scripting and development of Library Parts and Libraries using Param-O or the Geometric Description Language – GDL. (Example: How do you use “REQUEST” GDL commands?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, Gordana Radonic, nbalogh, mnguyen, gkmethy, rmasaki, Akos Somorjai, Csilla Mai, Peter Baksa

User avatar
By Lingwisyer
#321115
These are two lines within my 3D script dictated by a boolean:
Code: Select all
louvre_seal_width = ( 2 * d - 2 * dp * (n - 1) - 2 * gs_louvre_thk * cos (gs_louvre_opening_angle) ) / ( 2 * sin (gs_louvre_opening_angle) )
Code: Select all
louvre_seal_width = ( d - dp * (n - 1) + 3 * Louvre_over * sin (gs_louvre_opening_angle) - 2 * gs_louvre_thk * cos (gs_louvre_opening_angle) ) / ( 2 * sin (gs_louvre_opening_angle) )

Any idea why including the first line bricks my 2D projection while the second line does not? They both use the same variables in similar ways...



Ling.
User avatar
By Kristian Bursell
#321117
Use a process of elimination to determine the piece of code that is causing the issue.

Its difficult to spot the issue without deeper exploration; what are "d", "n", "dp", and "Louvre_over". Typically "n" is used for loops, so is this in a loop?

Send though more of the code and an explanation of the values and it should be easier to work out.
User avatar
By Lingwisyer
#321120
Kristian Bursell wrote:Typically "n" is used for loops, so is this in a loop?

Woops. Completely overlooked that fact. Probably the cause of some of my other minor issues...

The issue is the 1 / sinθ and it turns out the issue isn't equation specific as if I swap them around, the one that fulfils that boolean still causes it to brick. If I set it to a static value not equal to 0, it works fine...



Ling.
By A. Smith
#321153
Lingwisyer wrote: Thu Jan 14, 2021 8:44 am
The issue is the 1 / sinθ and...
If I set it to a static value not equal to 0, it works fine...

Maybe occurs the situation when sin (x) = 0 and you can't divide by 0 (zero) => 1/0 => error ?
User avatar
By Lingwisyer
#321208
A. Smith wrote: Fri Jan 15, 2021 9:57 am
Lingwisyer wrote: Thu Jan 14, 2021 8:44 am
The issue is the 1 / sinθ and...
If I set it to a static value not equal to 0, it works fine...

Maybe occurs the situation when sin (x) = 0 and you can't divide by 0 (zero) => 1/0 => error ?

That was a thought, but there is the fact that both equations have include that situation and it only has an issue with one of them... Then there is the fact that it equalling zero is impossible within my object since my script sets it to as close to 1 as possible without causing a geometry clash.



Ling.
User avatar
By Lingwisyer
#321405
Fixed by solving indirectly. Used the same inputs to solve for a new horizontal value to allow the use of Pythagoras...

Side A cos θ to side A tan θ, Pythagoras



Ling.