hexagon logo

Have the roundness of an auto-circle in a variable

Hi there,

I am trying to have the roundness of an auto-element in a variable. I cannot use a dimension as I have 30,000 circles and try to export all of these roudnesses via a script to a txt file.

Does anyone knows how to call the roundness of an auto-circle into a variable?

Thanks in advance.
Parents


  • Try this...

    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim DmisCommands As Object
    Dim DmisCommand As Object
    Dim FCmd As Object
    
    Sub Main(OutputFileNameAndPath)
      Set DmisApp = CreateObject("PCDLRN.Application")
      Set DmisPart = DmisApp.ActivePartProgram
      Set DmisCommands = DmisPart.Commands
      CommandCount = DmisCommands.Count
      Set DmisCommand = DmisCommands.Item(CommandCount)
    
      Open OutputFileNameAndPath For Output As #1
    
      For Each DmisCommand In DmisCommands
        If DmisCommand.IsFeature Then
          If DmisCommand.Type = 612 Or DmisCommand =202 Then' (612 = auto circle, 202 = measured circle.  Using the numeric reference rather than text makes it language independent)
              Set FCmd = DmisCommand.FeatureCommand
                Print #1, DmisCommand.Id & chr(44) & FCmd.GetFormError()
          End If
        End If
      Next DmisCommand
    
      Close #1
    End Sub
    ​
    




    It reads the form error directly from the feature and writes it out to a file. Save as a .bas and then insert as a basic script command at the end of your routine. You need to specify the full path and file name for your output file as ARG1 like this...

    CS1        =SCRIPT/FILENAME= C:\USERS\PUBLIC\DOCUMENTS\SCRIPTS\GET_ROUNDNESS_FROM_FEATURE.BAS
                FUNCTION/Main,SHOW=YES,ARG1="C:\Users\Public\Documents\Scripts\Roundness_Output.txt",,
                STARTSCRIPT/
                ENDSCRIPT/​
    




    Note, this was for a routine using a touch trigger probe. I just noticed in a previous post that you said you were using vision so you will need to change the DmisCommand.Type. I believe 245 is a vision auto circle.
  • I didn't know that there were other data types for vision
    (VISION_CIRCLE_FEATURE = 245 according to the help file)
Reply Children
No Data