# RandomSrf Esiste un modo per recuperare questo script ?

**URL:** <https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058>\
**Category:** Scripting e Programmazione\
**Created:** [6 Novembre 2016, 8:24pm UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058 "2016-11-06T20:24:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Antony](https://sea3.discourse-cdn.com/mcneel/user_avatar/it.discourse.mcneel.com/victor_antony/32/1137_2.png) [@Victor\_Antony](https://it.discourse.mcneel.com/u/Victor_Antony)\
**Post date:** [6 Novembre 2016, 8:24pm UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058/1 "2016-11-06T20:24:15Z")

</div>

'RandomSrf - creates a randomized copy of a surface  
'Jess Maertterer - develop design - [info@de-de.de](mailto:info@de-de.de) - � 17.06.2002  
public ddx,ddy,ddz  
Sub RandomSrf  
Rhino.Command “PtOff”  
Dim ma  
ma=Rhino.GetObjectId("Select surface to randomize ",8)  
If Not IsNull(ma) Then  
Rhino.SetObjectSelect ma,vbtrue  
If Not Rhino.IsSurface(ma) Then  
MsgBox “Selected surface is part of a polysurface”  
ma=vbnull  
End If  
End If  
If Not Vartype(ma)=VBstring then exit sub  
Rhino.SelectAllObjects vbfalse  
ma=Rhino.CopyObject (ma)  
Rhino.SetObjectSelect ma,vbtrue  
Dim C0, CU, I0  
C0=Rhino.GetSurfacePointCount(CStr(ma))  
CU=C0  
If Rhino.IsSurfaceSingular (ma) Then  
sxp ma  
For I0=0 To C0(0)  
Rhino.Command “NextU”  
Next  
for I0=0 To C0(1)  
Rhino.command “NextV”  
Next  
rhino.Command “Smooth Enter”  
rhino.Command “PtOff”  
End if  
Dim CO, M1, CurrentLocale  
Rhino.SelectAllObjects vbfalse  
Rhino.SetObjectSelect ma,vbtrue  
Rhino.Command “ExtractControlPolygon”  
M1=Rhino.GetLastObjectID  
CurrentLocale = SetLocale(“en-us”)  
CO=Rhino.GetMeshVertices(M1)  
Rhino.DeleteObject M1  
Dim uc, vc  
If IsArray(CO) Then  
M1=UBound(CO, 2)  
Else  
Exit Sub  
End If  
For I0=1 to M1  
If CO(0,0)=CO(0,I0) And CO(1,0)=CO(1,I0) And CO(2,0)=CO(2,I0) Then  
If I0 \< C0(0) ANd C0(0)=CU(0) Then C0(0)=I0 +1 : uc=vbtrue  
If I0 \> C0(0) and C0(1)=CU(1) Then C0(1)=((M1 + 1) / (C0(0))) : vc=vbtrue  
End If  
next  
Dim O0, l1, RF, S1,mx,my,mz  
If Not Vartype(ddx)=vbdouble then ddx=1  
If Not Vartype(ddy)=vbdouble then ddy=1  
If Not Vartype(ddz)=vbdouble then ddz=1  
ddx=Rhino.GetReal (“max X movement � “,ddx)  
ddy=Rhino.GetReal (“max Y movement � “,ddy)  
ddz=Rhino.GetReal (“max Z movement � “,ddz)  
If uc or vc then  
uid ma, CO  
else  
iud ma,C0  
end If  
Rhino.Command “SetRedrawOff”  
For O0=0 To (C0(1)-1)  
For l1=0 To (C0(0)-1)  
mx=(rnd-0.5)\*ddx \* 2  
my=(rnd-0.5)\*ddy \* 2  
mz=(rnd-0.5)\*ddz \* 2  
If Not ((l1=C0(0)-1) and uc) then  
if not ((O0=C0(1)-1) and vc) then  
S1=“Move 0,0,0 “&mx&”,”&my&”,”&mz  
Rhino.Command S1  
End If  
End If  
If l1 \< (C0(0)-1) then Rhino.Command “NextU”  
Next  
Rhino.Command “NextV”  
If Not uc Then  
For l1=0 To C0(0)-2  
Rhino.Command “PrevU”  
Next  
ENd If  
Next  
SetLocale(CurrentLocale)  
Rhino.Command “SetRedrawOn”  
Rhino.Command “ptoff”  
Rhino.Command “SelLast”  
End Sub  
RandomSrf  
Function sxp (srf)  
Rhino.Command “PtOff”  
Rhino.SelectAllObjects vbfalse  
Rhino.SetObjectSelect srf,vbtrue  
Rhino.Command “PtOn”  
Rhino.Command “InvertPt”  
End Function  
Function iud(srf, C0)  
Dim I0  
sxp (srf)  
For I0=2 to C0(0)  
Rhino.Command “PrevU”  
Next  
for I0=2 to C0(1)  
Rhino.Command “PrevV”  
Next  
End Function  
Function uid(srf, t1)  
Rhino.Command “PtOff”  
Rhino.SelectAllObjects vbfalse  
Rhino.SetObjectSelect srf,vbtrue  
Rhino.Command “PtOn”  
Dim tx,ty,tz, tl  
tx=t1(0,0)  
ty=t1(1,0)  
tz=t1(2,0)  
tl=“PlaceTarget w”&tx&”,”&ty&”,”&tz  
Rhino.Command tl  
Rhino.Command “CPlaneToView”  
Rhino.Command “SelWindow -0.001,-0.001 0.001,0.001”  
Rhino.Command “CplanePrev”  
Rhino.Command “ZoomPrev”  
End Function

![](https://mcneelusercontent.s3.amazonaws.com/original/2X/2/2650672fd7ceb3010bdc2029f05bd04092d764b1.jpg)

---

<div class="post-metadata">

**Author:** ![emilio](https://sea3.discourse-cdn.com/mcneel/user_avatar/it.discourse.mcneel.com/emilio/32/16095_2.png) [@emilio](https://it.discourse.mcneel.com/u/emilio)\
**Post date:** [6 Novembre 2016, 8:42pm UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058/2 "2016-11-06T20:42:45Z")

</div>

Non capisco cosa intendi esattamente, ma credo che quello script tu lo possa trovare qui:

[http://www.rhino3.de/\_develop/v2\_vbscript/improve\_srf/index.shtml](http://www.rhino3.de/_develop/v2_vbscript/improve_srf/index.shtml)

---

<div class="post-metadata">

**Author:** ![Victor\_Antony](https://sea3.discourse-cdn.com/mcneel/user_avatar/it.discourse.mcneel.com/victor_antony/32/1137_2.png) [@Victor\_Antony](https://it.discourse.mcneel.com/u/Victor_Antony)\
**Post date:** [6 Novembre 2016, 8:51pm UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058/3 "2016-11-06T20:51:34Z")

</div>

THE SCRIPT NOT RUN ARE ABLE TO REPAIR?  
if this paguina got the script!  
but it does not work

---

<div class="post-metadata">

**Author:** ![Victor\_Antony](https://sea3.discourse-cdn.com/mcneel/user_avatar/it.discourse.mcneel.com/victor_antony/32/1137_2.png) [@Victor\_Antony](https://it.discourse.mcneel.com/u/Victor_Antony)\
**Post date:** [6 Novembre 2016, 8:53pm UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058/4 "2016-11-06T20:53:39Z")

</div>

I wanted to do was work rhino 3

EL sceneggiatura, no funciona en rinoceronte 5

---

<div class="post-metadata">

**Author:** ![emilio](https://sea3.discourse-cdn.com/mcneel/user_avatar/it.discourse.mcneel.com/emilio/32/16095_2.png) [@emilio](https://it.discourse.mcneel.com/u/emilio)\
**Post date:** [7 Novembre 2016, 10:58am UTC](https://it.discourse.mcneel.com/t/randomsrf-esiste-un-modo-per-recuperare-questo-script/1058/5 "2016-11-07T10:58:51Z")

</div>

My suggestion is to ask the script’s author: Jess Maertterer  
You can just post on [https://discourse.mcneel.com/](https://discourse.mcneel.com/)  
and mention @Jess
