Jump to content

Bulk Point Inspection App


---
 Share

Recommended Posts

---

Hello ya'll,

I was in need of a tool to mass create inspection points. I am using Zeiss Correlate on Photogrammetry data. I am using target markers. My projects all contain around 20 components, and the total target count is ~250. I could not find a way to get XYZ position data without creating inspection points, and I could not find a way to mass create these points through the Correlate program, so I created this app.

I hope this helps someone else. If you know of something I could improve, or an easier way to achieve this - I am open to suggestions. I get the feeling that there is a button somewhere in the program for this already, because it seems like this would be a useful feature. Thank you!
 

import gom

array1 = gom.app.project.actual_elements
array1 = sorted(array1, key=lambda e: str(e))    

# Constructs and their number of points must be the same between projects, otherwise inspection point numbering will differ.

for name in array1:
    if str(name) == "gom.app.project.actual_elements['actual_master']":
        continue
    if str(name) == "gom.app.project.actual_elements['all_measurement_series']":
        continue
    if str(name) == "gom.app.project.actual_elements['all_reference_points']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 0']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 1']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 2']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 3']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 4']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 5']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 6']":
        continue
    if str(name) == "gom.app.project.actual_elements['Analog input 7']":
        continue
    if "Point" in str(name):
        print("Operation Complete. Ending Script.")
        break
    print(name)
    print(name.data.coordinate.shape[1])    
    points_total = name.data.coordinate.shape[1]
    for x in range(points_total):
        if name.data.coordinate[0][1] is not None:
            try:
                MCAD_ELEMENT=gom.script.inspection.inspect_by_point (point={'id': x, 'target': name, 'type': 'coded'})
            except Exception as e:
                print(f"Skipping {name}: {e}")
            continue

Link to comment
Share on other sites

---

I would suggest to place a keyword into that element so you can then make for cycle where you scan all elements for your keyword ( it will fail, when there is no such keyword, so place it into TRY/EXCEPT, with "pass" in exception )

Now you don't need to manually place names into condition

  • Like! 1
Link to comment
Share on other sites

---

You should just be able to select the point component & File-Export-StageData-CSV
image.thumb.png.d0ea21b03db7089d24499c2f46c7367b.png
image.thumb.png.e4f65291d51df1132c4d3d3af3a3da6f.png

  • Like! 1
Link to comment
Share on other sites

  • 2 weeks later...

Appreciate the info! Is there a way to export that way using the local coordinate system?

Please sign in to view this quote.

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...