# How to get the names of inherited projects of the actively running project on a client?

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-the-names-of-inherited-projects-of-the-actively-running-project-on-a-client/40437>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [November 9, 2020, 7:46am UTC](https://forum.inductiveautomation.com/t/how-to-get-the-names-of-inherited-projects-of-the-actively-running-project-on-a-client/40437 "2020-11-09T07:46:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 9, 2020, 5:59pm UTC](https://forum.inductiveautomation.com/t/how-to-get-the-names-of-inherited-projects-of-the-actively-running-project-on-a-client/40437/3 "2020-11-09T17:59:04Z")

</div>

Thanks Paul!

This walks through each project and pulls out the styles as dictionaries with:

- projectName
- styleFullPath (directory filepath)
- styleParentPath (relative-to-project path, excluding style name)
- styleName (just the name of the style; styleParentPath + ‘/’ + styleName = the full path to the style for Ignition purposes)

The relevant part of the code to this topic is:

```auto
from com.inductiveautomation.ignition.gateway import IgnitionGateway
context = IgnitionGateway.get()
projectMgr = context.getProjectManager()
projectMfst = projectMgr.getProjectManifests()
projectName = system.project.getProjectName()
projectMfst[projectName].getParent() # this is the name of the inherited project of the active project

```

This is the full script:

```auto
def findFolderStyles(projectName, folderPath):
		import os
		import sys
		styles = []
		for root, subdirs, files in os.walk(folderPath):
			if 'resource.json' in files:
				styles.append({'projectName':projectName,
							   'styleFullPath':str(root), # this is the full directory path to the style in Windows
							   'styleParentPath':'/'.join(root.replace(folderPath,'').split('\\')[:-1]), # gets the Perspective Style path used in Ignition, excluding the style name itself 
							   'styleName':str(root.split('\\')[-1])
							   })
		return styles
	
	def findProjectStyles(projectName):
		projectParentFolder = "C:\\Program Files\\Inductive Automation\\Ignition\\data\\projects\\"
		styleClassesRelPath = "\\com.inductiveautomation.perspective\\style-classes\\"
	
		styleClassFullPath = '%s%s%s' % (projectParentFolder, projectName, styleClassesRelPath)
		
		return findFolderStyles(projectName, styleClassFullPath)
	
	def findRelevantProjectStyles():
		from com.inductiveautomation.ignition.gateway import IgnitionGateway
		context = IgnitionGateway.get()
		projectMgr = context.getProjectManager()
		projectMfst = projectMgr.getProjectManifests()
		projectName = system.project.getProjectName()
		
		styles = []
		# get the Perspective Styles defined in the current project
		styles.extend(findProjectStyles(projectName))
		
		while projectMfst[projectName].getParent() != '':
			# get the parent project
			projectName = projectMfst[projectName].getParent()
			# get the Perspective Styles defined in the parent project 
			styles.extend(findProjectStyles(projectName))
		return styles
	
	styles = findRelevantProjectStyles()
	udtInstances = styles
	self.getChild("FlexRepeater").props.instances = udtInstances

```

 ![Perspective Styles Lister](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/0/e0bac7ed09b7e73b5ad7f803cd3b4240c9a51ffd.gif)

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-get-the-names-of-inherited-projects-of-the-actively-running-project-on-a-client/40437)._
