Oasys.D3PLOT.GraphicsWindow class¶
Constants¶
Properties¶
- property GraphicsWindow.active: boolean¶
Whether the graphics window is active or not (equivalent to turning the window off/on in the GUI)
- property GraphicsWindow.models: integer¶
The total number of models in this graphics window
- property GraphicsWindow.number: integer¶
The graphics window number
- property GraphicsWindow.state: integer¶
The current state displayed in this graphics window. Also see the Model
state
- property GraphicsWindow.states: integer¶
The highest state number from all models in this graphics window
Constructor¶
- classmethod GraphicsWindow(*model)¶
Creates a new graphics window in D3PLOT
- Parameters:
model (Model object) – The model to open in this graphics window This argument can be repeated if required. Alternatively a single array argument containing the multiple values can be given
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To create a graphics window containing
Model
m in D3PLOTgw = Oasys.D3PLOT.GraphicsWindow(m)
Static methods¶
- classmethod GraphicsWindow.First()¶
Returns the GraphicsWindow object for the first graphics window in D3PLOT (or None if there are no graphics windows)
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To get the GraphicsWindow object for the first graphics window:
gw = Oasys.D3PLOT.GraphicsWindow.First()
- classmethod GraphicsWindow.GetFromID(graphics_window_number)¶
Returns the GraphicsWindow object for a graphics window ID (or None if graphics window does not exist)
- Parameters:
graphics_window_number (integer) – number of the graphics window you want the GraphicsWindow object for
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To get the GraphicsWindow object for graphics window number 1
gw = Oasys.D3PLOT.GraphicsWindow.GetFromID(1)
- classmethod GraphicsWindow.Last()¶
Returns the GraphicsWindow object for the last graphics window in D3PLOT (or None if there are no graphics windows)
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To get the GraphicsWindow object for the last graphics window:
gw = Oasys.D3PLOT.GraphicsWindow.Last()
- classmethod GraphicsWindow.Total()¶
Returns the total number of graphics windows in use in D3PLOT
- Returns:
Total number of graphics windows
- Return type:
integer
Example
To get total number of graphics windows:
total = Oasys.D3PLOT.GraphicsWindow.Total()
Instance methods¶
- GraphicsWindow.AddModel(model)¶
Adds a model to a graphics window
- Parameters:
model (Model object) – The model to add to the graphics window
- Returns:
No return value
- Return type:
None
Example
To add model m to graphics window gw in D3PLOT
gw.AddModel(m)
- GraphicsWindow.Delete()¶
Deletes a graphics window in D3PLOT
Do not use the GraphicsWindow object after calling this method
- Returns:
No return value
- Return type:
None
Example
To delete graphics window gw in D3PLOT
gw.Delete()
- GraphicsWindow.GetModelInfo(index)¶
Gets the information for a model in a graphics window
- Parameters:
index (integer) – index of the model in the graphics window you want information for (0 <= index <
models
)- Returns:
Dict with properties
- colour:
(
Colour
) The colour for the model- mode:
(constant) How the model is model is displayed in the graphics window. One of
View.WIRE
,View.HIDDEN
,View.SHADED
orView.CURRENT
- model:
(Model object) The model at the given index
- offsetMode:
(constant) How the model is offset in the graphics window. One of
GraphicsWindow.NO_OFFSET
,GraphicsWindow.OFFSET_MODEL_SPACE
orGraphicsWindow.OFFSET_SCREEN_SPACE
- state:
(integer) The current state number for the model
- visible:
(boolean) Whether the model is visible in the graphics window or not
- xOffset:
(float) The X offset for the model
- yOffset:
(float) The Y offset for the model
- zOffset:
(float) The Z offset for the model
- Return type:
dict
Example
To get the information for the second model in graphics window gw:
info = gw.GetModelInfo(1)
- GraphicsWindow.Next()¶
Returns the next graphics window (or None if there is not one)
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To get the graphics window after graphics window gw:
gw = gw.Next()
- GraphicsWindow.Previous()¶
Returns the previous graphics window (or None if there is not one)
- Returns:
GraphicsWindow object
- Return type:
GraphicsWindow
Example
To get the graphics window before graphics window gw:
gw = gw.Previous()
- GraphicsWindow.Redraw()¶
Redraws the graphics window
- Returns:
No return value
- Return type:
None
Example
To dedraw graphics window gw:
gw.Redraw()
- GraphicsWindow.RemoveModel()¶
Removes a model from a graphics window
- Returns:
No return value
- Return type:
None
Example
To remove model m from graphics window gw in D3PLOT
gw.RemoveModel(m)
- GraphicsWindow.SetModelInfo(index, info)¶
Sets the information for a model in a graphics window
- Parameters:
index (integer) – index of the model in the graphics window you want to set information for (0 <= index <
models
)info (dict) –
Dictionary containing the information to set. Can be any of:
- colour:
(
Colour
) The colour for the model- mode:
(constant) How the model is model is displayed in the graphics window. One of
View.WIRE
,View.HIDDEN
,View.SHADED
orView.CURRENT
- offsetMode:
(constant) How the model is offset in the graphics window. One of
GraphicsWindow.NO_OFFSET
,GraphicsWindow.OFFSET_MODEL_SPACE
orGraphicsWindow.OFFSET_SCREEN_SPACE
- visible:
(boolean) Whether the model is visible in the graphics window or not
- xOffset:
(float) The X offset for the model
- yOffset:
(float) The Y offset for the model
- zOffset:
(float) The Z offset for the model
- Returns:
No return value
- Return type:
None
Example
To set the second model in graphics window gw to have an offset of (100, 100, 0) in model space:
gw.SetModelInfo(1, { offsetMode: Oasys.D3PLOT.GraphicsWindow.OFFSET_MODEL_SPACE, xOffset: 100, yOffset:100, zOffset: 0 } )