Skip to content

Commit

Permalink
Added SampleAddRadialDimension.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dalefugier committed Sep 6, 2018
1 parent 4282d68 commit 625d38d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions rhinopython/SampleAddRadialDimension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
################################################################################
# SampleAddRadialDimension.py
# Copyright (c) 2018 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
import scriptcontext as sc

# Demonstrates how to create a radial dimension
def SampleAddRadialDimension():

plane = Rhino.Geometry.Plane.WorldXY
cp = Rhino.Geometry.Point3d(2.0, 2.0, 0.0)
p1 = Rhino.Geometry.Point3d(4.0, 4.0, 0.0)
p2 = Rhino.Geometry.Point3d(8.0, 6.0, 0.0)

style = sc.doc.DimStyles.Current
if (style.LeaderContentAngleType == Rhino.DocObjects.DimensionStyle.LeaderContentAngleStyle.Aligned):
p2.Y = 8.0

dim = Rhino.Geometry.RadialDimension.Create(style, Rhino.Geometry.AnnotationType.Radius, plane, cp, p1, p2)
if dim:
sc.doc.Objects.Add(dim)
sc.doc.Views.Redraw()

# Check to see if this file is being executed as the "main" python
# script instead of being used as a module by some other python script
# This allows us to use the module which ever way we want.
if __name__ == "__main__":
SampleAddRadialDimension()

0 comments on commit 625d38d

Please sign in to comment.