This shows you the differences between two versions of the page.
it:rhino:weighobjectsrvb [2015/09/14] |
it:rhino:weighobjectsrvb [2020/08/14] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Weight Objects ====== | ||
+ | |||
+ | |||
+ | |||
+ | > **Indietro: | ||
+ | |||
+ | > **Note:** //Lo script è stato fatto per calcolare il peso di un singolo o più oggetti moltiplicando il volume totale per il peso specifico. Fare attenzione all' | ||
+ | |||
+ | > **Istruzioni: | ||
+ | |||
+ | {@ | ||
+ | |||
+ | Sub Volumx | ||
+ | |||
+ | Dim VolNum, Pspec, Pesospec, x, Peso, PesoTot | ||
+ | |||
+ | Dim ArrObjects(), | ||
+ | |||
+ | | ||
+ | If (VarType(Pesospec))=vbNull Then Pesospec=0.00785 | ||
+ | Pspec = Rhino.GetReal(" | ||
+ | If (VarType(Pspec))=vbNull Then Pspec=Pesospec | ||
+ | |||
+ | i=0 | ||
+ | | ||
+ | While VarType(selobject) = vbstring | ||
+ | |||
+ | If Rhino.IsObjectSolid (selobject) Then | ||
+ | |||
+ | ReDim Preserve ArrObjects(i) | ||
+ | | ||
+ | | ||
+ | i=i+1 | ||
+ | | ||
+ | |||
+ | Else | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | End If | ||
+ | |||
+ | Wend | ||
+ | |||
+ | | ||
+ | |||
+ | If IsArray(Arrobjects) Then | ||
+ | Rhino.Command(" | ||
+ | For Each strobject In arrobjects | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Next | ||
+ | |||
+ | ' | ||
+ | |||
+ | | ||
+ | |||
+ | ' | ||
+ | Rhino.Command(" | ||
+ | Rhino.Command(" | ||
+ | Else | ||
+ | |||
+ | | ||
+ | End If | ||
+ | |||
+ | End Sub | ||
+ | |||
+ | Volumx | ||
+ | |||
+ | }@ | ||
+ | |||
+ | |||
+ | |||