hexagon logo

Dimensioning with Variables

Hello!
PC-DMIS 2013 MR1, Optiv Perf. 443
-------------------------------------------------

Basically, I have a cylindrical part in a rotary table. I take a few hits with a touch probe to align, and make some measurements for some notches.
After this I switch to the camera
The rotation of the part is dependent on the rotation vector of a specific hole.
Due to the leveling features available to me, this hole is either on one side or the other of the part.
Using the camera, I measure the location. If the hole is not there (using OnError) it rotates 180° and tries again.
If all goes well it continues measuring and dimensions everything.

--------------------------------------------------
The question I have pertains specifically to the relationship between the notches and the holes;
I start measuring the notches at Rotab Angle 0. But what if the hole is reversed, at 180?
Now the notches and holes that share the same name (notch_XXX_45, hole_xxx_45) are 180° apart!
Hole_xxx_0 and Notch_xxx_180 are at the same angle!

Essentially I want to add in some tidbits to fix that.
I originally had the program where I would measure some stuff on the part with a probe, then switch to the camera to measure the holes,
then switch back to the probe to measure the notches from the hole alignment, keeping everything together.
Personally I do not like this, I would rather switch probes as little as possible.
We have a rack, so it is not a huge deal, but I did spend all day reworking the program to only change once...

Regardless, I was looking for some ideas on how I would go about this

I have all of the necessary features using a naming convention like above.

I would assume I could get the feature name, get all the characters (from right to left) up to the first underscore (which would give me the degree of rotation of that feature)
[I like that idea]
Then if the number is >= 180, subtract 180, or if its <= 135, add 180 to the name.
This would theoretically "flip" the numbers in the name and report them correctly.

