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?
Parents
  • If you want independent ability to rerun aspects of your program file, it may make more sense to have individual sections of code.
    However, if you want to be able to rerun segments for part1 vs part2, you may need to look into flow control (IF_GOTO/labels). The problem you may face is that you will not rerun the scan to the identical datum pick up 1 run to the next, it should be a small amount of deviation, but it will be deviation none the less.


    Ok let me try to understand this. You say it may make more sense to have individual sections of code, do you mean actually duplicating the code for a part in the same program might be better for this? My first thought when starting to loop was "paste with pattern the entire thing" but I've always been told copying code was bad practice in software development so I figured I shouldn't.


    Would IF_GOTO/lables remedy the alignment having been overwritten/offset from the first part to the second? Just trying to wrap my head around the solution.

    Thanks.


Reply
  • If you want independent ability to rerun aspects of your program file, it may make more sense to have individual sections of code.
    However, if you want to be able to rerun segments for part1 vs part2, you may need to look into flow control (IF_GOTO/labels). The problem you may face is that you will not rerun the scan to the identical datum pick up 1 run to the next, it should be a small amount of deviation, but it will be deviation none the less.


    Ok let me try to understand this. You say it may make more sense to have individual sections of code, do you mean actually duplicating the code for a part in the same program might be better for this? My first thought when starting to loop was "paste with pattern the entire thing" but I've always been told copying code was bad practice in software development so I figured I shouldn't.


    Would IF_GOTO/lables remedy the alignment having been overwritten/offset from the first part to the second? Just trying to wrap my head around the solution.

    Thanks.


Children
No Data