Continue macro after script


#1

Hi

I found this RhinoScript that creates center points for the circles, it ´s working fine, but how can I create a Rhino button to run the script and add my macro code after that?

This is the script:

 ! _-Runscript (
 curves = Rhino.GetObjects("Select closed planar curves", 4, ,True)
 If IsArray(curves) Then
 Rhino.EnableRedraw False
 For Each crv In curves
 pt = vbNull
 If Rhino.IsCircle(crv) Then
 pt = Rhino.CircleCenterPoint(crv)
 Else
 arr = Rhino.CurveAreaCentroid(crv)
 If IsArray(arr) Then pt = arr(0)
 End If
 If IsArray(pt) Then
 Rhino.SelectObject Rhino.AddPoint(pt)
 End If
 Next        
 Rhino.EnableRedraw True
 End If
 ) 
;How can I continue now and add
_SelCrv 
_SelPt
_Project

Thanks


#2

I got it!! :slight_smile:

Thanks


#3

Hi again

I have my script working, but the next step , altough simple, I don´t think I can get away by using macro commands.
See the images and if you have any tips fee free :slight_smile:

1 -I have some dozens of circles in my scene, I run my script and I get the center point.
https://www.dropbox.com/s/6honwilbjnp5uj9/Cap1.JPG?dl=0

2-Script result:
https://www.dropbox.com/s/la85kjfokk7jni0/Cap2.JPG?dl=0

3-This image shows what would be my goal, to project the center point onto the surface and copy/or project flat the circle on the bottom to the Z height.
https://www.dropbox.com/s/8eft7w4heeicpeo/Cap3.JPG?dl=0