Converting Scan to points but not breaking out points.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting Scan to points but not breaking out points.

    Good evening all.

    Im looking to convert scan into point data. Im not looking to do this by converting the scan into points as you can in the edit window as i want to take the scan with the SP25 scanning head.

    I've figured out a way of doing it by creating a constructed feature using the hits on the scan as its variable. i.e creating an assignment and assigning the xyz vales of that particular scan hit into the constructed feature,

    The problem being, there are 500 or so hits in each scan. I have created a counter assignment to do all the leg work for me however i am unable to create a new feature for each hit with this current counter assignment. All i seem to be getting is the same generic feature being run for each point and the program only spitting out a bracketed number for each point. Not a generic feature for each point. Any help would be appreciated.

    Hope this makes sense.

  • #2
    That makes perfect sense, just one suggestion, post your code.

    Maybe someone can just tweak what you have rather than write something from scratch.

    Comment


    • #3
      Thanks Don, This is what I have

      ASSIGN/START=3
      ASSIGN/COUNTER=START
      ASSIGN/END=200
      DO/
      ASSIGN/V3=SCN1_1.HIT[COUNTER].XYZ
      F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
      NOM/XYZ,<0,0,0>,$
      MEAS/XYZ,<V3.X,V3.Y,V3.Z>,$
      NOM/IJK,<0,0,1>,$
      MEAS/IJK,<0,0,1>
      ASSIGN/COUNTER=COUNTER+1
      UNTIL/COUNTER==END

      Comment


      • #4
        Maybe just copy / paste the scan, then convert to points ?

        Comment


        • #5
          Code:
          V1 =LOOP/START,ID=NO,NUMBER=SCAN1.NUMHITS,START=1,SKIP=,
          OFFSET:XAXIS=0,YAXIS=0,ZAXIS=0,ANGLE=0
          
          ASSIGN/FEATNAME="FEATURENAME" + V1
          
          FEATNAME =GENERIC/POINT,DEPENDENT,CARTESIAN,$
          NOM/XYZ,<SCAN1.HiT[V1].TX,SCAN1.HIT[V1].TY,SCAN1.HIT[V1].TZ>,$
          MEAS/XYZ,<SCAN1.HIT[V1].X,SCAN1.HIT[V1].Y,SCAN1.HIT[V1].Z>,$
          NOM/IJK,<0,0,1>,$
          MEAS/IJK,<0,0,1>
          
          LOOP/END

          Comment


          • #6
            Thanks,

            however the code is still not duplicating the generic feature. It still runs the one over and over.

            Originally posted by JEFMAN View Post
            Maybe just copy / paste the scan, then convert to points ?
            I think this would be fine if the program is being run once but doing so will insert auto vector points in the program, so will scan points then begin to take vector points along that scan again.
            Last edited by panelbeater1; 04-30-2020, 05:41 PM.

            Comment


            • #7
              What's wrong with F1[1]...F1[500]? Having trouble using them for construction/dimensioning purposes? It can be done... you just have to punch them in manually.
              PcDmis 2015.1 SP10 CAD++
              Global 7-10-7 DC800S

              Comment


              • #8
                You should be able to just graphically select the hits you want to use for your construction in the cad window - see my screenshot below. This functionality was added a few versions ago (2018 ish?).

                construction.png


                If you have an older version, you could try referencing the hits for the construction directly - provided you know what numbers the hits you need are...

                Code:
                PNT1 =FEAT/POINT,CARTESIAN,NO
                THEO/<95.818,21.994,-4.792>,<0.4774809,-0.2967289,0.8270211>
                ACTL/<95.818,21.994,-4.792>,<0.4774809,-0.2967289,0.8270211>
                CONSTR/POINT,CAST,SCN1.HIT[7]
                or...

                Code:
                LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                THEO/<99.908,18.932,-7.959>,<0.7374967,-0.5465979,-0.3966477>
                ACTL/<99.908,18.932,-7.959>,<0.7374967,-0.5465979,-0.3966477>
                CONSTR/LINE,BF,3D,SCN1.HIT[10..15],,
                OUTLIER_REMOVAL/OFF,3
                FILTER/OFF,WAVELENGTH=0
                for example.

                The reason that the generic point is continually re-executed and the name indexed with () is that it is in a loop. If you want to use this method but would like the feature name to increment without the () you could try handling it yourself by changing the name of your generic feature to a variable that you build within your loop. However, please be aware that the points may only be available during execution. If you try to access them when the program is not running, they might not return any data.

                Code:
                 ASSIGN/COUNTER=0
                ASSIGN/V1="MYPNT_"
                DO/
                ASSIGN/COUNTER=COUNTER+1
                ASSIGN/V2=STR(V1+COUNTER)
                V2 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
                NOM/XYZ,<SCN1.HIT[COUNETR].TX,SCN1.HIT[COUNETR].TY,SCN1.HIT[COUNETR].TZ>,$
                MEAS/XYZ,<SCN1.HIT[COUNETR].X,SCN1.HIT[COUNETR].Y,SCN1.HIT[COUNETR].Z>,$
                NOM/IJK,<SCN1.HIT[COUNETR].TI,SCN1.HIT[COUNETR].TJ,SCN1.HIT[COUNETR].TK>,$
                MEAS/IJK,<SCN1.HIT[COUNETR].I,SCN1.HIT[COUNETR].J,SCN1.HIT[COUNETR].K>
                UNTIL/COUNTER==SCN1.NUMHITS
                Neil Challinor
                PC-DMIS Product Owner

                T: +44 870 446 2667 (Hexagon UK office)
                E: [email protected]

                Comment


                • #9
                  Originally posted by neil.challinor View Post
                  Code:
                  LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<99.908,18.932,-7.959>,<0.7374967,-0.5465979,-0.3966477>
                  ACTL/<99.908,18.932,-7.959>,<0.7374967,-0.5465979,-0.3966477>
                  CONSTR/LINE,BF,3D,[COLOR=#e74c3c]SCN1.HIT[10..15][/COLOR],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
                  I've always wanted to use this.... but it never works in my version (2015.1 SP10). I have to input them individually.
                  PcDmis 2015.1 SP10 CAD++
                  Global 7-10-7 DC800S

                  Comment


                  • neil.challinor
                    neil.challinor commented
                    Editing a comment
                    I'm curious - in what way doesn't it work? You probably can't do it through the construction dialogue as for cases where the constructed feature requires more than one input you would get a calculation error. However, there is a little trick you can use to get around that problem. If you want to construct a circle for example, you would usually need to select three features - certainly for a BF or BFRE construction. If instead, you construct a CAST circle, you can then edit the command in the edit window. The CAST construction serves simply to populate the edit window with a command. Once it is there, the first thing you would do would be to edit the input feature to include your hit syntax (add on the .hit[1st hit index..last hit index]). Once you have that in place you can then change the construction type via the drop down from CAST to BF, BFRE or whatever.

                  • Kp61dude!
                    Kp61dude! commented
                    Editing a comment
                    Thanks for your suggestions neil.challinor none worked. I am one of those strange ones that refuse to use the drop down unless absolutely necessary... even if it''s faster to do so I'll still type everything in into the Edit Window. I've tried many things and it always prompts an error message, either as I'm building the constructed feature or else/also during run time. CAST doesn't cause any errors to come up but that's not what I'm looking for, as soon as I switch to BF it throws an error message "illegal number of inputs" during run time.
                    Last edited by Kp61dude!; 05-01-2020, 12:54 PM.

                • #10
                  Hi Kp61dude! , I'd really like to help you get this working as I know how frustrating it can be when thing don't go as expected. I've just tested this with 2015.1 SP10 (64 bit) on my laptop (windows 10) and I can type the command in directly from the edit window - no drop downs required - although the sequence of steps is important. I'll detail what I did below...

                  1) Measure the feature you want to reference for your construction - I used a scan but it should work for any feature. After your feature (or at whatever point you want in insert your construction) type CONST then press tab

                  Code:
                  SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                  ,SHOW HITS=NO,SHOWALLPARAMS=NO
                  MEAS/SCAN
                  BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                  ENDSCAN
                  ENDMEAS//
                  CONST
                  2) A constructed slot command will be inserted into the edit window.

                  Code:
                  SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                  ,SHOW HITS=NO,SHOWALLPARAMS=NO
                  MEAS/SCAN
                  BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                  ENDSCAN
                  ENDMEAS/
                  SLT1 =FEAT/SLOT,CARTESIAN,OUT,NO
                  THEO/<0,0,0>,<0,0,0>,0,0
                  ACTL/<0,0,0>,<0,0,0>,0,0
                  CONSTR/SLOT,ROUND,CIRCLES,,
                  3) Put the cursor on the SLOT text and change it to whatever feature you need to construct - I wanted to construct a line so I just typed L

                  Code:
                  LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<0,0,-0.5>,<0,0,1>
                  ACTL/<0,0,0>,<0,0,1>
                  CONSTR/LINE,BF,2D,,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
                  4) Here's where it gets tricky. The constructed line command defaults to a BF construction. This needs at least two input features but we only have one so we need to change the construction to a type that only requires one input feature. Put the cursor on the BF text and type C - this will change the construction type to CAST and you can now enter the input feature name between the two commas.

                  Code:
                  LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<0,0,0>,<-0.0179538,0,0.9998388>
                  ACTL/<4.9233,0,-0.0636>,<-0.0179538,0,0.9998388>
                  CONSTR/LINE,CAST,SCN1,0,DEPENDENT
                  5) put the cursor at the end of your input feature name (but before the comma) and type in HIT followed by your hit range separated by two periods and enclosed within square brackets.

                  Code:
                  LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<4.1016,0,-0.0783>,<0,0,1>
                  ACTL/<4.1016,0,-0.0783>,<0,0,1>
                  CONSTR/LINE,CAST,SCN1.HIT[23..95],0,DEPENDENT
                  6) Finally, put your cursor back on the CAST text and type in the type of construction you actually want - for example BFRE.

                  Code:
                  LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                  THEO/<3.7473,0,-0.0783>,<1,0,0>
                  ACTL/<3.7473,0,-0.0783>,<1,0,0>
                  CONSTR/LINE,BFRE,2D,SCN1.HIT[23..95],,
                  OUTLIER_REMOVAL/OFF,3
                  FILTER/OFF,WAVELENGTH=0
                  You now have your constructed feature, referencing the range of hits from your input feature. The process would be similar for multiple input features - for example creating a circle from two semi-circles. You just need to change the construction type to one that will accept the number of inputs you are going to use before referencing the feature names. Once you have your features and their hit ranges entered, you can change the construction type to the one you need.

                  Hope this helps you out, let me know if it works for you
                  Neil Challinor
                  PC-DMIS Product Owner

                  T: +44 870 446 2667 (Hexagon UK office)
                  E: [email protected]

                  Comment


                  • #11
                    Originally posted by neil.challinor View Post
                    Hi Kp61dude! , I'd really like to help you get this working as I know how frustrating it can be when thing don't go as expected. I've just tested this with 2015.1 SP10 (64 bit) on my laptop (windows 10) and I can type the command in directly from the edit window - no drop downs required - although the sequence of steps is important. I'll detail what I did below...

                    1) Measure the feature you want to reference for your construction - I used a scan but it should work for any feature. After your feature (or at whatever point you want in insert your construction) type CONST then press tab

                    Code:
                    SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                    ,SHOW HITS=NO,SHOWALLPARAMS=NO
                    MEAS/SCAN
                    BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                    ENDSCAN
                    ENDMEAS//
                    CONST
                    2) A constructed slot command will be inserted into the edit window.

                    Code:
                    SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                    ,SHOW HITS=NO,SHOWALLPARAMS=NO
                    MEAS/SCAN
                    BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                    ENDSCAN
                    ENDMEAS/
                    SLT1 =FEAT/SLOT,CARTESIAN,OUT,NO
                    THEO/<0,0,0>,<0,0,0>,0,0
                    ACTL/<0,0,0>,<0,0,0>,0,0
                    CONSTR/SLOT,ROUND,CIRCLES,,
                    3) Put the cursor on the SLOT text and change it to whatever feature you need to construct - I wanted to construct a line so I just typed L

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<0,0,-0.5>,<0,0,1>
                    ACTL/<0,0,0>,<0,0,1>
                    CONSTR/LINE,BF,2D,,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
                    4) Here's where it gets tricky. The constructed line command defaults to a BF construction. This needs at least two input features but we only have one so we need to change the construction to a type that only requires one input feature. Put the cursor on the BF text and type C - this will change the construction type to CAST and you can now enter the input feature name between the two commas.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<0,0,0>,<-0.0179538,0,0.9998388>
                    ACTL/<4.9233,0,-0.0636>,<-0.0179538,0,0.9998388>
                    CONSTR/LINE,CAST,SCN1,0,DEPENDENT
                    5) put the cursor at the end of your input feature name (but before the comma) and type in HIT followed by your hit range separated by two periods and enclosed within square brackets.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<4.1016,0,-0.0783>,<0,0,1>
                    ACTL/<4.1016,0,-0.0783>,<0,0,1>
                    CONSTR/LINE,CAST,SCN1.HIT[23..95],0,DEPENDENT
                    6) Finally, put your cursor back on the CAST text and type in the type of construction you actually want - for example BFRE.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<3.7473,0,-0.0783>,<1,0,0>
                    ACTL/<3.7473,0,-0.0783>,<1,0,0>
                    CONSTR/LINE,BFRE,2D,SCN1.HIT[23..95],,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
                    You now have your constructed feature, referencing the range of hits from your input feature. The process would be similar for multiple input features - for example creating a circle from two semi-circles. You just need to change the construction type to one that will accept the number of inputs you are going to use before referencing the feature names. Once you have your features and their hit ranges entered, you can change the construction type to the one you need.

                    Hope this helps you out, let me know if it works for you
                    for this hits, if you want to include them all, is this where you would use SCN1.HIT[1..NUMHITS] to have it use all the hits of the scan?
                    sigpic
                    Originally posted by AndersI
                    I've got one from September 2006 (bug ticket) which has finally been fixed in 2013.

                    Comment


                  • #12
                    Originally posted by neil.challinor View Post
                    Hi Kp61dude! , I'd really like to help you get this working as I know how frustrating it can be when thing don't go as expected. I've just tested this with 2015.1 SP10 (64 bit) on my laptop (windows 10) and I can type the command in directly from the edit window - no drop downs required - although the sequence of steps is important. I'll detail what I did below...

                    1) Measure the feature you want to reference for your construction - I used a scan but it should work for any feature. After your feature (or at whatever point you want in insert your construction) type CONST then press tab

                    Code:
                    SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                    ,SHOW HITS=NO,SHOWALLPARAMS=NO
                    MEAS/SCAN
                    BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                    ENDSCAN
                    ENDMEAS//
                    CONST
                    2) A constructed slot command will be inserted into the edit window.

                    Code:
                    SCN1 =FEAT/SCAN,LINEAROPEN,NUMBER OF HITS=284
                    ,SHOW HITS=NO,SHOWALLPARAMS=NO
                    MEAS/SCAN
                    BASICSCAN/LINE,NUMBER OF HITS=284,SHOW HITS=NO,SHOWALLPARAMS=NO
                    ENDSCAN
                    ENDMEAS/
                    SLT1 =FEAT/SLOT,CARTESIAN,OUT,NO
                    THEO/<0,0,0>,<0,0,0>,0,0
                    ACTL/<0,0,0>,<0,0,0>,0,0
                    CONSTR/SLOT,ROUND,CIRCLES,,
                    3) Put the cursor on the SLOT text and change it to whatever feature you need to construct - I wanted to construct a line so I just typed L

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<0,0,-0.5>,<0,0,1>
                    ACTL/<0,0,0>,<0,0,1>
                    CONSTR/LINE,BF,2D,,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
                    4) Here's where it gets tricky. The constructed line command defaults to a BF construction. This needs at least two input features but we only have one so we need to change the construction to a type that only requires one input feature. Put the cursor on the BF text and type C - this will change the construction type to CAST and you can now enter the input feature name between the two commas.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<0,0,0>,<-0.0179538,0,0.9998388>
                    ACTL/<4.9233,0,-0.0636>,<-0.0179538,0,0.9998388>
                    CONSTR/LINE,CAST,SCN1,0,DEPENDENT
                    5) put the cursor at the end of your input feature name (but before the comma) and type in HIT followed by your hit range separated by two periods and enclosed within square brackets.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<4.1016,0,-0.0783>,<0,0,1>
                    ACTL/<4.1016,0,-0.0783>,<0,0,1>
                    CONSTR/LINE,CAST,SCN1.HIT[23..95],0,DEPENDENT
                    6) Finally, put your cursor back on the CAST text and type in the type of construction you actually want - for example BFRE.

                    Code:
                    LIN1 =FEAT/LINE,CARTESIAN,UNBOUNDED,NO
                    THEO/<3.7473,0,-0.0783>,<1,0,0>
                    ACTL/<3.7473,0,-0.0783>,<1,0,0>
                    CONSTR/LINE,BFRE,2D,SCN1.HIT[23..95],,
                    OUTLIER_REMOVAL/OFF,3
                    FILTER/OFF,WAVELENGTH=0
                    You now have your constructed feature, referencing the range of hits from your input feature. The process would be similar for multiple input features - for example creating a circle from two semi-circles. You just need to change the construction type to one that will accept the number of inputs you are going to use before referencing the feature names. Once you have your features and their hit ranges entered, you can change the construction type to the one you need.

                    Hope this helps you out, let me know if it works for you
                    You're right sequence is important! Got it working, appreciate your time and expertise neil.challinor
                    PcDmis 2015.1 SP10 CAD++
                    Global 7-10-7 DC800S

                    Comment


                    • neil.challinor
                      neil.challinor commented
                      Editing a comment
                      No problem - happy to help

                  • #13
                    My tip would be to take a look at the script versions of the "to_points" function. If needed, tweak it to create constructed points from the scan of your choice. There are several iterations of it available in the custom code section and maybe one of these already does what you need.

                    Well worth a look.
                    PC-DMIS CAD++ 2o22.2 SP3

                    Comment


                    • #14
                      Thanks everyone for your help.

                      Is there any harm in creating a cast point at each point of the scan like shown below?


                      CASTPNT1 =FEAT/POINT,CARTESIAN,NO
                      THEO/<5.189,0.798,-0.2>,<0.990308,0.13,0>
                      ACTL/<5.189,0.798,-0.2>,<0.990308,0.13,0>
                      CONSTR/POINT,CAST,SCN1.HIT[1]

                      CASTPNT2 =FEAT/POINT,CARTESIAN,NO
                      THEO/<5.216,0.599,-0.2>,<0.993471,0.11,0>
                      ACTL/<5.216,0.599,-0.2>,<0.993471,0.11,0>
                      CONSTR/POINT,CAST,SCN1.HIT[2]

                      CASTPNT3 =FEAT/POINT,CARTESIAN,NO
                      THEO/<5.235,0.4,-0.2>,<0.9970954,0.0761632,0>
                      ACTL/<5.235,0.4,-0.2>,<0.9970954,0.0761632,0>
                      CONSTR/POINT,CAST,SCN1.HIT[3]

                      Comment


                      • #15
                        Originally posted by panelbeater1 View Post
                        Thanks everyone for your help.

                        Is there any harm in creating a cast point at each point of the scan like shown below?


                        CASTPNT1 =FEAT/POINT,CARTESIAN,NO
                        THEO/<5.189,0.798,-0.2>,<0.990308,0.13,0>
                        ACTL/<5.189,0.798,-0.2>,<0.990308,0.13,0>
                        CONSTR/POINT,CAST,SCN1.HIT[1]

                        CASTPNT2 =FEAT/POINT,CARTESIAN,NO
                        THEO/<5.216,0.599,-0.2>,<0.993471,0.11,0>
                        ACTL/<5.216,0.599,-0.2>,<0.993471,0.11,0>
                        CONSTR/POINT,CAST,SCN1.HIT[2]

                        CASTPNT3 =FEAT/POINT,CARTESIAN,NO
                        THEO/<5.235,0.4,-0.2>,<0.9970954,0.0761632,0>
                        ACTL/<5.235,0.4,-0.2>,<0.9970954,0.0761632,0>
                        CONSTR/POINT,CAST,SCN1.HIT[3]
                        I do this every day. It's a pain in the neck to do it for each and every point, but it can be done. We do freeform scans on a surface, but need individual point info at certain locations. Easy peasy.

                        Comment

                        Related Topics

                        Collapse

                        Working...
                        X