Never tried looping in PCDMIS but done it a million times in MM4, I seem to get the points taken and see that I might have to use a array to find the high point, but to went to look at features measured and I do not see them. So I'm guessing again this will have to be done thru an array. What is the code or extensions that I use in my array. The 1st point is PNT2[1]. I hope this is clear. WDE
loop
Collapse
X
-
You can create a feature set after the loop with PNT2[1..xx], and then search the high point.
With an aray, you have to use the loop variable (ex : V1) and create the array by ASSIGN/V2[V1]=PNT2.Z inside the loop.
You will search the max z after the loop by ASSIGN/V3=MAX(V2) or max index.
- Likes 1
Comment
-
V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
THEO/<-0.1,0.318,-0.1>,<0,1,0>
ACTL/<-0.1,0.318,-0.1>,<0,1,0>
TARG/<-0.1,0.318,-0.1>,<0,1,0>
SNAP=NO
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
LOOP/END
HIGH =FEAT/SET,CARTESIAN
THEO/<-0.0275,0.318,-0.1>,<0,0,1>
ACTL/<-0.0275,0.3211,-0.1>,<0,0,1>
CONSTR/SET,BASIC,PNT2[1..20],,
MOVE/CLEARPLANE
I added the feature HIGH but was going to do it like below
ASSIGN/V1=ARRAY(PNT2[1].Y,PNT2[2].Y,PNT2[3].Y,PNT2[4].Y,PNT2[5].Y,PNT2[6].Y,PNT2[7].Y,PNT2[8].Y,PNT2[9].Y,PNT2[10].Y,PNT2[11].Y,PNT2[12].Y,PNT2[13].Y,PNT2[14].Y, PNT2[15].Y,PNT2[16].Y,PNT2[17].Y,PNT2[18].Y,PNT2[19].Y,PNT2[20].Y)
ASSIGN/V2=MIN(V1)
ASSIGN/V3=MAX(V1)
confused with the feature set how to retrieve the high pointsigpic
Comment
-
V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
THEO/<-0.1,0.318,-0.1>,<0,1,0>
ACTL/<-0.1,0.318,-0.1>,<0,1,0>
TARG/<-0.1,0.318,-0.1>,<0,1,0>
SNAP=NO
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
LOOP/END
HIGH =FEAT/SET,CARTESIAN
THEO/<-0.0275,0.318,-0.1>,<0,0,1>
ACTL/<-0.0275,0.3211,-0.1>,<0,0,1>
CONSTR/SET,BASIC,PNT2[1..20],,
MOVE/CLEARPLANE
ASSIGN/V2=MAX(HIGH.Y)
or
V1 =LOOP/START,ID=YES,NUMBER=20,START=1,SKIP=,
OFFSET:XAXIS=0.01,YAXIS=0,ZAXIS=0,ANGLE=0
PNT2 =FEAT/CONTACT/VECTOR POINT/DEFAULT,CARTESIAN
THEO/<-0.1,0.318,-0.1>,<0,1,0>
ACTL/<-0.1,0.318,-0.1>,<0,1,0>
TARG/<-0.1,0.318,-0.1>,<0,1,0>
SNAP=NO
SHOW FEATURE PARAMETERS=NO
SHOW CONTACT PARAMETERS=NO
ASSIGN/V2[V1]=PNT2.Y
LOOP/END
ASSIGN/V3=MAX(V2)
- Likes 2
Comment
-
Loops are both a monster to fully grasp in PcDmis and a powerhouse of a skill once tamed. Learn them here and if you every get into almost any 3rd generation code it'll be much easier.
PcDmis 2015.1 SP10 CAD++
Global 7-10-7 DC800S
- Likes 1
Comment
Related Topics
Collapse
-
by gatienHello,
It's been now several years I work with PCDMIS. I've always been able to find answer using this forum of other recourses.
I'm...-
Channel: PC-DMIS Code Samples
01-13-2022, 03:52 PM -
-
by dwworthPcdmis automatically creates an array when features are checked more than once (loop).
After reading the manual, I can only access individual readings...-
Channel: PC-DMIS for CMMs
07-30-2012, 01:42 PM -
-
by Liambo734I'm looping the code below 14 times, then trying to recall the looped dimensions into an array, but it doesn't appear to be working correctly as I'm testing...
-
Channel: PC-DMIS for CMMs
05-10-2017, 01:52 PM -
-
by ewadoraGood Morning All
I have punch with gear inside (35 teeth to make math easier) and I need to measure larger diameter.I made loop which takes...-
Channel: PC-DMIS for CMMs
07-26-2018, 11:45 AM -
-
by CORONAXRAMade a simple loop program, trying to get the text in the report to count as it loops
as follows:
C1 =comment/input,no,full...-
Channel: PC-DMIS for CMMs
02-21-2020, 01:19 PM -
Comment