I haven’t studied scripting at all. I know I should, but all my time goes to modeling stuff manually in Rhino + some Grasshopper. I have made small macros now and then and been happy with that.
Now I have a problem with this macro (both in Windows and OS X):
_-Sketch pause enter sellast _-Rebuild pause points=4 degree=3 enter
I can’t get it to set the point count correctly - only the degree (like to have single span curves, obviously). The point count always seems to be whatever I used previously in “Rebuild.”
Ah yes, pointcount of course! Why didn’t I try that… I actually took the whole Rebuild-part from the helpfile (with ‘points’ and ‘pause’). This is the macro from help: ! -_Rebuild _Pause _Points=10 _Degree=3 _Enter
"Points" is obviously wrong then.
I wondered why I would need ‘pause’ and tried yesterday without - but it didn’t work for some reason. I might have had something else in that macro that made it fail, perhaps a missing space or something… I don’t know. I was experimenting a lot.
Anyway, now it works! Thank you Mitch!
I can’t get it to work in Win Rhino either… Try this: open a fresh instance of Win Rhino (V5 here), draw a line, rebuild the line to, for instance, degree 5, 10 points. Then run the macro and draw an s-like shape. If I check the it afterwards it’s degree 3 (like the macro says) - but with 10 points (not 4). If I run the macro once more I get the right result (degree 3, 4 points).
Are you getting the expected result in this little test?
OK, I got it now - I didn’t try starting out with a setting of degree 5 in Rebuild…
So, the explanation is pretty simple - given the order of the options in the macro, it first tries to set the number of points to 4. But only 4 points with a degree 5 curve is not allowed (you need at least 6), so it doesn’t set them. Then it does manage to set the degree to 3 afterward, so you get a 10 point degree 3 curve. The second time you run it 4 is accepted for the number of points, because you are now at degree 3 in Rebuild. Voila…
The solution? Simple - invert the points and degree setting in the macro so it sets the degree first…
This works as i should in Win Rhino - but not in Mac Rhino - so this is probably for @dan
The left click macro works on both platforms, but the right click macro doesn’t work in Mac Rhino (both work in the windows version). I get the same point count error I explained earlier.
Making new buttons is also quite buggy on the OS X version, but that’s another story… Even if I finally got the right macro also on the right click(I had to try many times) it still doesn’t work.
How I debug this stuff under Windows is I run the command and then hit F2, then look at the command prompts and see the responses. Usually you see right away where an option was not accepted and why… Keep changing, running and F2’ing until you get it right.
I think you can do this in Mac Rhino as well, but maybe better to have the command history window undocked so you can really see the whole line…