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
  • Oke found a possible new way. I insert the roundness in the script. Looks like this.

    Set DmisCommand = DmisCommands.Add(ISO_TOLERANCE_COMMAND, True)
        DmisCommand.Marked = True
      ' Set Id  = FCFCIRTY1
        retval = DmisCommand.PutText ("FCFCIRTY"&iCnt, ID, 0)
      ' Set Standard  = ISO 1101
        retval = DmisCommand.PutText ("ISO 1101", STANDARD, 0)
      ' Set Feature Math Type  = DEFAULT
        retval = DmisCommand.SetToggleStringEx (1, BF_MATH_TYPE, 0, "FEATMATHTYPE")
      ' Set Tol Zone Math Type Item 1 = DEFAULT
        retval = DmisCommand.SetToggleStringEx (1, BF_MATH_TYPE, 1, "TOLZONEMATHTYPE")
      ' Set Output Type  = BOTH
        retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
      ' Set Arrow Density  = 100
        retval = DmisCommand.PutText ("100", ARROW_DENSITY, 0)
      ' Set SHOWEXPANDED  = YES
        retval = DmisCommand.PutText ("YES", SHOW_OPTIONS, 0)
      ' Set Unit Type  = MM
        retval = DmisCommand.SetToggleString (2, UNIT_TYPE, 0)
      ' Set SHOWEXPANDED  = NO
        retval = DmisCommand.SetToggleStringEx (1, SHOW_OPTIONS, 0, "SIZE")
      ' Set SHOWEXPANDED  = NO
        retval = DmisCommand.SetToggleStringEx (1, SHOW_OPTIONS, 0, "DATUMSIZE")
      ' Set Add Segment Item 1 = CIRCULARITY
        retval = DmisCommand.SetToggleString (2, SEGMENT_TYPE_TOGGLE, 1)
      ' Set DISPLAY_COORDS  = CURRENT_ALIGNMENT
        retval = DmisCommand.SetToggleString (2, DISPLAY_TYPE, 0)
      ' Set ToleranceSpecificationMode  = NOMINAL_WITH_DEVIATIONS
        retval = DmisCommand.SetToggleStringEx (1, MODE_TYPE, 0, "SIZE")
      ' Set Reference Id Item 1 = CIR1
        retval = DmisCommand.PutText ("CIR" & iCnt, REF_ID, 1)
      ' Set Tolerance Type Item 1 = 1
        retval = DmisCommand.SetToggleString (2, SEGMENT_TYPE, 1)
      ' Set Tolerance Item 1 = 0.01
        retval = DmisCommand.PutText ("0.01", FORM_TOLERANCE, 1)
      ' Set TEXT Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 1)
      ' Set CADGRAPH Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, CAD_GRAPH_ANALYSIS, 1)
      ' Set REPORTGRAPH Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, REPORT_GRAPH_ANALYSIS, 1)
      ' Set MULT Item 1 = 10
        retval = DmisCommand.PutText ("10", ARROW_MULTIPLIER, 1)
      ' Set Per Unit/Composite Item 1 = 0
        retval = DmisCommand.PutText ("0", COMPOSITE, 1)
      ' Set Unequally Disposed/Dynamic Profile Item 1 = 0
        retval = DmisCommand.PutText ("0", UNEQUAL_TOL_LINE2, 1)
      ' Set Unequal Tolerance Zone Item 1 = 0
        retval = DmisCommand.PutText ("0", UNEQUAL_TOL_ZONE_LINE2, 1)
      ' Set Per Unit Shape Item 1 = <UA>
        retval = DmisCommand.PutText ("<UA>", PERUNIT_AREA_FORM_LINE3, 1)
      ' Set Per Unit Length Item 1 = 0
        retval = DmisCommand.PutText ("0", PERUNIT_LENGTH , 1)
      ' Set Per Unit Width Item 1 = 0
        retval = DmisCommand.PutText ("0", PERUNIT_WIDTH , 1)
      ' Set Tolerance Zone Type Item 1 = PLANAR
        retval = DmisCommand.SetToggleStringEx (1, FCF_TOL_ZONE_TYPE, 1, "SEG=1")
      ' Set Angle Vector I Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_I, 1, "SEG=1")
      ' Set Angle Vector J Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_J, 1, "SEG=1")
      ' Set Angle Vector K Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_K, 1, "SEG=1")
      ' Set <MC> Item 1 = __
        retval = DmisCommand.SetToggleStringEx (1, TP_MODIFIER, 1, "SEG=1")
      ' Set <T> Item 1 = __
        retval = DmisCommand.SetToggleStringEx (1, TP_MODIFIER2, 1, "SEG=1")
      ' Set <PZ> Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", USE_AXIS, 1, "SEG=1")
      ' Set <len> Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", DIM_LENGTH, 1, "SEG=1")
      ' Set WORKPLANE Item 1 = ZPLUS
        retval = DmisCommand.SetToggleStringEx (1, WORK_PLANE, 1, "SEG=1")
      ' Set NOMINAL (SIZE)  = 4
        retval = DmisCommand.PutTextEx ("4", SIZE_NOMINAL, 0, "SIZE")
      ' Set NOMINAL (SIZE)  = 0.01
        retval = DmisCommand.PutTextEx ("0.01", UPPER_TOLERANCE, 0, "SIZE")
      ' Set LOWER TOLERANCE (SIZE)  = 0.01
        retval = DmisCommand.PutTextEx ("0.01", LOWER_TOLERANCE, 0, "SIZE")
      ' Set UPPER SIZE Item 1 = 4
        retval = DmisCommand.PutText ("4", UPPER_SIZE, 1)
      ' Set LOWER SIZE Item 1 = 4
        retval = DmisCommand.PutText ("4", LOWER_SIZE, 1)
      ' Set REPORT_SIZE Item 1 = 1
        retval = DmisCommand.PutText ("1", USE_SIZE, 1)
      ' Set Feature Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", DIM_DEVIATION, 1, "SEG=1")
    ​


    Then, I would like to know the deviation.

    Can someone help how to get the roundness from this? I tried something like
    DmisCommand.GetText(DEVIATION_SEGMENT, 1), but that doesn't work.

    Also, is it possible not to insert the roundness command in the routine? Otherwise it'll take too much time if you run this 30,000 times.. Slight smile
