Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:scriptsamples:convertdotstotext [2015/09/14] (current)
Line 1: Line 1:
 +====== How To: Convert Annotation Dots to Text ======
 +> **Developer:​** [[developer:​rhinoscript|RhinoScript]]
 +> **Summary:​** //​Illustrates RhinoScript code that converts annotation dots to text object.//
 +
 +=====Example=====
 +
 +<code vb>
 + Sub ConvertDotsToText
 +   Dim arrDots, strDot
 +   ​arrDots = Rhino.GetObjects("​Select dots", 0, True, True )
 +   If Not IsArray(arrDots) Then Exit Sub
 +
 +   Dim arrPt, strText
 +   For Each strDot In arrDots
 +     If Rhino.IsTextDot(strDot) Then
 +       ​strText = Rhino.TextDotText(strDot)
 +       arrPt = Rhino.TextDotPoint(strDot)
 +       ​Rhino.AddText strText, arrPt
 +       ​Rhino.DeleteObject strDot
 +     End If
 +   Next
 + End Sub
 +</​code>​
 +
 +Here is the button macro version.
 +
 +<code vb>
 + ​_-NoEcho
 + ​_-RunScript (
 + ​arrDots = Rhino.GetObjects("​Select dots", 0, True, True )
 + If IsArray(arrDots) Then
 + For Each strDot In arrDots
 + If Rhino.IsTextDot(strDot) Then
 + ​strText = Rhino.TextDotText(strDot)
 + arrPt = Rhino.TextDotPoint(strDot)
 + ​Rhino.AddText strText, arrPt
 + ​Rhino.DeleteObject strDot
 + End If
 + Next
 + End If
 + )
 +</​code>​
 +
 +\\
 +
 +{{tag>​Developer RhinoScript}}
  
developer/scriptsamples/convertdotstotext.txt ยท Last modified: 2015/09/14 (external edit)