To put it together:
If the hole is at 0, it will output hole 0 and notch 0 instead of hole 0 and notch 180
If the hole is at 180, it will output hole 180 and notch 180, instead of hole 180 and notch 0
--------------------------------------------------------------------------------------------------------
Is this possible?
  • So you are looking to create feature names that are dependent on variable outputs? it's black magic, but should work in theory.

    What I would do instead however is fix your alignment structure, so it doesn't end up flipping randomly 180° out of phase.
    One thing I've noticed when making rotation datum alignments based upon a feature on a cylindrical part, is if your initial alignment is located -.00001 about the initial alignment it will flip your vectors 180 degrees. To fix this random flipping, create a line from cylinder axis out to whatever feature you are rotating to, then rotate X+ or Y+ to that line. Do not rotate to the feature measured on its own.
  • You'll have to measure twice, but something like this? (Note - I was setup to a 90° so I evaluated Y, you could evaluate X, or do some other calculation:

    FIRST_MEASURE=FEAT/CONTACT/CIRCLE/DEFAULT,POLAR,IN,LEAST_SQR
                THEO/<0.05,90,0>,<0,-1,0>,4.4997
                ACTL/<0.05,90,0>,<0,-1,0>,4.4997
                TARG/<0.05,90,0>,<0,-1,0>
                START ANG=5,END ANG=5
                ANGLE VEC=<1,0,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=YES
                  NUMHITS=12,DEPTH=0,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=0,SPACER=0.25
                  AVOIDANCE MOVE=NO,DISTANCE=0.375
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
               ASSIGN/V2=IF(FIRST_MEASURE.Y>0,"NOTCH_90_45","NOTCH_270_45")
    V2         =FEAT/CONTACT/CIRCLE/DEFAULT,POLAR,IN,LEAST_SQR
                THEO/<0.05,90,0>,<0,-1,0>,4.4997
                ACTL/<0.05,90,0>,<0,-1,0>,4.4997
                TARG/<0.05,90,0>,<0,-1,0>
                START ANG=5,END ANG=5
                ANGLE VEC=<1,0,0>
                DIRECTION=CCW
                SHOW FEATURE PARAMETERS=NO
                SHOW CONTACT PARAMETERS=YES
                  NUMHITS=12,DEPTH=0,PITCH=0
                  SAMPLE METHOD=SAMPLE_HITS
                  SAMPLE HITS=0,SPACER=0.25
                  AVOIDANCE MOVE=NO,DISTANCE=0.375
                  FIND HOLE=DISABLED,ONERROR=NO,READ POS=NO
                SHOW HITS=NO
    DIM DIM_1= LOCATION OF CIRCLE V2  UNITS=IN ,$
    GRAPH=OFF  TEXT=OFF  MULT=10.00  OUTPUT=BOTH  HALF ANGLE=NO
    AX    NOMINAL       +TOL       -TOL       MEAS        DEV     OUTTOL
    PR      0.0500     0.0020     0.0020     0.0500     0.0000     0.0000 ----#----
    PA     90.0000     0.0004     0.0004    90.0000     0.0000     0.0000 ----#----
    D       4.4997     0.0020     0.0020     4.4997     0.0000     0.0000 ----#----
    END OF DIMENSION DIM_1
  • Thanks for the input louisd!

    That's not exactly what I'm looking for. I already have all of the features created, but I want to be able to choose if I'm using the feature at 0° or the feature at 180°.
    There is no "random flipping"; I use onerror statements to check for the presence of a hole, and if it is not there it must be on the other side. It would be the same as if I knew the hole was at 180° so before I measure it I rotate 180°, all the OnError is doing is finding out where the hole is, at 0 or 180, and I measure off of this feature.

    The operator comments in my program state to align slots upright. There are 4 slots at two different angles (0 and 180). Meaning the operator could line up the slots at 0 OR the slots at 180. So I level to one or the other; the hole could be on the side up or the side down. I needed to make a program to account for this.

    When aligning the slots upright I construct a plane from one. This I level to, and is made Notch_XXX_0
    From there I measure the notch, rotate 45° and repeat up to 315°. Then I switch to the camera and rotate to 0°. I check the presence of the notch, and rotate to it.
    This is labeled Hole_xxx_0.

    So the Notch at 0° is Notch_XXX_0, but the hole at 0° is Hole_XXX_180

    I would like to have something where if the hole is at 180, use Notch_XXX_180 instead of Notch_XXX_0, for each 45° increment of rotation.

    Hopefully this makes sense
  • The problem I am having is not the construction of the hole. The OnError works and works well, the dimensions are fine, alignments are fine. I just want to programmatically choose which feature is getting dimensioned when.
    I wish this was easier to explain lol

    I like the idea. Can you explain a little more whats going on?
  • Would I be able to set a variable to a string that matches the name of a specific feature, and dimension the variable?
    E.g.
    DIM LOC1= LOCATION OF CIRCLE V1 .....
    

    Where V1="Notch_XXX_0"
  • The IF() statement is three parts - the statement to evaluate, what to set the variable to if TRUE, what to set the variable to if FALSE. On a 90° hole, the Y value will be positive, if 270 it will be negative. So I check to see if it's positive, if yes, then set the variable V2 to indicate a 90. If it's negative, it's at 270, so the variable is changed. In your case, if it's reading 0°, X should be positive, if it's negative it's at 180°.

    Then I remeasure the same feature but assign it the variable name. When you do so, the software will ask if you're referring to an input variable, you answer yes. Fact is, however, I could have just constructed the feature from the previously measured hits

    You also change the dimension to the same variable.
  • That's what this does

    ASSIGN/V2=IF(FIRST_MEASURE.Y>0,"NOTCH_90_45","NOTCH_270_45")
  • So I have proceded to change pretty much everything to variables.
    I created variables for the feature names, and changed every feature to these variables (IF(IS_180==0,"<Hole is at 0>","<Hole is at 180>")

    I created variables for the alignments (because if a hole at 45 is actually at 225, but the alignment is for 45...)
    I have the names of the alignments their static names.
    I RECALL the alignments using their corresponding variables

    And it doesn't work. Once I run the program it runs fine, but upon completion it hangs and does not let me interact.
    If I move the CMM I can see the Probe Readout window changing its numbers, but I can't click anything or type.
    Strangely, if I, for example, hit CTRL+F, I can access the Vector Point dialog box. ALT+F3 is still search, but I cant actually click or do anything, even close PC-DMIS!

    If I open up Task Manager and end the process, it prompts me with the "End Now?" BS Windows does, saying "We are unable to close this program because it is waiting for a response from you". If I click cancel I am able to continue

    This happens when I try to print the report. Thoughts?