Forgot password?

Create an account!

Forum

« back

RhinoScript – Splitting a Curve into specific lengths

Messages

Please log in to write a message.

  • 5. thinslicedvolta (May 26, 2014 18.51):

    !_setobjectname
    pause
    pause
    enter
    enter
    _sellast
    enter
    _points
    -pause
    enter
    _sellast
    enter
    _setobjectname endpt1
    enter
    _points
    -pause
    enter
    _sellast
    enter
    _setobjectname endpt2
    enter
    _dimcurvelength
    pause
    pause
    pause
    _sellast
    enter
    _divide
    -pause
    -pause
    enter
    _selname
    pause
    enter
    _split

  • 4. thinslicedvolta (May 26, 2014 18.50):

    Hello, after reading your post, and the respondant's post I decided to give it a shot this morning. I did the best I could do. This is my second script, and I really want to figure out how to do completely automatic scripts by naming objects, automatically selecting objects for command prompts. Also, getting the options of a command down in macro editor or Rhinoscript code. So, I got about 1 entire days worth of problem solving down. I want all the commands to go smooth, and when I look in history it bothers me. Hopefully I can learn some on this site, I'll have to do some digging and asking questions.

    But anyways here it goes, semi-automatic


    Here are the instructions for the macro.

    Make your Curve however you do. I havent tested with all the types of points on curves, only curve that does not show points when selected if that makes any sense.

    Also, for max compatibility, do your selecting in the top viewport. Also, I dont believe it makes a difference in this macro, but I might test it out in left, bottom or something.

    Select your curve right before you run the macro.

    1. Run Macro, first off in the macro you have to name your curve for recall and selections in the macro.
    4. Add start point of curve(have end osnaps on)and then it goes straight to asking you for another point which is the end. I had to get these two selections in so that it would divide right. If I didn't, the 5 segments or 2 would not go end to end strangly enough. There would be a lonely tail on the end!
    5. Select the Main curve, this is for dimensions in the next prompt
    6. Select the start point first(start on the left works best) then move mouse over to end point which drags the dimension across.(osnaps end on again of course)
    7. Now select the curve to divide
    8. Do your math that you wrote in the post, and decide whether it's a 5 segment or 2
    9. Now you will be asked for curve name you choose in the beginning just to select it instead of points bringing you to
    10. Select cutting objects which is all the inside points, or points other than endpoints
    11. Delete dimension, and points, or do whatever you were gonna do. You could select the points as group, name em, go back and have command run to delete the group, but I aint that far yet. Only sellast, selname have been working for me.

    Anyways, This took me a lot less time than the one I did yesterday, but I'm glad I did it. It feels good when you get cruisin!

  • 3. Pixie_Dust (Apr 29, 2013 07.22):

    I think I'll be working on this one for a long time still... thanks for the suggestions :)

  • 2. Hanno (Apr 27, 2013 14.11):

    Hi,

    are you still working on this one? If so, here are some hints:

    * You need to understand the concept of curve parameters
    * I would subdivide the process into two steps: First cutting off the ends defined by length and then dividing the rest based on the segment count
    * have a look at rhinoscript methods CurveArcLengthPoint, TrimCurve and DivideCurve

    Hope that helps!

    Hanno

  • 1. Pixie_Dust (Apr 07, 2013 16.48):

    Help Please....
    I'm new to programming and am struggling to find a way to get Rhino to do what i need. I need a curve to split into certain lengths based on that curve's original length. so for a curve less than 50 it must be split at 10 from start and end, and the resulting curve split by a "number"(user input double) from start and end. for curves > 50 the same must occur, but then the remaining single curve, if less than 100 must be split in its middle by a "number", if greater than 100 must be split into 3 segments by a "number", if greater than 150 into 4 by a "number" etc etc etc... does someone have a script that does something similar or can someone point me in the direction please? thanks :)

Recommend

Why are these buttons gray?