Adds a radial dimension object to the document.
Rhino.AddRadialDimension (arrPlane, arrCenter, arrArrow, arrKnee [, strStyle [, blnRadius]])
arrPlane |
Required. Array. The plane on which the dimension will lie. |
arrCenter |
Required. Array. The center point of the dimension. |
arrArrow |
Required. Array. The arrowhead point of the dimension. The distance between the center point and the arrowhead point defines the radius of the dimension. |
arrKnee |
Required. Array. The knee point of the dimension line. The knee point is the intermediate point between the arrowhead point and the position of the text. |
strStyle |
Optional. String. The name of the dimension style. If omitted, the current dimension style is used. |
blnRadius |
Optional. Boolean. If True (Default), a radius dimension will be created. If False, then a diameter dimension will be created. |
String |
The identifier of the new object if successful. |
Null |
If not successful, or on error. |
Sub TestRadialDim
Dim arrPlane, arrCenter, arrPoint, arrKnee
Dim arrObject, strCurve, dblPoint, arrKappa, arrCrv, dblLen
arrObject = Rhino.GetObjectEx("Select curve for radius dimension", 4)
If IsNull(arrObject) Then Exit Sub
strCurve = arrObject(0)
If Rhino.IsLine(strCurve) Then Exit Sub
If Rhino.IsPolyline(strCurve) Then Exit Sub
arrPlane = Rhino.CurvePlane(strCurve)
If IsNull(arrPlane) Then Exit Sub
arrPoint = arrObject(3)
dblPoint = Rhino.CurveClosestPoint(strCurve, arrPoint)
arrKappa = Rhino.CurveCurvature(strCurve, dblPoint)
arrCrv = arrKappa(4)
dblLen = Rhino.VectorLength(arrCrv)
arrCrv = Rhino.VectorUnitize(arrCrv)
arrCrv = Rhino.VectorScale(arrCrv, 1.0 / dblLen)
arrCenter = Rhino.PointAdd(arrPoint, arrCrv)
arrKnee = Rhino.PointSubtract(arrPoint, arrCrv)
Rhino.AddRadialDimension arrPlane, arrCenter, arrPoint, arrKnee
End Sub