Jump to content

absence or presence of feature?


---
 Share

Recommended Posts

Hi Everyone,

Somebody asked me if I could check if a clip on a plastic part is present or not.  This would be for a production line inspection every two hours.  Is there an easy way to do this?  I can create a 'surface point' on the relevant clip and check for deviation in distance.  Then I can give the check an arbitrary tolerance.  But if the clip is missing I get a result like this --> '???'.  I'm really looking for a 'Fail' statement if there is no scan surface data at the relevant location, and a 'Pass' statement if there is.

I'm running GOM Inspect 2018.  Any ideas?

Link to comment
Share on other sites

Hi Aaron,

it is possible to define the output for invalid values in the preferences. This will be shown instead of '???':

image.thumb.png.32ba5e51c4097f69fbb046c29934ff43.png

For a 'Pass' statement, you could alter the expression in the VDA table template for example, to show abritary text. ('valid' in my example):

image.thumb.png.4351e1f6cbc3c607a03f8e12119fb956.png

 

In the QDAS export with the new QDAS certified App (needs Inspect 2025 though) the output can be defined in the configuration for example, if the results are exported.

Nanno

Link to comment
Share on other sites

Let me give you this scenario:

Let's say there are like 20 to 30 checks for a production line inspection for a single part.  I can have all these checks listed in a table in a pdf report.  And then an operator can run the inspection using Kiosk mode and get the report with that table of inspection results.  But often I think it is better to have one statement of GO/NO-GO that indicates whether all the checks passed, or if one or more failed.  Is there an easy way to implement that?

Link to comment
Share on other sites

Yes, it is possible to count invalid elements and define an output if more than one element is invalid. 

There is a keyword for "Number of computed elements" for example, which is used in the Result label of an annotation (inspection -> annotation). 

Link to comment
Share on other sites

Here is an example with the used keywords from the "Result" label of the annotation:

image.thumb.png.c654f053862eb7dd07d291f2fea3d1ba.png

 

Expression:

#@ Calculation status
ok = format ('OK' , "+98.11", show_unit=false, color=color ("#13d373ff"))
nok = format ('NOK', "+98.11", show_unit=false, color=color ("#ff0000ff"))
if project_statistics.all.total_number != project_statistics.all.number_of_computed:
	return nok
else:
	return ok

The name of the keyword is a bit misleading: it works for visible elements, so it has to be placed in a 3D view with all elements visible (visible means the eye symbol in the explorer is checked).

Link to comment
Share on other sites

That's a nice label.

You said the keywords  project_statistics.all.total_number  and  project_statistics.all.number_of_computed  are only operating on visible elements.  That's interesting, I did not know that.  What if the equivalent project statistics element values were used in a GOM python script?  For example, is  gom.app.project.project_statistics.all.number_of_computed  aware of the present 3d view and the visible elements when it is called in a python script?

Link to comment
Share on other sites

Yes, it seems to work the same in scripting.

I think you would chose a different approach in scripting. The elements can be checked directly for computation status, for example:

gom.app.project.inspection['A'].computation_status

This would be done for all inspections. In a similar request there was a fail rate calculated for inspection elements in the kiosk and then a qdas key was set accordingly.

# -*- coding: utf-8 -*-
import gom


k0002_treshold = 40
k0002_value = '255'


all_elements = gom.ElementSelection ({'category': ['key', 'elements', 'part', gom.app.project.parts[0], 'explorer_category', 'inspection']})
failed_elements = []

for i in all_elements:
	if i.computation_status == 'partly_not_computed' or i.computation_status == 'not_computed':	
		failed_elements.append(i)
	
number_nok_elements = len(failed_elements)
number_all_elements = len(all_elements)

print(number_all_elements)
print(number_nok_elements)


fail_rate = number_nok_elements/number_all_elements*100
rounded_fail_rate = round(fail_rate, 0)

print(rounded_fail_rate)



#### k0002 as project keyword
def k0002_project_keyword():
	if rounded_fail_rate >= k0002_treshold:
		gom.script.sys.set_project_keywords (
		keywords = {'qdas_k0002': k0002_value},
		keywords_description = {'qdas_k0002': 'k0002 edit'}
	)
		print('k0002 project keyword set to ' + str(k0002_value))
	else:
		print('threshold not reached, k0002 stays as defined in config')
		pass


k0002_project_keyword()

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...