As V6 have History on _ExtractIsoCurve, i’m trying to script this with RhinoCommand, but RhinoCommand still,for me, always a bit confused in writing method.
With the Script below, when i use Rhino.extractIsoCurve , the script work as expected.
When i try the same with RhinoCommand, i get another result, Iso are extracted on mouse position
I got same problem, something is wrong, when i try to put value from Domain in StrPt, seems script extract at right place ( surface center ) then , for some mysterious reasons replace iso extracted on mouse location click.
If you try the script on simple surface you’ll see what’s happend.
Call Main()
Sub Main()
Dim strSrf, arrIso , arrDomainU , arrDomainV
Dim blnHistory, arrPt
Dim strPt, strCmd
Dim arrParam(1)
strSrf = Rhino.GetObject("Select surface for isocurve extraction", 8)
If IsNull(strSrf) Then Exit Sub
arrDomainU = Rhino.SurfaceDomain(strSrf, 0)
arrDomainV = Rhino.SurfaceDomain(strSrf, 1)
arrParam(0) = ((arrDomainU(0) + arrDomainU(1)) / 2 )
arrParam(1) = ((arrDomainV(0) + arrDomainV(1)) / 2 )
arrPt = Rhino.EvaluateSurface(strSrf, arrParam)
strPt = Rhino.Pt2Str(arrPt)
strCmd = "_ExtractIsoCurve _SelID " & strSrf & " _Direction=_Both _IgnoreTrims=_Yes " & strPt & " _Enter"
blnHistory = Rhino.EnableHistoryRecording(True)
Call Rhino.Command(strCmd, True)
Call Rhino.EnableHistoryRecording(blnHistory)
End Sub