We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2020-10-02 02:42 PM - last edited on 2021-09-15 09:44 AM by Noemi Balogh
2020-12-13 11:42 PM
poly2_b 4, 7, fill_pen, fill_background_pen, 0, 0, 1, a, 0, 1, a, b, 1, 0, b, 1smarter:
put 0, 0, 1, a, 0, 1, a, b, 1, 0, b, 1 poly2_b nsp/3, 7, fill_pen, fill_background_pen, get(nsp)smartest:
put 0, 0, 1 put a, 0, 1 put a, b, 1 put 0, b, 1 poly2_b nsp/3, 7, fill_pen, fill_background_pen, get(nsp)The last example makes it a lot easier to add nodes to your shape.
2020-12-14 10:33 AM
A. wrote:Thanks so much! Worked a charm! I had tried using Gosub and putting it inside the Poly command...now seeing your solution I see how that didn't work...
that should work
PARAMETER scriptvalues "ra" range[0, a/2] values "rb" range[0, a/b]2D scriptEPS=0.0001 Gs_resol = 72 st=1 if RA > EPS AND RB > EPS then put RA, 0, ST, !south line A-RA, 0, ST gosub "SE" !south-east corner put A, RB, ST, !east line A, B-RB, ST gosub "NE" !north-east corner put A-RA, B, ST, !north line RA, B, ST gosub "NW" !north-west corner put 0, B-RB, ST, !west line 0, RB, ST gosub "SW" !south-west corner else put 0, 0, ST, A, 0, ST, A, B, ST, 0, B, ST, 0, 0, -1 endif Poly2_B NSP/3, 7,19,19, get(nsp) END !__________________________END____________________ "SE": for n = 270 to 360 step 360/gs_resol put A-RA + RA*cos(n), RB + RB*sin(n), st next n return "NE": for n = 0 to 90 step 360/gs_resol put A-RA + RA*cos(n), B-RB + RB*sin(n), st next n return "NW": for n = 90 to 180 step 360/gs_resol put RA + RA*cos(n), B-RB + RB*sin(n), st next n return "SW": for n = 180 to 270 step 360/gs_resol put RA + RA*cos(n), RB + RB*sin(n), 1 next n returnEdit: you must create parameters RA and RB
2020-12-14 10:36 AM
Kristian wrote:It's starting to make a lot more sense now! I'd seen it in other scripts before but it always seemed very daunting to implement.
I personally use the PUT/GET statements for all my shapes because I hate changing the node quantity value in the "poly2_b" command every time I add a new node. Also most my shapes are parametric so the quantity of nodes changes based on the users application of the object, therefore I can't use anything but the PUT/USE/GET functions.
basic:poly2_b 4, 7, fill_pen, fill_background_pen, 0, 0, 1, a, 0, 1, a, b, 1, 0, b, 1smarter:put 0, 0, 1, a, 0, 1, a, b, 1, 0, b, 1 poly2_b nsp/3, 7, fill_pen, fill_background_pen, get(nsp)smartest:put 0, 0, 1 put a, 0, 1 put a, b, 1 put 0, b, 1 poly2_b nsp/3, 7, fill_pen, fill_background_pen, get(nsp)The last example makes it a lot easier to add nodes to your shape.
One thing to remember (especially when using the USE) function, is that you must remain aware of what is in your NSP. So if you are using the NSP values more then once, in a loop for instance and hence applying the USE function, then make sure the last call of the NSP values is a GET function, otherwise the values remain in the NSP and will populate the next unrelated GET function.
2021-01-05 08:41 AM
Arnaut2604 wrote:No, it isn't possible. You could use SPLINE2 to approximate it, but that's not available as status codes in any command.
Is it possible to get an ellipsoidal curve without using mul?
On example 1 on the Additional Status Codes site is a ellipsodial curve but I can't seem to fathom how it works.
Through deleting lines and seeing what happens I've figured out that is has something to do with status code 2000
https://gdl.graphisoft.com/reference-guide/additional-status-codes