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

 Share

×
×
  • Create New...