Your Products have been synced, click here to refresh
I think this (^^^) would be the easiest in the long run. However, if you had to extract the sample hits something like this could work...
CYL6 =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR THEO/<0,0,0>,<0,0,1>,0.5,0.375 ACTL/<0,0,0>,<0,0,1>,0.5,0.375 TARG/<0,0,0>,<0,0,1> START ANG=0,END ANG=360 ANGLE VEC=<1,0,0> DIRECTION=CCW REPORT VEC=<0.2706061,0.653305,0.707082> SHOW FEATURE PARAMETERS=NO SHOW CONTACT PARAMETERS=YES NUMHITS=6,NUMLEVELS=2,DEPTH=0.2,END OFFSET=1,PITCH=0 SAMPLE METHOD=SAMPLE_HITS SAMPLE HITS=3,SPACER=0.25 AVOIDANCE MOVE=BOTH,DISTANCE=0.375 FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO SHOW HITS=NO ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CYL6}) ASSIGN/V2=GETTEXT("SAMPLE_HIT_THEO_Y",1,{CYL6}) ASSIGN/V3=GETTEXT("SAMPLE_HIT_THEO_Z",1,{CYL6}) ASSIGN/V4=GETTEXT("SAMPLE_HIT_THEO_I",1,{CYL6}) ASSIGN/V5=GETTEXT("SAMPLE_HIT_THEO_J",1,{CYL6}) ASSIGN/V6=GETTEXT("SAMPLE_HIT_THEO_K",1,{CYL6}) ASSIGN/V7=GETTEXT("SAMPLE_HIT_MEAS_X",1,{CYL6}) ASSIGN/V8=GETTEXT("SAMPLE_HIT_MEAS_Y",1,{CYL6}) ASSIGN/V9=GETTEXT("SAMPLE_HIT_MEAS_Z",1,{CYL6}) F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$ NOM/XYZ,<V1,V2,V3>,$ MEAS/XYZ,<V7,V8,V9>,$ NOM/IJK,<V4,V5,V6>,$ MEAS/IJK,<V4,V5,V6> DIM LOC1= LOCATION OF POINT F1 UNITS=IN ,$ GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO AX NOMINAL +TOL -TOL MEAS DEV OUTTOL X 0.5000 0.0020 -0.0020 0.5000 0.0000 0.0000 ----#---- Y 0.0000 0.0020 -0.0020 0.0000 0.0000 0.0000 ----#---- Z 0.0000 0.0020 -0.0020 0.0000 0.0000 0.0000 ----#---- END OF DIMENSION LOC1
This only gets the first sample hit. You would need to repeat as needed for whatever number of sample hits you have. Just increment the index number ( "1" in this case and immediately before the feature label reference). Seems like a lot of work though.
'***** Live Generic Sample Point Generation Fcntr = 0 If button = 3 Then Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) Set PCDFeatCmd = PCDCommand.FeatureCommand numhits = PCDFeatCmd.PermHits Set prbhit = CreateObject("PCDLRN.PointData") For Fcntr = 1 To numhits ' Get the probehits - XYZ Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP) gX = CDbl(prbhit.X) gY = CDbl(prbhit.Y) gZ = CDbl(prbhit.Z) ' Get the probehits - IJK Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP) gI = CDbl(prbhit.X) gJ = CDbl(prbhit.Y) gK = CDbl(prbhit.Z) ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602 ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517 ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597 ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 Set cmd = PCDCommands.Add(597, True) cmd.Marked = True 'ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CIR14}) 'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1 'retval = cmd.PutText (PCDCommand.ID & "_F" & Fcntr, ID, 0) retval = cmd.PutText (PCDCommand.ID & "_SG" & Fcntr, ID, 0) 'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0) 'pName = PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]." pName = PCDCommand.ID ' Theo's retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_X""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_X, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Y""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Y, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Z""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Z, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_I""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_I, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_J""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_J, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_K""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_K, 0) ' Actl's retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_X""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_X, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Y""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Y, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Z""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Z, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_I""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_I, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_J""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_J, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_K""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_K, 0) PCDPartProgram.RefreshPart cmd.ReDraw Next MsgBox "Live Generic Sample Point Generation Complete" End If '*******
I think this (^^^) would be the easiest in the long run. However, if you had to extract the sample hits something like this could work...
CYL6 =FEAT/CONTACT/CYLINDER/DEFAULT,CARTESIAN,IN,LEAST_SQR THEO/<0,0,0>,<0,0,1>,0.5,0.375 ACTL/<0,0,0>,<0,0,1>,0.5,0.375 TARG/<0,0,0>,<0,0,1> START ANG=0,END ANG=360 ANGLE VEC=<1,0,0> DIRECTION=CCW REPORT VEC=<0.2706061,0.653305,0.707082> SHOW FEATURE PARAMETERS=NO SHOW CONTACT PARAMETERS=YES NUMHITS=6,NUMLEVELS=2,DEPTH=0.2,END OFFSET=1,PITCH=0 SAMPLE METHOD=SAMPLE_HITS SAMPLE HITS=3,SPACER=0.25 AVOIDANCE MOVE=BOTH,DISTANCE=0.375 FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO SHOW HITS=NO ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CYL6}) ASSIGN/V2=GETTEXT("SAMPLE_HIT_THEO_Y",1,{CYL6}) ASSIGN/V3=GETTEXT("SAMPLE_HIT_THEO_Z",1,{CYL6}) ASSIGN/V4=GETTEXT("SAMPLE_HIT_THEO_I",1,{CYL6}) ASSIGN/V5=GETTEXT("SAMPLE_HIT_THEO_J",1,{CYL6}) ASSIGN/V6=GETTEXT("SAMPLE_HIT_THEO_K",1,{CYL6}) ASSIGN/V7=GETTEXT("SAMPLE_HIT_MEAS_X",1,{CYL6}) ASSIGN/V8=GETTEXT("SAMPLE_HIT_MEAS_Y",1,{CYL6}) ASSIGN/V9=GETTEXT("SAMPLE_HIT_MEAS_Z",1,{CYL6}) F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$ NOM/XYZ,<V1,V2,V3>,$ MEAS/XYZ,<V7,V8,V9>,$ NOM/IJK,<V4,V5,V6>,$ MEAS/IJK,<V4,V5,V6> DIM LOC1= LOCATION OF POINT F1 UNITS=IN ,$ GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO AX NOMINAL +TOL -TOL MEAS DEV OUTTOL X 0.5000 0.0020 -0.0020 0.5000 0.0000 0.0000 ----#---- Y 0.0000 0.0020 -0.0020 0.0000 0.0000 0.0000 ----#---- Z 0.0000 0.0020 -0.0020 0.0000 0.0000 0.0000 ----#---- END OF DIMENSION LOC1
This only gets the first sample hit. You would need to repeat as needed for whatever number of sample hits you have. Just increment the index number ( "1" in this case and immediately before the feature label reference). Seems like a lot of work though.
'***** Live Generic Sample Point Generation Fcntr = 0 If button = 3 Then Set PCDCommand = PCDCommands.Item(FeatureList(Dlg1.Listbox)) Set PCDFeatCmd = PCDCommand.FeatureCommand numhits = PCDFeatCmd.PermHits Set prbhit = CreateObject("PCDLRN.PointData") For Fcntr = 1 To numhits ' Get the probehits - XYZ Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_CENTROID, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP) gX = CDbl(prbhit.X) gY = CDbl(prbhit.Y) gZ = CDbl(prbhit.Z) ' Get the probehits - IJK Set prbhit = PCDFeatCmd.GetSampleHit(Fcntr, FHITDATA_VECTOR, FDATA_THEO, FDATA_PART, AlignID, PLANE_TOP) gI = CDbl(prbhit.X) gJ = CDbl(prbhit.Y) gK = CDbl(prbhit.Z) ' Create Vector points feature "AUTO__VECTOR_HIT" (COMMAND INFORMATION CODE edit screen) 602 ' Create Cast points feature "CONST__CAST_POINT" (COMMAND INFORMATION CODE edit screen) 517 ' Create Generic points feature "GENERIC_CONSTUCTION" (COMMAND INFORMATION CODE edit screen) 597 ' Create Constructed Feature Set "CONST__SET" (COMMAND INFORMATION CODE edit screen) 596 Set cmd = PCDCommands.Add(597, True) cmd.Marked = True 'ASSIGN/V1=GETTEXT("SAMPLE_HIT_THEO_X",1,{CIR14}) 'Featurename is "sourcefeaturename-hitnumber" -> PLANE1-1 'retval = cmd.PutText (PCDCommand.ID & "_F" & Fcntr, ID, 0) retval = cmd.PutText (PCDCommand.ID & "_SG" & Fcntr, ID, 0) 'Result = cmd.SetExpression (PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]" , REF_ID, 0) 'pName = PCDCommand.ID & "." & "HIT" & "[" & Fcntr & "]." pName = PCDCommand.ID ' Theo's retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_X""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_X, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Y""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Y, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_Z""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_Z, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_I""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_I, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_J""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_J, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_THEO_K""," & Fcntr & "," & "{" & pName & "}" & ")", THEO_K, 0) ' Actl's retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_X""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_X, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Y""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Y, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_Z""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_Z, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_I""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_I, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_J""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_J, 0) retval = cmd.SetExpression("GETTEXT(""SAMPLE_HIT_MEAS_K""," & Fcntr & "," & "{" & pName & "}" & ")", MEAS_K, 0) PCDPartProgram.RefreshPart cmd.ReDraw Next MsgBox "Live Generic Sample Point Generation Complete" End If '*******
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |