[D0019] Highlight parts that allow eddy current

 

This script highlights parts where eddy currents will be calculated.

import designer
	
app = designer.GetApplication()

def main():
	highlight_parts_that_allow_eddy_current()

def highlight_parts_that_allow_eddy_current():

	flag_name = "EddyCurrentCalculation"

	view = app.View()
	view.ClearSelect()
	sel = view.GetCurrentSelection()
	model = app.GetCurrentModel()
	study = app.GetCurrentStudy()

	part_ID_list = model.GetPartIDs()

	sel.SetBlockUpdateView(True)
	if 0 < len(part_ID_list):
		for i in range (0, len(part_ID_list)):
			flag = study.GetMaterial(part_ID_list[i]).GetValue(flag_name)
			if flag == 1 or flag == 2:
				sel.SelectPart(part_ID_list[i])
	sel.SetBlockUpdateView(False)

main()

Download Python source code

How to use script file

Use the JMAG Script Library after reading and agreeing to the following terms of use.