Component/Container |
---|
Method/Property | Description | Example |
---|
.children | Returns all of the component's children. | |
.getChildren() | Functionally similar to ".children" above. | |
.parent | Calling this property will move up the component hierarchy, accessing the parent container of the preceding object. Root containers will return the view, and views/sessions will return None. | |
.getParent() | Functionally similar to ".parent" above. | |
.getChild(string) | Method that looks for a child component of a given name. Returns None if not found. String can either be the name of a child object, or a path to an object delimited by a forward slash, allowing you to move through multiple items in the hierarchy in a single call. |
self.getChild('Label_0')
self.getChild('Container/Label_0')
|
.getSibling(string) | Returns a reference to an object in the same container that the source component is located in. Similar to calling self.parent.getChild('component'). | |
.view | Calling this from anywhere within a view will return the parent view of the object. | |
.getView() | A method that will return the view, similar to ".view" above. | |
.page | Returns a page object associated with the page the current component is on. .close() can be called on the page object, and can accept a message string as a parameter. |
page = self.page
pageID = page.props.pageId
pagePath = page.props.path
|
.getPage() | A method that will return the page, similar to ".page" above. | |
.session | Returns the current Perspective Session you are in. From this object you can get any of the existing properties of the Session, including custom properties. See the Session Objects sub table for more details.
|
session = self.session
sesName = session.props.gateway.address
sesProp = session.custom.propertyName
|
.getSession() | A method that will return the session, similar to ".session" above. | |
Session Objects |
---|
.close() or .close(message) | When called will close the session. Optionally accepts a string message which will be displayed after the session closes. |
session = self.getSession()
session.close("The session has now closed")
|
.getInfo() | Returns a PyJsonObjectAdapter object, which is functionally similar to a Python Dictionary. The object contain the same keys described on the system.perspective.getSessionInfo page.
|
self.session.getInfo()["pageIds"]
|
.getPages() | Returns a list of page objects. | |
.getPage(ID) | Returns the page associated with the given string ID parameter, if it exists. Page ID values can be determined with the .getInfo() method. |
self.session.getPage("2b2eb647")
|
.getProjectInfo() |
The following feature is new in Ignition version 8.1.4
Click here to check out the other new features
Returns a dictionary of project meta data, including name, title, description, lastModified, lastModifiedBy, views, and pageConfigs.
|
self.session.getProjectInfo()
|
View Objects |
---|
.rootContainer | Returns the root container of the View. | |
.id | Returns a string that uniquely identifies the view instance. For example:
Perspective/Views/path/to/view yields path/to/view@C | |
.session | Returns the current Perspective Session you are in. From this object you can get any of the existing properties of the Session, including custom properties. See the Session Objects sub table for more details. |
session = view.session
sesName = session.gateway.address
sesProp = session.custom.propertyName
|