Dimensioning Torus

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dimensioning Torus

    I have a question about a measured torus hopefully someone can answer. This is also my first post here, so bear with me . I've searched a bit but I haven't seen anything that answers my question. Basically, I need to figure out the minor diameter of this torus. If I hover over that feature in the Edit toolbar, under the ACTL measurements I can see the measurement i’m looking for (the .25027). I’m trying to figure out a way to dimension it or manually extract it using a variable or anything related to that. Any suggestions?


    unnamed.jpg

  • #2
    You should find the dimension here :
    torus dim.JPG

    Comment


    • #3
      You cannot report the minor diameter the way Jefman posted, unless I am missing something there. Unfortunately, the torus is not used much and I think this causes the developers to skip resolving this. This is what I could find:

      ASSIGN/V1=GETTEXT("Measured Minor Diameter",0,{TORUS1})

      Note: Torus1 was the name of my torus feature.

      you can then plug that value into a generic circle and dimension it.

      F1 =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
      NOM/XYZ,<0,0,0>,$
      MEAS/XYZ,<0,0,0>,$
      NOM/IJK,<0,0,1>,$
      MEAS/IJK,<0,0,1>,$
      DIAMETER/1.5,V1

      Note: V1 is my measured value that I assigned to be the torus minor diameter, which I can plug into the measured size portion of the generic circle. After that, it is a simple location (D) dimension. My nominal minor diameter was 1.5mm.

      Comment


      • #4
        Originally posted by beech332 View Post
        You cannot report the minor diameter the way Jefman posted, unless I am missing something there. Unfortunately, the torus is not used much and I think this causes the developers to skip resolving this. This is what I could find:

        ASSIGN/V1=GETTEXT("Measured Minor Diameter",0,{TORUS1})

        Note: Torus1 was the name of my torus feature.

        you can then plug that value into a generic circle and dimension it.

        F1 =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
        NOM/XYZ,<0,0,0>,$
        MEAS/XYZ,<0,0,0>,$
        NOM/IJK,<0,0,1>,$
        MEAS/IJK,<0,0,1>,$
        DIAMETER/1.5,V1

        Note: V1 is my measured value that I assigned to be the torus minor diameter, which I can plug into the measured size portion of the generic circle. After that, it is a simple location (D) dimension. My nominal minor diameter was 1.5mm.
        You're right, I didn't check it... !
        Don Ruggieri : could it be "enhanced" ?

        Comment


        • #5
          I know this is an old post but I've only just stumbled across it and realised that I had a solution available. It's a script I developed for one of our UK portable users around eighteen months ago. If you link the script to a custom toolbar icon then it will function like a command. When you click the icon it will show a dialog that lists all of the torus features in your routine. Just select the torus you are interested in and it will automatically add two generic features to your code - one for the major diameter and one for the minor. You can then dimension those generic features as you normally would.

          Code:
          '================================================= ==========================
          ' Report torus
          '
          ' lists all Torus features In measurement routine And gives the Option To report minor And major diameters
          '
          ' attach this script To a custom icon On the toolbar And Each time the icon is clicked it will display the dialogue
          '
          '================================================= ==========================
          
          Sub Main()
          Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand
          Dim PCDFeatCmd
          Dim prbhit
          Dim numhits As Integer
          
          Set PCDApp = CreateObject("PCDLRN.Application")
          Set PCDPartPrograms = PCDApp.PartPrograms
          Set PCDPartProgram = PCDApp.ActivePartProgram
          Set PCDCommands = PCDPartProgram.Commands
          
          Dim cmd As Object
          Dim Fcntr As Integer
          Dim FeatureList$(999)
          
          Dim TorID,TX, TY, TZ, TI, TJ, TK, TD, TMD As String
          Dim MX, MY, MZ, MI, MJ, MK, MD, MMD As String
          
          '***** Predialog START
          Fcntr = 0
          ' Enumerate commands
          For Each cmd In PCDCommands
          ' 200 = Measured (learned) torus feature
          If cmd.Type = 200 Then
          FeatureList(Fcntr) = cmd.ID
          Fcntr = Fcntr + 1
          End If
          Next cmd
          '*****
          
          '***** Dialog START
          Begin Dialog DIALOG_1 31,48, 172, 141, "Point Extraction"
          ListBox 68,8,96,128, FeatureList$(), .ListBox
          PushButton 8,80,52,12, "Create", .PointsBtn
          PushButton 8,120,52,12, "Cancel", .CancelBtn
          End Dialog
          
          Dim Dlg1 As DIALOG_1
          button = Dialog(Dlg1)
          ' button 1 = create selected
          ' button 2 = Cancel selected
          '*****
          
          '***** Generic feature generation
          
          If button = 1 Then
          Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox))
          Set PCDFeatCmd = PCDCommand.FeatureCommand
          TorID=PCDCommand.id
          
          ' Get X, Y, Z, major diameter & minor diameter from selected torus & feed into generic circles
          
          Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
          PCDCommand.Marked = True
          retval = PCDCommand.PutText ("0", THEO_X, 0)
          retval = PCDCommand.PutText ("0", THEO_Y, 0)
          retval = PCDCommand.PutText ("0", THEO_Z, 0)
          retval = PCDCommand.PutText ("0", THEO_X2, 0)
          retval = PCDCommand.PutText ("0", THEO_Y2, 0)
          retval = PCDCommand.PutText ("0", THEO_Z2, 0)
          retval = PCDCommand.PutText ("0", THEO_I, 0)
          retval = PCDCommand.PutText ("0", THEO_J, 0)
          retval = PCDCommand.PutText ("1", THEO_K, 0)
          retval = PCDCommand.PutText ("4", THEO_RADIUS, 0)
          retval = PCDCommand.PutText ("0", MEAS_X, 0)
          retval = PCDCommand.PutText ("0", MEAS_Y, 0)
          retval = PCDCommand.PutText ("0", MEAS_Z, 0)
          retval = PCDCommand.PutText ("0", MEAS_X2, 0)
          retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
          retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
          retval = PCDCommand.PutText ("0", MEAS_I, 0)
          retval = PCDCommand.PutText ("0", MEAS_J, 0)
          retval = PCDCommand.PutText ("1", MEAS_K, 0)
          retval = PCDCommand.PutText ("4", MEAS_RADIUS, 0)
          retval = PCDCommand.PutText (TorID & "_MAJOR_DIA", ID, 0)
          retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
          Result = PCDCommand.SetExpression("GETTEXT(34,0,{" & TorID & "})/2", THEO_RADIUS, 0)
          Result = PCDCommand.SetExpression("GETTEXT(29,0,{" & TorID & "})/2", MEAS_RADIUS, 0)
          Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
          Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
          Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
          Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
          Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
          Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
          Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
          Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
          Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
          Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
          Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
          Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
          Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
          PCDCommand.ReDraw
          PCDPartProgram.RefreshPart
          
          Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
          PCDCommand.Marked = True
          retval = PCDCommand.PutText ("0", THEO_X, 0)
          retval = PCDCommand.PutText ("0", THEO_Y, 0)
          retval = PCDCommand.PutText ("0", THEO_Z, 0)
          retval = PCDCommand.PutText ("0", THEO_X2, 0)
          retval = PCDCommand.PutText ("0", THEO_Y2, 0)
          retval = PCDCommand.PutText ("0", THEO_Z2, 0)
          retval = PCDCommand.PutText ("0", THEO_I, 0)
          retval = PCDCommand.PutText ("0", THEO_J, 0)
          retval = PCDCommand.PutText ("1", THEO_K, 0)
          retval = PCDCommand.PutText ("1", THEO_RADIUS, 0)
          retval = PCDCommand.PutText ("0", MEAS_X, 0)
          retval = PCDCommand.PutText ("0", MEAS_Y, 0)
          retval = PCDCommand.PutText ("0", MEAS_Z, 0)
          retval = PCDCommand.PutText ("0", MEAS_X2, 0)
          retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
          retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
          retval = PCDCommand.PutText ("0", MEAS_I, 0)
          retval = PCDCommand.PutText ("0", MEAS_J, 0)
          retval = PCDCommand.PutText ("1", MEAS_K, 0)
          retval = PCDCommand.PutText ("1", MEAS_RADIUS, 0)
          retval = PCDCommand.PutText (TorID & "_MINOR_DIA", ID, 0)
          retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
          retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
          Result = PCDCommand.SetExpression("GETTEXT(920,0,{" & TorID & "})/2", THEO_RADIUS, 0)
          Result = PCDCommand.SetExpression("GETTEXT(921,0,{" & TorID & "})/2", MEAS_RADIUS, 0)
          Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
          Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
          Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
          Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
          Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
          Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
          Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
          Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
          Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
          Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
          Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
          Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
          Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
          PCDCommand.ReDraw
          PCDPartProgram.RefreshPart
          End If
          
          '***** Cleanup
          Set PCDApp = Nothing
          Set PCDPartPrograms = Nothing
          Set PCDPartProgram = Nothing
          Set PCDCommands = Nothing
          Set prbhit = Nothing
          '*****
          
          End Sub
          Last edited by neil.challinor; 11-27-2020, 09:13 AM.
          Neil Challinor
          PC-DMIS Product Owner

          T: +44 870 446 2667 (Hexagon UK office)
          E: [email protected]

          Comment


          • #6
            Neil,
            Using Feature Location to dimension a Torus with PC-DMIS 2020R2.

            Major diameter will use D = Prints the Diameter value. For an ellipse, this is the minor diameter value (same as H).
            Minor diameter will use L = Prints the Length (used for cylinder, cones, slots, and ellipses). For an ellipse, L gives you the major diameter value.

            Example:
            Feature name: B59_FTR1_NA
            Number of Hits: 9
            X NOM: 10.47
            Y NOM: 4.0599999
            Z NOM: 1.065
            I NOM: 0
            J NOM: 0
            K NOM: 1

            Major diameter: 1
            Minor diameter: .025

            Torus Feature:

            B59_FTR1_NA=FEAT/TORUS,CARTESIAN,OUT,LEAST_SQR
            THEO/<10.47,4.06,1.065>,<0,0,1>,1,0.25
            ACTL/<10.47,4.06,1.065>,<0,0,1>,1,0.25
            MEAS/TORUS,9
            HIT/BASIC,NORMAL,<11.0079,4.0713,0.9459>,<0.3042198,0. 0064118,-0.9525803>,<11.0079,4.0713,0.9459>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.1968,4.5106,0.943>,<-0.1120234,0.1847493,-0.9763803>,<10.1968,4.5106,0.943>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.2249,3.5957,0.9425>,<-0.093443,-0.1770078,-0.9797636>,<10.2249,3.5957,0.9425>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.191,3.5183,1.0043>,<-0.4003217,-0.7773822,-0.4852004>,<10.191,3.5183,1.0043>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.7306,3.5103,1.0026>,<0.3712332,-0.7829796,-0.4991281>,<10.7306,3.5103,1.0026>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<11.085,4.0751,1.0165>,<0.9212788,0.0 225539,-0.3882482>,<11.085,4.0751,1.0165>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.7746,4.5906,1.0091>,<0.4454284,0. 7757954,-0.4469173>,<10.7746,4.5906,1.0091>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<10.1346,4.5726,1.0106>,<-0.4931183,0.7535034,-0.4348183>,<10.1346,4.5726,1.0106>,USE THEO=YES
            MOVE/CIRCULAR
            HIT/BASIC,NORMAL,<9.8566,4.0382,1.0133>,<-0.9099092,-0.0322755,-0.4135499>,<9.8566,4.0382,1.0133>,USE THEO=YES
            ENDMEAS/

            Issue found when dimensioning the Major and Minor diameter:
            Using 2020R2 when I select the Torus feature within the Feature Location dialog window the D axis will be displayed in the Status Window.
            When I created the feature dimension for the torus I found the D axis is missing and the L axis nominal set at 0.
            I have too manually add the D axis to the dimension and add the nominal to the L axis.​​​​​​​

            Example is missing the D axis and the L axis nominal is 0.
            DIM 059_01= LOCATION OF TORUS B59_FTR1_NA UNITS=IN ,$
            GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
            AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
            X 10.4700 0.0050 0.0050 10.4700 0.0000 0.0000 ----#----
            Y 4.0600 0.0050 0.0050 4.0600 0.0000 0.0000 ----#----
            Z 1.0650 0.0050 0.0050 1.0650 0.0000 0.0000 ----#----
            L 0.0000 0.0050 0.0050 0.2500 0.2500 0.2450 -------->
            END OF DIMENSION 059_01

            Example is the D axis and the L axis nominal 0.250 added to dimension.
            DIM 059_01= LOCATION OF TORUS B59_FTR1_NA UNITS=IN ,$
            GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
            AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
            X 10.4700 0.0050 0.0050 10.4700 0.0000 0.0000 ----#----
            Y 4.0600 0.0050 0.0050 4.0600 0.0000 0.0000 ----#----
            Z 1.0650 0.0050 0.0050 1.0650 0.0000 0.0000 ----#----
            D 1.0000 0.0050 0.0050 1.0000 0.0000 0.0000 ----#----
            L 0.250 0.0050 0.0050 0.2500 0.2500 0.2450 -------->
            END OF DIMENSION 059_01


            Comment


            • #7
              Neil,
              I added generic features for the outer and inner diameter to your script. Pcdmis Feature Location cannot dimension this directly from the Torus.

              Code:
              'Part 1:
              '================================================= ==========================
              ' Report torus
              '
              ' lists all Torus features In measurement routine And gives the Option To report minor And major diameters
              '
              ' attach this script To a custom icon On the toolbar And Each time the icon is clicked it will display the dialogue
              '
              '================================================= ==========================
              
              Sub Main()
              Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand
              Dim PCDFeatCmd
              Dim prbhit
              Dim numhits As Integer
              
              Set PCDApp = CreateObject("PCDLRN.Application")
              Set PCDPartPrograms = PCDApp.PartPrograms
              Set PCDPartProgram = PCDApp.ActivePartProgram
              Set PCDCommands = PCDPartProgram.Commands
              
              Dim cmd As Object
              Dim Fcntr As Integer
              Dim FeatureList$(999)
              
              Dim TorID,TX, TY, TZ, TI, TJ, TK, TD, TMD As String
              Dim MX, MY, MZ, MI, MJ, MK, MD, MMD As String
              
              '***** Predialog START
              Fcntr = 0
              ' Enumerate commands
              For Each cmd In PCDCommands
              ' 200 = Measured (learned) torus feature
              If cmd.Type = 200 Then
              FeatureList(Fcntr) = cmd.ID
              Fcntr = Fcntr + 1
              End If
              Next cmd
              '*****
              
              '***** Dialog START
              Begin Dialog DIALOG_1 31,48, 172, 141, "Point Extraction"
              ListBox 68,8,96,128, FeatureList$(), .ListBox
              PushButton 8,80,52,12, "Create", .PointsBtn
              PushButton 8,120,52,12, "Cancel", .CancelBtn
              End Dialog
              
              Dim Dlg1 As DIALOG_1
              button = Dialog(Dlg1)
              ' button 1 = create selected
              ' button 2 = Cancel selected
              '*****
              
              '***** Generic feature generation
              
              If button = 1 Then
              Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox))
              Set PCDFeatCmd = PCDCommand.FeatureCommand
              TorID=PCDCommand.id
              
              ' Get X, Y, Z, major diameter & minor diameter from selected torus & feed into generic circles
              
              Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
              PCDCommand.Marked = True
              retval = PCDCommand.PutText ("0", THEO_X, 0)
              retval = PCDCommand.PutText ("0", THEO_Y, 0)
              retval = PCDCommand.PutText ("0", THEO_Z, 0)
              retval = PCDCommand.PutText ("0", THEO_X2, 0)
              retval = PCDCommand.PutText ("0", THEO_Y2, 0)
              retval = PCDCommand.PutText ("0", THEO_Z2, 0)
              retval = PCDCommand.PutText ("0", THEO_I, 0)
              retval = PCDCommand.PutText ("0", THEO_J, 0)
              retval = PCDCommand.PutText ("1", THEO_K, 0)
              retval = PCDCommand.PutText ("4", THEO_RADIUS, 0)
              retval = PCDCommand.PutText ("0", MEAS_X, 0)
              retval = PCDCommand.PutText ("0", MEAS_Y, 0)
              retval = PCDCommand.PutText ("0", MEAS_Z, 0)
              retval = PCDCommand.PutText ("0", MEAS_X2, 0)
              retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
              retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
              retval = PCDCommand.PutText ("0", MEAS_I, 0)
              retval = PCDCommand.PutText ("0", MEAS_J, 0)
              retval = PCDCommand.PutText ("1", MEAS_K, 0)
              retval = PCDCommand.PutText ("4", MEAS_RADIUS, 0)
              retval = PCDCommand.PutText (TorID & "_MAJOR_DIA", ID, 0)
              retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
              Result = PCDCommand.SetExpression("GETTEXT(34,0,{" & TorID & "})/2", THEO_RADIUS, 0)
              Result = PCDCommand.SetExpression("GETTEXT(29,0,{" & TorID & "})/2", MEAS_RADIUS, 0)
              Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
              Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
              Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
              Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
              Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
              Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
              Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
              Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
              Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
              Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
              Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
              Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
              Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
              PCDCommand.ReDraw
              PCDPartProgram.RefreshPart
              
              Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
              PCDCommand.Marked = True
              retval = PCDCommand.PutText ("0", THEO_X, 0)
              retval = PCDCommand.PutText ("0", THEO_Y, 0)
              retval = PCDCommand.PutText ("0", THEO_Z, 0)
              retval = PCDCommand.PutText ("0", THEO_X2, 0)
              retval = PCDCommand.PutText ("0", THEO_Y2, 0)
              retval = PCDCommand.PutText ("0", THEO_Z2, 0)
              retval = PCDCommand.PutText ("0", THEO_I, 0)
              retval = PCDCommand.PutText ("0", THEO_J, 0)
              retval = PCDCommand.PutText ("1", THEO_K, 0)
              retval = PCDCommand.PutText ("1", THEO_RADIUS, 0)
              retval = PCDCommand.PutText ("0", MEAS_X, 0)
              retval = PCDCommand.PutText ("0", MEAS_Y, 0)
              retval = PCDCommand.PutText ("0", MEAS_Z, 0)
              retval = PCDCommand.PutText ("0", MEAS_X2, 0)
              retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
              retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
              retval = PCDCommand.PutText ("0", MEAS_I, 0)
              retval = PCDCommand.PutText ("0", MEAS_J, 0)
              retval = PCDCommand.PutText ("1", MEAS_K, 0)
              retval = PCDCommand.PutText ("1", MEAS_RADIUS, 0)
              retval = PCDCommand.PutText (TorID & "_MINOR_DIA", ID, 0)
              retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
              retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
              Result = PCDCommand.SetExpression("GETTEXT(920,0,{" & TorID & "})/2", THEO_RADIUS, 0)
              Result = PCDCommand.SetExpression("GETTEXT(921,0,{" & TorID & "})/2", MEAS_RADIUS, 0)
              Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
              Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
              Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
              Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
              Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
              Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
              Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
              Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
              Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
              Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
              Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
              Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
              Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
              PCDCommand.ReDraw
              PCDPartProgram.RefreshPart

              Comment


              • #8
                Code:
                'Part 2:
                
                Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
                PCDCommand.Marked = True
                retval = PCDCommand.PutText ("0", THEO_X, 0)
                retval = PCDCommand.PutText ("0", THEO_Y, 0)
                retval = PCDCommand.PutText ("0", THEO_Z, 0)
                retval = PCDCommand.PutText ("0", THEO_X2, 0)
                retval = PCDCommand.PutText ("0", THEO_Y2, 0)
                retval = PCDCommand.PutText ("0", THEO_Z2, 0)
                retval = PCDCommand.PutText ("0", THEO_I, 0)
                retval = PCDCommand.PutText ("0", THEO_J, 0)
                retval = PCDCommand.PutText ("1", THEO_K, 0)
                retval = PCDCommand.PutText ("1", THEO_RADIUS, 0)
                retval = PCDCommand.PutText ("0", MEAS_X, 0)
                retval = PCDCommand.PutText ("0", MEAS_Y, 0)
                retval = PCDCommand.PutText ("0", MEAS_Z, 0)
                retval = PCDCommand.PutText ("0", MEAS_X2, 0)
                retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
                retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
                retval = PCDCommand.PutText ("0", MEAS_I, 0)
                retval = PCDCommand.PutText ("0", MEAS_J, 0)
                retval = PCDCommand.PutText ("1", MEAS_K, 0)
                retval = PCDCommand.PutText ("1", MEAS_RADIUS, 0)
                retval = PCDCommand.PutText (TorID & "_OUTER_DIA", ID, 0)
                retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
                Result = PCDCommand.SetExpression("GETTEXT(920,0,{" & TorID & "})/2+" & TorID &"." & "TRAD" & " ", THEO_RADIUS, 0)
                Result = PCDCommand.SetExpression("GETTEXT(921,0,{" & TorID & "})/2+" & TorID &"." & "RAD" & " ", MEAS_RADIUS, 0)
                Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
                Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
                Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
                Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
                Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
                Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
                Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
                Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
                Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
                Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
                Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
                Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
                Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
                PCDCommand.ReDraw
                PCDPartProgram.RefreshPart
                
                Set PCDCommand = PCDCommands.Add(GENERIC_CONSTRUCTION, True)
                PCDCommand.Marked = True
                retval = PCDCommand.PutText ("0", THEO_X, 0)
                retval = PCDCommand.PutText ("0", THEO_Y, 0)
                retval = PCDCommand.PutText ("0", THEO_Z, 0)
                retval = PCDCommand.PutText ("0", THEO_X2, 0)
                retval = PCDCommand.PutText ("0", THEO_Y2, 0)
                retval = PCDCommand.PutText ("0", THEO_Z2, 0)
                retval = PCDCommand.PutText ("0", THEO_I, 0)
                retval = PCDCommand.PutText ("0", THEO_J, 0)
                retval = PCDCommand.PutText ("1", THEO_K, 0)
                retval = PCDCommand.PutText ("1", THEO_RADIUS, 0)
                retval = PCDCommand.PutText ("0", MEAS_X, 0)
                retval = PCDCommand.PutText ("0", MEAS_Y, 0)
                retval = PCDCommand.PutText ("0", MEAS_Z, 0)
                retval = PCDCommand.PutText ("0", MEAS_X2, 0)
                retval = PCDCommand.PutText ("0", MEAS_Y2, 0)
                retval = PCDCommand.PutText ("0", MEAS_Z2, 0)
                retval = PCDCommand.PutText ("0", MEAS_I, 0)
                retval = PCDCommand.PutText ("0", MEAS_J, 0)
                retval = PCDCommand.PutText ("1", MEAS_K, 0)
                retval = PCDCommand.PutText ("1", MEAS_RADIUS, 0)
                retval = PCDCommand.PutText (TorID & "_INNER_DIA", ID, 0)
                retval = PCDCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, COORD_TYPE, 0)
                retval = PCDCommand.SetToggleString (1, INOUT_TYPE, 0)
                Result = PCDCommand.SetExpression("GETTEXT(920,0,{" & TorID & "})/2+" & TorID &"." & "TRAD" & "/2 ", THEO_RADIUS, 0)
                Result = PCDCommand.SetExpression("GETTEXT(921,0,{" & TorID & "})/2+" & TorID &"." & "RAD" & "/2 ", MEAS_RADIUS, 0)
                Result = PCDCommand.SetExpression("GETTEXT(7,0,{" & TorID & "})", THEO_X, 0)
                Result = PCDCommand.SetExpression("GETTEXT(8,0,{" & TorID & "})", THEO_Y, 0)
                Result = PCDCommand.SetExpression("GETTEXT(9,0,{" & TorID & "})", THEO_Z, 0)
                Result = PCDCommand.SetExpression("GETTEXT(16,0,{" & TorID & "})", THEO_I, 0)
                Result = PCDCommand.SetExpression("GETTEXT(17,0,{" & TorID & "})", THEO_J, 0)
                Result = PCDCommand.SetExpression("GETTEXT(18,0,{" & TorID & "})", THEO_K, 0)
                Result = PCDCommand.SetExpression("GETTEXT(22,0,{" & TorID & "})", MEAS_X, 0)
                Result = PCDCommand.SetExpression("GETTEXT(23,0,{" & TorID & "})", MEAS_Y, 0)
                Result = PCDCommand.SetExpression("GETTEXT(24,0,{" & TorID & "})", MEAS_Z, 0)
                Result = PCDCommand.SetExpression("GETTEXT(25,0,{" & TorID & "})", MEAS_I, 0)
                Result = PCDCommand.SetExpression("GETTEXT(26,0,{" & TorID & "})", MEAS_J, 0)
                Result = PCDCommand.SetExpression("GETTEXT(27,0,{" & TorID & "})", MEAS_K, 0)
                Result = PCDCommand.SetExpression("GETTEXT(40,0,{" & TorID & "})",INOUT_TYPE,0)
                PCDCommand.ReDraw
                PCDPartProgram.RefreshPart
                End If
                
                '***** Cleanup
                Set PCDApp = Nothing
                Set PCDPartPrograms = Nothing
                Set PCDPartProgram = Nothing
                Set PCDCommands = Nothing
                Set prbhit = Nothing
                '*****
                
                End Sub
                Last edited by davehocum; 11-30-2020, 11:41 AM.

                Comment


                • #9
                  davehocum , I'm not sure I understand your last post correctly?

                  I added generic features for the outer and inner diameter to your script
                  My script already creates generic features that represent the major and minor torus diameters.

                  Pcdmis Feature Location cannot dimension this directly from the Torus
                  This was precisely the reason for my script in the first place.
                  Neil Challinor
                  PC-DMIS Product Owner

                  T: +44 870 446 2667 (Hexagon UK office)
                  E: [email protected]

                  Comment


                  • #10
                    I added the largest outer and the smallest inner diameter. I have measured a boss feature with the top edge radius of the boss intersecting the surface the boss extrudes from. The print will ask for the dimension of the diameter of the boss. This feature illustrated here is what I used for the Torus example.

                    Torus to measure boss.png

                    Comment


                    • #11
                      Neil,
                      Sorry, I realize I didn't Thank you for the script you posted. It will simplify the dimensioning a Torus feature.
                      Thank you.

                      Comment

                      Related Topics

                      Collapse

                      Working...
                      X