The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Everything about GDL - Doors/Windows/Objects/Stairs etc. (Example: I created an object that prints an error message in 3D all the time, please help!)

Moderators: Barry Kelly, Karl Ottenstein, LaszloNagy, ejrolon, gkmethy, Gergely Feher

By JGoode
#270418
I can't seem to work out why the calculations don't seem to be working as I think I might have used the same sort of calculation previously. Is there any reason why it is not changing the object at all?
Attachments
Poly2_b help.jpg
#270427
Use put and get for polygons instead writing inline.
no of nodes will be depending on the command type NSP/3..4..5
(how many status type data after coords)
and the all points at the end of the _poly like command will be "get(nsp)"

Best Regards,
Piotr
#270451
Using PUT and GET for polygon nodes is great when the number of nodes is variable.
In a case like this where the number of nodes is fixed it really won't make any difference.

Are you saying that when you adjust the value of the 'rail_width' parameter that your object is not changing?
If so do a find and select for 'rail_width' in the master parameter and the first part of this 2D script to see if the value for that parameter is being set - overriding the parameter value.

Or possibly you are using a value for 'rail_width' that just doesn't make sense for the points you are plotting - i.e. value is too small?

Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.

Barry.
By JGoode
#270475
Barry Kelly wrote:Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.
The calculation that defines the points in the object as in [/code]rail_width/2-(rail_width/2-0.49*********)[/code]
All bits of the definition that included this didn't work so I was wondering if there was a reason why they wouldn't work. I have it working now anyway using a different method.
#270506
Bruce wrote:Have you checked to make sure you haven't accidentally created a 2D symbol, as from memory this will stop the 2D script from running?


If there is a 2D script this should override anything drawn in the 2D symbol window.
Unless it is called as a FRAGMENT.

Barry.
#270507
JGoode wrote:
Barry Kelly wrote:Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.
The calculation that defines the points in the object as in [/code]rail_width/2-(rail_width/2-0.49*********)[/code]
All bits of the definition that included this didn't work so I was wondering if there was a reason why they wouldn't work. I have it working now anyway using a different method.


I don't see anything wrong with your script.
So long as you are adjusting the parameter for 'rail_width' your object should adjust.
But as I said be sure this parameter is not being set to a fixed value before the polygon or in the master or parameter script.

It is very hard to tell what is happening without seeing the entire object scripts.

Barry.
By allanp
#270552
Hi,

it appears like you are trying to draw flanges, connections to the wall?

assuming that 0.49266 is a big number, or spacing between....that may be where you are going wrong....as you are canceling out your Rail_width/2 by adding it then minusing it at that point you are using that big number...

this looks like code from a projection with the facets of a curve turned into code...when it should be just the true size...

choosing a simple Poly2_B script(not fill distortions)
4 points, plus closing point (5 in total)(-1 to close a poly at end)


Flange_Depth = 0.012
Flange_Diameter = 0.04225

for the origin it would be
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
-Flange_Diameter/2, 0, 1,
-Flange_Diameter/2, Flange_Depth, 1,
Flange_Diameter/2, Flange_Depth, 1,
Flange_Diameter/2, 0, 1,
-Flange_Diameter/2, 0, -1



for the middle connection it would be...
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
Rail_width/2-Flange_Diameter/2, 0, 1,
Rail_width/2-Flange_Diameter/2, Flange_Depth, 1,
Rail_width/2+Flange_Diameter/2, Flange_Depth, 1,
Rail_width/2+Flange_Diameter/2, 0, 1,
Rail_width/2-Flange_Diameter/2, 0, -1

for the far end it would be...
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
Rail_width-Flange_Diameter/2, 0, 1,
Rail_width-Flange_Diameter/2, Flange_Depth, 1,
Rail_width+Flange_Diameter/2, Flange_Depth, 1,
Rail_width+Flange_Diameter/2, 0, 1,
Rail_width-Flange_Diameter/2, 0, -1


39 points is a lot for a simple shape....especially when the y-value does not change (only 2 values)