I am completely clueless now. I must be doing something wrong and I can’t figure it out. I am quite new to all the languages used in scripting Rhino. I am also unsure where in my code I will need to insert the line you sent to me. I tried to use VB all over from the start and now I can’t even get past creating a surface because I get an error that, type mismatch parameter.
Option Explicit
'Script written by <insert name>
'Script copyrighted by <insert company name>
'Script version Friday, March 19, 2021 11:29:53 AM
Dim Draft, Height, B, L, R, h, k, Za, Xb, H1, Xa, Zb, alphaP, R1, R2, Xp, Zp, xmid, zmid
Dim Arc1, Arc2, Arc3, line1, Pline, Surface1, ExtrudePath, Extruder, LatestObject
Call Main()
Sub Main()
Draft = 5
Height = 25
B = 23
L = 46
R = L / 2
h = 0.6
k = 0.8
Za = 0
Xb = 0
H1 = h * R
Xa = k * R
Zb = R * (1 - 2 * h - 2 * k + h ^ 2 + 2 * h * k) / (2 - 2 * h - 2 * k)
alphaP = Rhino.ToDegrees(Atn(Xa / Zb))
R1 = R - Xa
R2 = Zb + H1
Xp = R2 * Sin(Rhino.ToRadians(alphaP))
Zp = Zb - R2 * Cos(Rhino.ToRadians(alphaP))
xmid = (R + Xp) / 2
zmid = 0 - Sqr(R1 ^ 2 - ((xmid - Xa) ^ 2))
Arc1 = Rhino.AddArc3Pt(Array(-R, 0, 0), Array(-Xp, 0, zp), Array(-xmid, 0, zmid))
Arc2 = Rhino.AddArc3Pt(Array(-Xp, 0, Zp), Array(Xp, 0, zp), Array(0, 0, -H1))
Arc3 = Rhino.AddArc3Pt(Array(Xp, 0, Zp), Array(R, 0, 0), Array(xmid, 0, zmid))
line1 = Rhino.AddLine(Array(-R, 0, 0), Array(R, 0, 0))
ExtrudePath = Rhino.AddLine(Array(0, 0, 0), Array(0, B / 2, 0))
Pline = Rhino.JoinCurves(Array(Arc1, Arc2, Arc3, line1))
Surface1 = Rhino.AddPlanarSrf(Pline)
Extruder = Rhino.ExtrudeCurve(Pline, ExtrudePath)
End Sub
rhinoFloater.py (3.1 KB) TestRhinoScript2.rvb (1.3 KB)