Oasys.THIS.Page class

Static methods

classmethod Page.AddGraph(page_number, graph_number=Oasys.gRPC.defaultArg, graph_number_to_copy_properties_from=Oasys.gRPC.defaultArg, number_of_graphs=Oasys.gRPC.defaultArg)

Adds one or more graphs to the specified page

Parameters:
  • page_number (integer) – Page number to add graph(s) to

  • graph_number (integer) – Optional. Graph number to add to page. If this argument is 0 or not given, a new graph is created

  • graph_number_to_copy_properties_from (integer) – Optional. If the second argument is 0, this specifies which graph to copy properties from when creating new graphs

  • number_of_graphs (integer) – Optional. If the second argument is 0, this specifies the number of new graphs to create and add to the specified page

Returns:

True if the graph was added, False if failed

Return type:

bool

Example

To add graph 1 to page 2

Oasys.THIS.Page.AddGraph(2,1)
classmethod Page.CreatePage()

Creates Page

Returns:

Boolean

Return type:

bool

Example

Add new page

Oasys.THIS.Page.CreatePage()
classmethod Page.DeletePage(page_number)

Deletes Page

Parameters:

page_number (integer) – The page number which needs to be deleted

Returns:

String

Return type:

str

Example

Delete page 2

Oasys.THIS.Page.DeletePage(2)
classmethod Page.GetPageFromName(page_name)

Retrieves the id of a page from it’s name

Parameters:

page_name (integer) – The page name for which the page id will be retrieved

Returns:

Integer

Return type:

int

Example

Retrieve the id of page name

Oasys.THIS.Page.GetPageFromName("name")
classmethod Page.GetPageName(page_number)

Retrieves the name of a page

Parameters:

page_number (integer) – The page number for which the name will be retrieved

Returns:

String

Return type:

str

Example

Retrieve the name of page 2

Oasys.THIS.Page.GetPageName(2)
classmethod Page.Layout(page_number, layout, num_in_x=Oasys.gRPC.defaultArg, num_in_y=Oasys.gRPC.defaultArg)

Sets the layout of either all pages or a specified page

Parameters:
  • page_number (integer) – Page number for which to set layout. If this argument is 0 then layout will be set on all pages individually. If -1 then the layout will be set globally, as in the ‘Graphs’ panel

  • layout (String or Integer) – Layout specifier. Options are: “wide” or 1 - Tile wide, “tall” or 2 - Tile tall, “1x1” or 3 - 1x1, “2x2” or 4 - 2x2, “3x3” or 5 - 3x3, “xy” or 6 - XxY

  • num_in_x (integer) – Optional. Number of graphs in X-direction if user-defined XxY layout (6)

  • num_in_y (integer) – Optional. Number of graphs in Y-direction if user-defined XxY layout (6)

Returns:

True if the layout was set, False if failed

Return type:

bool

Example

To set the layout of page 1 to ‘Tile tall’

Oasys.THIS.Page.Layout(1,"tall")
classmethod Page.MaxAllowable()

Returns the maximum number of pages allowed. Useful because this differs between linked and unlinked T/HIS and can be used to check before trying to reference a page number that may be out-of-range

Returns:

Integer

Return type:

int

Example

To find the maximum allowable number of pages in T/HIS:

maxPages = Oasys.THIS.Page.MaxAllowable()
classmethod Page.RemoveGraph(page_number, graph_number=Oasys.gRPC.defaultArg, lower_end_of_range_for_removing_graphs=Oasys.gRPC.defaultArg, upper_end_of_range_for_removing_graphs=Oasys.gRPC.defaultArg)

Remove one or more graphs from the specified page

Parameters:
  • page_number (integer) – Page number to remove the graph from

  • graph_number (integer) – Optional. Graph number to remove from page. If this argument is 0 or not given, the highest number graph on the page will be removed. If this argument is -1, all graphs will be removed

  • lower_end_of_range_for_removing_graphs (integer) – Optional. If the second argument is 0, this specifies the lower end of the range for removing graphs. All graphs with numbers within the specified range will be removed from the page

  • upper_end_of_range_for_removing_graphs (integer) – Optional. If the second argument is 0, this specifies the upper end of the range for removing graphs. All graphs with numbers within the specified range will be removed from the page. If this argument is not given then it will be set to the maximum number of graphs by default

Returns:

True if the graph was removed, False if failed

Return type:

bool

Example

To remove any graph with number between 2 and 6 from page 3

Oasys.THIS.Page.RemoveGraph(3,0,2,6)
classmethod Page.ReturnActivePage()

Returns the current active page in T/HIS

Returns:

integer

Return type:

int

Example

To return the current active page

p = Oasys.THIS.Page.ReturnActivePage()
classmethod Page.ReturnGraphs(page_number)

Returns the graphs on the specified page as a list of Graph objects

Parameters:

page_number (integer) – Page number for which to return the graphs it contains

Returns:

List of Graph objects

Return type:

list

Example

To return the graphs on page 2

Oasys.THIS.Page.ReturnGraphs(2)
classmethod Page.SetActivePage(page_number)

Sets the current active page in T/HIS, returning false if the page does not exist

Parameters:

page_number (integer) – Page number to set to active page

Returns:

True if the page was set, False if the page does not exist

Return type:

bool

Example

To set the current active page to 2

Oasys.THIS.Page.SetActivePage(2)
classmethod Page.SetPageName(page_number, page_name)

Sets the Name of a Page

Parameters:
  • page_number (integer) – The page number for which the name will be set

  • page_name (string) – The name to assign to the page

Returns:

Boolean

Return type:

bool

Example

To remove name on page 2

Oasys.THIS.Page.SetPageName(2,"")
classmethod Page.Total()

Returns the total number of pages

Returns:

integer

Return type:

int

Example

To find how many pages there are in T/HIS:

num = Oasys.THIS.Page.Total()