Hey @Helvetosaur,
I recently downloaded your Maque tools toolbar (thank you) and would love to create an alias for ExtendClosePolyline because I use it so frequently. I tried to do it myself, Mitch, by taking the script out of your button and using RhinoScript to create an .rvb. I then assigned the letters ecp to ! _-loadscript “C:\Program Files\Rhinoceros 5.0 (64-bit)\Plug-ins\my_scripts\ExtendClosePolyline.rvb” but that didn’t work.
The code that I got off the Maque tools button was:
! _NoEcho _ - Runscript(
Option Explicit
’Script by Mitch Heynick ©
’Version 2 September, 2013
Call ExtendClosePolyline()
Sub ExtendClosePolyline()
Dim pLine
pLine = Rhino.GetObject(“Select polyline to connect-close”, 4, True)
If IsNull(pLine) Then Exit Sub
Call Rhino.EnableRedraw(False)
Call CloseTheBox(pline)
Call Rhino.EnableRedraw(True)
End Sub
Function CloseTheBox(pl)
'extends the endpoints of an open polyline to close
’similar to the function of the Connect command
CloseTheBox = Null
If Not Rhino.IsPolyline(pl) Then Exit Function
If Rhino.IsCurveClosed(pl) Then
CloseTheBox = pl : Exit Function
End If
Dim plPts,ub,intsec
plPts = Rhino.PolylineVertices(pl)
ub = Ubound(plPts)
If ub < 4 Then Exit Function 'not enough points
intsec = Rhino.LineLineIntersection(Array(plPts(1), plPts(0)), Array(plPts(ub - 1), plPts(ub)))
If IsArray(intsec) Then
If Ubound(intsec) = 2 Then
Call Rhino.EnableObjectGrips(pl, True)
Call Rhino.ObjectGripLocation(pl, 0, intsec)
Call Rhino.ObjectGripLocation(pl, ub, intsec)
Call Rhino.EnableObjectGrips(pl, False)
End If
End If
End Function
)
Am I missing something? Is there a step I am missing to activate it?
Thank you.
Cosmas