VB Script - User Defined Diameter for Measured Circle

VB Script - User Defined Diameter for Measured Circle

It is possible to reconstruct a Circle from User Defined parameters.  For example, you may create a measured circle in program, then prompt user for diameter, and finally reconstruct a circle using same XYZ center point with unique diameter.  This may be useful for measurement system where accurate measurement of position is possible but diameter is not - i.e. vision system, portable arm, very tight tolerance on diameter, etc.

Program structure as follows:
  1. Measure Circle
  2. VB Script (see below)
  3. Construct 3 points using values from VB Script
  4. (Re)construct Circle from 

VB Script:
  1. Do until d > 0
  2. d = InputBox("Please enter circle diameter in current units", "Enter Diameter")
  3. If d > 0 Then
  4. Else
  5. MsgBox("Please enter a diameter larger than 0.0")
  6. End If
  7. Loop

  8. 'Get Info from Measured Feature CIRCLE1
  9. x = GetFeaturePropertyAct("CIRCLE1",1)
  10. y = GetFeaturePropertyAct("CIRCLE1",2)
  11. z = GetFeaturePropertyAct("CIRCLE1",3)
  12. r = d/2

  13. xP = x+r
  14. yP = y+r
  15. yM = y-r

When program is run, user will see following prompt.  Value will be used to construct new circle with specified diameter: