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.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.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 32 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 -1 if the page does not exist or the page number if it does
- 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)