hexagon logo

Editing Features/Constructed Features Inside Loop Array?

Hello All,

Fairly new to loops in PCdmis and hoping someone can shed some light on this.

I have a simple loop setup to go through 2 parts. I found (through some extensive searching) that I can change which part is being dimensioned by adding a "[1]" or "[2]" to the feature being dimensioned.
If I add "[1]" to Point1 it will call up Point1 on Part 1. As seen in the code here:

DIM DIM1= LOCATION OF POINT POINT [1] UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH
AX MEAS NOMINAL +TOL -TOL DEV OUTTOL
X 19.969 20.000 0.050 0.050 -0.031 0.000 -#-------
Y 19.996 20.000 0.050 0.050 -0.004 0.000 ----#----
Z 0.005 0.000 0.050 0.050 0.005 0.000 ----#----
T 0.005 0.000 0.050 0.050 0.005 0.000 ----#----
END OF DIMENSION DIM1​

This works great, and I can add the bracketed numbers to each dimension to individually edit them. My question is: How do I do the same thing, but actually edit the feature itself, instead of just the measurement of it?

TLDR: I want to edit a single instance of a feature in a looping program without affecting the other instances of it. Is that possible?
  • I'm presuming you want to remeasure as that feature is often out of spec and/or method isn't reliable enough to pass it all the time?
    --If you are dumping all your dimension outputs within the end of the loop: you can assess which ones are OOS and prompt operator with the option to remeasure the OOS features.
    --If you are immediately dimensioning your features after measuring each feature, you can assess each feature for OOS and prompt operator with option to remeasure the oos feature.
    --If you are dimensioning outside of the loop, respectfully speaking, you are making a mistake in your methodology.

    here's how i assess if a part on an 8 cavity fixture is OOS and inform operators which one it is. (it was on a fixture that was pretty easy to put parts in too far, which i've since fixed).
    COMMENT/REPT,
    
    RECALL/ALIGNMENT,INTERNAL,A8_1
    $$ NO,
    This section evaluates if any of the first 8 samples fail, and will flag the auditor with a comment. If comment isn't responded to within 30 seconds, it will
    automatically continue, prompting to load samples 9-16. If responded with "NO", program will cancel without any Measurlink output,
    but will still output all data for cavities 1-8 to the C:\ drive location.
    ASSIGN/OT1=SUM(ARRAY(AA_1.D.OUTTOL <> 0, AB1_1.M.OUTTOL <> 0, AB2_1.M.OUTTOL <> 0, AB3_1.M.OUTTOL <> 0, AC1_1.M.OUTTOL <> 0, AC2_1.M.OUTTOL <> 0, AC3_1.M.OUTTOL <> 0, AD_1.D.OUTTOL <> 0, AE_1.M.OUTTOL <> 0, AF_1.M.OUTTOL <> 0))
    ASSIGN/OT2=SUM(ARRAY(AA_2.D.OUTTOL <> 0, AB1_2.M.OUTTOL <> 0, AB2_2.M.OUTTOL <> 0, AB3_2.M.OUTTOL <> 0, AC1_2.M.OUTTOL <> 0, AC2_2.M.OUTTOL <> 0, AC3_2.M.OUTTOL <> 0, AD_2.D.OUTTOL <> 0, AE_2.M.OUTTOL <> 0, AF_2.M.OUTTOL <> 0))
    ASSIGN/OT3=SUM(ARRAY(AA_3.D.OUTTOL <> 0, AB1_3.M.OUTTOL <> 0, AB2_3.M.OUTTOL <> 0, AB3_3.M.OUTTOL <> 0, AC1_3.M.OUTTOL <> 0, AC2_3.M.OUTTOL <> 0, AC3_3.M.OUTTOL <> 0, AD_3.D.OUTTOL <> 0, AE_3.M.OUTTOL <> 0, AF_3.M.OUTTOL <> 0))
    ASSIGN/OT4=SUM(ARRAY(AA_4.D.OUTTOL <> 0, AB1_4.M.OUTTOL <> 0, AB2_4.M.OUTTOL <> 0, AB3_4.M.OUTTOL <> 0, AC1_4.M.OUTTOL <> 0, AC2_4.M.OUTTOL <> 0, AC3_4.M.OUTTOL <> 0, AD_4.D.OUTTOL <> 0, AE_4.M.OUTTOL <> 0, AF_4.M.OUTTOL <> 0))
    ASSIGN/OT5=SUM(ARRAY(AA_5.D.OUTTOL <> 0, AB1_5.M.OUTTOL <> 0, AB2_5.M.OUTTOL <> 0, AB3_5.M.OUTTOL <> 0, AC1_5.M.OUTTOL <> 0, AC2_5.M.OUTTOL <> 0, AC3_5.M.OUTTOL <> 0, AD_5.D.OUTTOL <> 0, AE_5.M.OUTTOL <> 0, AF_5.M.OUTTOL <> 0))
    ASSIGN/OT6=SUM(ARRAY(AA_6.D.OUTTOL <> 0, AB1_6.M.OUTTOL <> 0, AB2_6.M.OUTTOL <> 0, AB3_6.M.OUTTOL <> 0, AC1_6.M.OUTTOL <> 0, AC2_6.M.OUTTOL <> 0, AC3_6.M.OUTTOL <> 0, AD_6.D.OUTTOL <> 0, AE_6.M.OUTTOL <> 0, AF_6.M.OUTTOL <> 0))
    ASSIGN/OT7=SUM(ARRAY(AA_7.D.OUTTOL <> 0, AB1_7.M.OUTTOL <> 0, AB2_7.M.OUTTOL <> 0, AB3_7.M.OUTTOL <> 0, AC1_7.M.OUTTOL <> 0, AC2_7.M.OUTTOL <> 0, AC3_7.M.OUTTOL <> 0, AD_7.D.OUTTOL <> 0, AE_7.M.OUTTOL <> 0, AF_7.M.OUTTOL <> 0))
    ASSIGN/OT8=SUM(ARRAY(AA_8.D.OUTTOL <> 0, AB1_8.M.OUTTOL <> 0, AB2_8.M.OUTTOL <> 0, AB3_8.M.OUTTOL <> 0, AC1_8.M.OUTTOL <> 0, AC2_8.M.OUTTOL <> 0, AC3_8.M.OUTTOL <> 0, AD_8.D.OUTTOL <> 0, AE_8.M.OUTTOL <> 0, AF_8.M.OUTTOL <> 0))
    ASSIGN/WHATCAV=IF(OT1<>0,"#1, ","")+IF(OT2<>0,"#2, ","")+IF(OT3<>0,"#3, ","")+IF(OT4<>0,"#4, ","")+IF(OT5<>0,"#5, ","")+IF(OT6<>0,"#6, ","")+IF(OT7<>0,"#7, ","")+IF(OT8<>0,"#8, ","")
    IF/SUM(ARRAY(OT1,OT2,OT3,OT4,OT5,OT6,OT7,OT8)) == 0
    GOTO/CONTINUEOUTPUT
    END_IF/
    ELSE/
    OOT1NOTE =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
    "Part(s) in fixture location(s) " + WHATCAV + " = out of tolerance. "
    "Continue Program for samples 9-16 (as applies)? "
    "Click YES to continue, or "
    "Click NO to end routine. "
    " --If no, data will NOT be sent to Measurlink."
    IF_GOTO/OOT1NOTE.INPUT=="NO",GOTO = END
    IF_GOTO/OOT1NOTE.INPUT=="YES",GOTO = CONTINUEOUTPUT
    END_ELSE/
    CONTINUEOUTPUT =LABEL
    


    you could modify this to asses which dim is out of spec and use flow controls (labels and if_goto or if/, operator comment, goto, /endif) before each feature to go back and remeasure that dim.

    --or respectfully speaking, you could improve the method to more robustly/repeatably measure that feature that isn't reproduceable.
  • I appreciate the input. This whole process is more for running ghost than it is having an operator to manage errors. The idea was to set and forget overnight and be able to rerun the less measurable/repeatable features in the morning. This is good info though. Thank you.
  • Paste w/ Pattern is a built-in feature with PC-DMIS, so that is not a bad practice. Just be sure to have an indexable value at the end of every feature you are copy/pasting to prevent archaic naming from occurring to your freshly pasted features. (I add '_1' to every feature/alignment I plan to use paste w/ pattern on, if reporting/constructing features later in the program, it is now very easy to find which points go together to build/report)

    I suppose in rereading this, you could potentially store the alignment for part1 as an 'external' alignment, then save part2 as another 'external' alignment, using the flow control (IF/ENDIF) you can manage which alignment should be used and recall them explicitly. I believe this would enable you to remeasure a scan, but it would cause a restructure of your current program.

    Loop processes do not lend themselves to be helpful when you need to rerun a specific feature for anything other than the last unit.

    IF_GOTO/lables can enable you to jump through your program isolating only the data you need to remeasure. This could be something to speed up your over-checks, but it takes a great deal of forethought and architecture in your program.



    One last question if anyone happens to check back in this thread:

    I am trying to Paste With Pattern specific features within my loop and have been having a lot of trouble.

    So to start I construct a circle from a linear closed scan.
    From this circle I need to place a line in the Z Plus direction so I can create a Pierce Point with the a Cylinder.

    I've done this in two ways, first with a Cast Line from the Circle > Reverse Line from that Cast Line > Pierce Point of Cylinder and Reverse Line.

    The second way was: Offset Circle from Original Circle > Line from Circle to Circle > Pierce Point of Cylinder and Line.

    Now the strange thing is that this process works, either way, UNTIL I Copy and Paste With Pattern. After that the ORIGINAL feature construction stops working. I get either the "Math Failed" or "Unsupported Feature Combination" Error.

    I would expect this to occur on the duplicated code, but not the original. Any ideas? This is a paste with pattern without any offset.
  • Are the names updating properly? Where the constructions are occurring, are the same number of features being utilized?
    How did you name your features, did you add something like "_1" to the end of each feature you are trying to pattern, or give it some type of countable index value?
    Do you have proper workplanes set for your construction vs the pattern? (Pattern paste could require Z workplane, while feature construction could need X/Y workplane)
    Sharing a sample of the code might aid with some advice that gets your goal completed faster.
  • Are the names updating properly? Where the constructions are occurring, are the same number of features being utilized?
    How did you name your features, did you add something like "_1" to the end of each feature you are trying to pattern, or give it some type of countable index value?
    Do you have proper workplanes set for your construction vs the pattern? (Pattern paste could require Z workplane, while feature construction could need X/Y workplane)
    Sharing a sample of the code might aid with some advice that gets your goal completed faster.


    Oof as much as it pains me to admit, it looks like there was a naming problem. I do change workplanes inside each Paste With Pattern segment, so I thought it was that. But after testing with/without workplanes it appears that it was the naming all along.

    Well I'm glad it was the simple solution that fixed it. Thanks for your help.
  • From what I recall, any kind of utilized reference outside of the pattern, during paste with pattern, will redirect itself to the latest iteration of the pattern.
    IE: if you had a FEAT_ID_1.X.MEAS referenced in an assign function outside of the pattern, it will automatically re-associate itself with FEAT_ID_3.X.MEAS if your pattern was pasted with a value of 2x.

    so yeah any/all references to patterned features, should be intricately evaluated each time you paste with pattern.
  • Sometimes, it's all about the 'little' things.