Jump to content

Get start alignment?


---
 Share

Recommended Posts

I wrote:
//Force people to slowdown and check the alignment if it's not correct for any reason.
alignment_check = true
correct_alignment = "StartAlignmentName(Start)"

if not((getStartSetting("baseSystemRealName") == correct_alignment)) then
	alignment_check = confirm("Incorrect alignment, or "+chr(34)+"Current Alignment"+chr(34)+" selected!"+cr()+cr()+"The correct alignment is:	"+correct_alignment+cr()+cr()+"Pressing Yes will continue with the current settings ***DANGER OF COLLISION**"+cr()+cr()+"No will cancel and allow you to correct the alignment")
endif

if not(alignment_check == true) then
	cncBreak()
endif
is there a PCM function that will pull the proper start alignment name? so I can replace this:

correct_alignment = "StartAlignmentName(Start)"

With a variable instead of typing the right alignment into each program?

getStartSetting("baseSystemRealName") pull the currently selected one from the Run menu, so that's half of what I need, now I need to compare that value to the proper setting.
Link to comment
Share on other sites

If you haven't re-named your alignment system manually it should be the same as name of the program and you can try this:
correct_alignment = getRecordHead("planid") + "(Start)"
So if your inspection plan is called

MyPart_01

above line returns

MyPart_01(Start)
Link to comment
Share on other sites

Please sign in to view this quote.

They are renamed manually as the Start Alignments are shared among programs, so I need a way to pull the actual one that I define in the Base/Start Alignment window.
Link to comment
Share on other sites

if baseSystem().machine.inspection.hasStartSystem
	correct_alignment = baseSystem().machine.inspection.startSystemTaskAndElement.value.defBaseSystem.nameOfBaseSystem

	if getStartSetting("baseSystemRealName") <> correct_alignment
		if not(confirm(getStartSetting("baseSystemRealName")+" selected!"+cr()+cr()+"The correct alignment is: "+correct_alignment+cr()+cr()+"Pressing Yes will continue with the current settings ***DANGER OF COLLISION**"+cr()+cr()+"No will cancel and allow you to correct the alignment"))
			endInspection()
		endif
	endif
endif
Link to comment
Share on other sites

 Share

×
×
  • Create New...