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
  • neil.challinor thank you so much for the help and the script.

    It works and this is the final result

    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim DmisCommands As Object
    Dim DmisCommand As Object
    Dim FCmd As Object
    
    Dim savePath
    Dim repFolder
    Dim repName
    Dim tX, tY, tD, tRound, mX, mY, mD, mRound As String
    
    Sub Main(OutputFileNameAndPath)
      Set DmisApp = CreateObject("PCDLRN.Application")
      Set DmisPart = DmisApp.ActivePartProgram
      Set DmisCommands = DmisPart.Commands
      CommandCount = DmisCommands.Count
      Set DmisCommand = DmisCommands.Item(CommandCount)
    
    repName = format(now(),"YYYYMMDDHHNNSS")
    savePath = "D:\PC-DMIS Data\Scripts\TEMP\"
    repFolder = left(DmisPart.Name,len(DmisPart.Name)-4)
    
    OutputFileNameAndPath = savePath & repFolder & repName & ".TXT"
    
      Open OutputFileNameAndPath For Output As #1
    
    For Each DmisCommand In DmisCommands
    
      If DmisCommand.IsFeature Then
    
       '' If DmisCommand.Type = 612 Or DmisCommand = 202 Or DmisCommand = 245 Then
    
    
          If Left(DmisCommand.ID, 3) = "CIR" Then
    
    
            Set FCmd = DmisCommand.FeatureCommand
    
            tX = DmisCommand.GetText(THEO_X, 0)
            tY = DmisCommand.GetText(THEO_Y, 0)
            tD = FCmd.TheoDiam 'tD = PCDCommand.GetText(THEO_DIAM, 0)
    
            mX = DmisCommand.GetText(MEAS_X, 0)
            mY = DmisCommand.GetText(MEAS_Y, 0)
            mD = FCmd.MeasDiam 'mD = PCDCommand.GetText(MEAS_DIAM, 0)
    
            mRound = FCmd.GetFormError()
            tRound = 0
             tL= DmisCommand.GetText(THEO_LENGTH, 0)
             mL = DmisCommand.GetText(MEAS_LENGTH, 0)
             tW =DmisCommand.GetText(THEO_WIDTH, 0)
             mW = DmisCommand.GetText(MEAS_WIDTH, 0)
    
            Write #1, DmisCommand.ID & ", " & tX & ", " & tY & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mD & ", " & mRound & ", " & tL & ", " & mL & ", "& tW & ", " & mW
    
    If mRound>0.3 Then
      
        End If
       End If  
    
    Next DmisCommand
    
    Close #1
    End Sub​
Reply
  • neil.challinor thank you so much for the help and the script.

    It works and this is the final result

    Dim DmisApp As Object
    Dim DmisPart As Object
    Dim DmisCommands As Object
    Dim DmisCommand As Object
    Dim FCmd As Object
    
    Dim savePath
    Dim repFolder
    Dim repName
    Dim tX, tY, tD, tRound, mX, mY, mD, mRound As String
    
    Sub Main(OutputFileNameAndPath)
      Set DmisApp = CreateObject("PCDLRN.Application")
      Set DmisPart = DmisApp.ActivePartProgram
      Set DmisCommands = DmisPart.Commands
      CommandCount = DmisCommands.Count
      Set DmisCommand = DmisCommands.Item(CommandCount)
    
    repName = format(now(),"YYYYMMDDHHNNSS")
    savePath = "D:\PC-DMIS Data\Scripts\TEMP\"
    repFolder = left(DmisPart.Name,len(DmisPart.Name)-4)
    
    OutputFileNameAndPath = savePath & repFolder & repName & ".TXT"
    
      Open OutputFileNameAndPath For Output As #1
    
    For Each DmisCommand In DmisCommands
    
      If DmisCommand.IsFeature Then
    
       '' If DmisCommand.Type = 612 Or DmisCommand = 202 Or DmisCommand = 245 Then
    
    
          If Left(DmisCommand.ID, 3) = "CIR" Then
    
    
            Set FCmd = DmisCommand.FeatureCommand
    
            tX = DmisCommand.GetText(THEO_X, 0)
            tY = DmisCommand.GetText(THEO_Y, 0)
            tD = FCmd.TheoDiam 'tD = PCDCommand.GetText(THEO_DIAM, 0)
    
            mX = DmisCommand.GetText(MEAS_X, 0)
            mY = DmisCommand.GetText(MEAS_Y, 0)
            mD = FCmd.MeasDiam 'mD = PCDCommand.GetText(MEAS_DIAM, 0)
    
            mRound = FCmd.GetFormError()
            tRound = 0
             tL= DmisCommand.GetText(THEO_LENGTH, 0)
             mL = DmisCommand.GetText(MEAS_LENGTH, 0)
             tW =DmisCommand.GetText(THEO_WIDTH, 0)
             mW = DmisCommand.GetText(MEAS_WIDTH, 0)
    
            Write #1, DmisCommand.ID & ", " & tX & ", " & tY & ", " & tD & ", " & tRound & ", " & mX & ", " & mY & ", " & mD & ", " & mRound & ", " & tL & ", " & mL & ", "& tW & ", " & mW
    
    If mRound>0.3 Then
      
        End If
       End If  
    
    Next DmisCommand
    
    Close #1
    End Sub​
Children
No Data