Construction Lines request

I am assuming it’s a bug. I had the import Rhino, I just didn’t copy it in my code block, I will next time.

You posted a script on another post about a week ago …

That had the error as well.

Here is the code from above …

I was looking through the RhnoCommon SDK to see if a module was missing that needed to be imported.

Thanks for the updated script :smile:

Does the RhinoscriptSyntax one actually work on mac?

-Pascal

I don’t think so, just checking.

Nope First this …

then this …

Off for a bit, I will check later. Happy Saturday @pascal

Thanks

http://mcneel.myjetbrains.com/youtrack/issue/MR-2394

Meantime, let’s try rs.GetPoints()

import Rhino
import rhinoscriptsyntax as rs

pts = rs.GetPoints(True, max_points=2)
vecDir = pts[1]-pts[0]
mid = pts[0] + (vecDir/2)
vecDir.Unitize()
vecDir = vecDir*500
p1 = mid + vecDir
vecDir.Reverse()
p2 = mid + vecDir
rs.AddLine(p1, p2)

-Pascal

That works, thanks. So all you’re doing is setting the direction by the points.

I think what would be neat, in relation to this thread is to have a command loop until explicitly said to finish. That way if you are say offsetting lines on a surface you could set the distance, pick one edge and line would offset, then either pick another edge or change the distance etc. and continue like this until you hit the done button. Also if you have a direction option, you could set the direction by clicking on the appropriate edge or change the direction arrow, or something like that.

I think something like that could also work for multiple extrusions as well. I remember that post somewhere.

I think a loop option just saves a bit of time instead of having to restart the command by hitting the spacebar.

Just a few thoughts.

«Randy

Hi Randy, I’ve been out of the game for some days and am just getting back. I’m glazing over reading the atom thread - I just don’t know enough about coding to gather the insights yet. Can this tool be created inside rhino and accessed, is that the issue you’re discussing with Pascal? Is atom a program that must be running to use the code in rhino? How/where?

As I have said previously, if you are not going to program Rhino yourself, there is absolutely no need to install Atom. You can very easily run scripts directly from aliases or customized palette buttons.

Only if you want to try your hand at scripting would the Atom installation be interesting. You will still be somewhat handicapped though (relative to Windows Rhino users), as the Atom-MacRhino combination does not have any debug capability yet.

–Mitch

Okay, thanks Mitch. So my noob method is useable for the time being … I’m more motivated to design objects than write code. On the other hand, the interface makes doing so more or less productive. What I can gather from the discussion between Pascal and Jeff is that the python script is not quite working yet. Or is it?

Yes, apparently the RhinoCommon method GetLine() is not working in Mac Rhino for some reason, which is why you get the error messages. I think Pascal was cooking up a substitute using a different approach. I haven’t had much time to play with this stuff myself, turning into a pretty busy week here.

–Mitch

I’d add that it would be great if those lines could be designated to be the dashed center line variety for easy id while working. :grinning:

Yeah GetPoints() version code is above ^ a few posts.

-Pascal

Not sure how to get the line “Dashed”. I can get LineTypeNames …

Not sure how to get the line to change to “Dashed” ?

Any ideas how to change LineType, if possible?
Not much time here today to look through RhinoCOmmon.

Hi Randy,

You probably want to look at rs.ObjectLinetype(obj_ID, linetype_name) and perhaps rs.ObjectLinetypeSource()…

I’ll let you run with that, let me know if you need more help… :smile:

–Mitch

Thanks Mitch,

Object Linetype should work. I will give it a try in a bit.

Sometimes looking in all the wrong places, didn’t see anything under Line or LineType !

«Randy

Yeah, linetype is an object property, hence it’s under objects… Otherwise using the search tab with “linetype” finds it.

–Mitch

BTW, all - Rhino 6 for Windows and presumably eventually Rhino for Mac, will have

AddGuide & RemoveGuide

commands that handle this.

-Pascal

@pascal: I was under the (incorrect?) impression that a goal of Rhino 6 was parity between both OS’s. Is that not the case? ~Dave

That is the goal, yes, as far as I know.

-Pascal

So again, I want to do something very simple and yet it’s a silly nuisance. On the object shown I want to place a center point 1.5" up from the bottom and then 2" from the side edge. I try to use the distance tool but it’s plagued with snaps and c-plane reference issues. It’s maddening. I have to figure out a work around to get this petty job accomplished?

Uploading…

Can you use a relative coordinate and OSnaps starting with the intersection of the side edge and bottom: R2,1.5 ?