Reply
  • Oke found a possible new way. I insert the roundness in the script. Looks like this.

    Set DmisCommand = DmisCommands.Add(ISO_TOLERANCE_COMMAND, True)
        DmisCommand.Marked = True
      ' Set Id  = FCFCIRTY1
        retval = DmisCommand.PutText ("FCFCIRTY"&iCnt, ID, 0)
      ' Set Standard  = ISO 1101
        retval = DmisCommand.PutText ("ISO 1101", STANDARD, 0)
      ' Set Feature Math Type  = DEFAULT
        retval = DmisCommand.SetToggleStringEx (1, BF_MATH_TYPE, 0, "FEATMATHTYPE")
      ' Set Tol Zone Math Type Item 1 = DEFAULT
        retval = DmisCommand.SetToggleStringEx (1, BF_MATH_TYPE, 1, "TOLZONEMATHTYPE")
      ' Set Output Type  = BOTH
        retval = DmisCommand.SetToggleString (3, OUTPUT_TYPE, 0)
      ' Set Arrow Density  = 100
        retval = DmisCommand.PutText ("100", ARROW_DENSITY, 0)
      ' Set SHOWEXPANDED  = YES
        retval = DmisCommand.PutText ("YES", SHOW_OPTIONS, 0)
      ' Set Unit Type  = MM
        retval = DmisCommand.SetToggleString (2, UNIT_TYPE, 0)
      ' Set SHOWEXPANDED  = NO
        retval = DmisCommand.SetToggleStringEx (1, SHOW_OPTIONS, 0, "SIZE")
      ' Set SHOWEXPANDED  = NO
        retval = DmisCommand.SetToggleStringEx (1, SHOW_OPTIONS, 0, "DATUMSIZE")
      ' Set Add Segment Item 1 = CIRCULARITY
        retval = DmisCommand.SetToggleString (2, SEGMENT_TYPE_TOGGLE, 1)
      ' Set DISPLAY_COORDS  = CURRENT_ALIGNMENT
        retval = DmisCommand.SetToggleString (2, DISPLAY_TYPE, 0)
      ' Set ToleranceSpecificationMode  = NOMINAL_WITH_DEVIATIONS
        retval = DmisCommand.SetToggleStringEx (1, MODE_TYPE, 0, "SIZE")
      ' Set Reference Id Item 1 = CIR1
        retval = DmisCommand.PutText ("CIR" & iCnt, REF_ID, 1)
      ' Set Tolerance Type Item 1 = 1
        retval = DmisCommand.SetToggleString (2, SEGMENT_TYPE, 1)
      ' Set Tolerance Item 1 = 0.01
        retval = DmisCommand.PutText ("0.01", FORM_TOLERANCE, 1)
      ' Set TEXT Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, TEXT_ANALYSIS, 1)
      ' Set CADGRAPH Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, CAD_GRAPH_ANALYSIS, 1)
      ' Set REPORTGRAPH Item 1 = OFF
        retval = DmisCommand.SetToggleString (1, REPORT_GRAPH_ANALYSIS, 1)
      ' Set MULT Item 1 = 10
        retval = DmisCommand.PutText ("10", ARROW_MULTIPLIER, 1)
      ' Set Per Unit/Composite Item 1 = 0
        retval = DmisCommand.PutText ("0", COMPOSITE, 1)
      ' Set Unequally Disposed/Dynamic Profile Item 1 = 0
        retval = DmisCommand.PutText ("0", UNEQUAL_TOL_LINE2, 1)
      ' Set Unequal Tolerance Zone Item 1 = 0
        retval = DmisCommand.PutText ("0", UNEQUAL_TOL_ZONE_LINE2, 1)
      ' Set Per Unit Shape Item 1 = <UA>
        retval = DmisCommand.PutText ("<UA>", PERUNIT_AREA_FORM_LINE3, 1)
      ' Set Per Unit Length Item 1 = 0
        retval = DmisCommand.PutText ("0", PERUNIT_LENGTH , 1)
      ' Set Per Unit Width Item 1 = 0
        retval = DmisCommand.PutText ("0", PERUNIT_WIDTH , 1)
      ' Set Tolerance Zone Type Item 1 = PLANAR
        retval = DmisCommand.SetToggleStringEx (1, FCF_TOL_ZONE_TYPE, 1, "SEG=1")
      ' Set Angle Vector I Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_I, 1, "SEG=1")
      ' Set Angle Vector J Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_J, 1, "SEG=1")
      ' Set Angle Vector K Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", ANGVEC_K, 1, "SEG=1")
      ' Set <MC> Item 1 = __
        retval = DmisCommand.SetToggleStringEx (1, TP_MODIFIER, 1, "SEG=1")
      ' Set <T> Item 1 = __
        retval = DmisCommand.SetToggleStringEx (1, TP_MODIFIER2, 1, "SEG=1")
      ' Set <PZ> Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", USE_AXIS, 1, "SEG=1")
      ' Set <len> Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", DIM_LENGTH, 1, "SEG=1")
      ' Set WORKPLANE Item 1 = ZPLUS
        retval = DmisCommand.SetToggleStringEx (1, WORK_PLANE, 1, "SEG=1")
      ' Set NOMINAL (SIZE)  = 4
        retval = DmisCommand.PutTextEx ("4", SIZE_NOMINAL, 0, "SIZE")
      ' Set NOMINAL (SIZE)  = 0.01
        retval = DmisCommand.PutTextEx ("0.01", UPPER_TOLERANCE, 0, "SIZE")
      ' Set LOWER TOLERANCE (SIZE)  = 0.01
        retval = DmisCommand.PutTextEx ("0.01", LOWER_TOLERANCE, 0, "SIZE")
      ' Set UPPER SIZE Item 1 = 4
        retval = DmisCommand.PutText ("4", UPPER_SIZE, 1)
      ' Set LOWER SIZE Item 1 = 4
        retval = DmisCommand.PutText ("4", LOWER_SIZE, 1)
      ' Set REPORT_SIZE Item 1 = 1
        retval = DmisCommand.PutText ("1", USE_SIZE, 1)
      ' Set Feature Item 1 = 0
        retval = DmisCommand.PutTextEx ("0", DIM_DEVIATION, 1, "SEG=1")
    ​


    Then, I would like to know the deviation.

    Can someone help how to get the roundness from this? I tried something like
    DmisCommand.GetText(DEVIATION_SEGMENT, 1), but that doesn't work.

    Also, is it possible not to insert the roundness command in the routine? Otherwise it'll take too much time if you run this 30,000 times.. Slight smile
Children