ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::RenderingOptions

Inherits:
ModraUp::Entity show all
Includes:
Enumerable

Overview

The display style of the model (line style, surface, background, section plane, X-ray, etc.) is stored and retrieved in the form of a key-value table. It is obtained from ModraUp::Model#rendering_options, with one set per model. The keys and value types match those in SketchUp 2026, and changes are saved with the model (OSK3D 23+).

Currently, the viewport will draw: surface style (RenderMode / Texture / ModelTransparency), line display, outline, extension lines, endpoints, jitter, depth cues, back edges, various colors, ground/sky, section plane display, hidden geometry, environmental light shading, etc. Keys for fog, dimension/text display switches, and component editing transparency can be read and written but do not affect rendering at this time.

Examples:

ro = ModraUp.active_model.rendering_options
ro["ModelTransparency"] = true   # X-ray
ro["RenderMode"]                 #=> 2

Constants # collapse

ModraUp::RenderingOptions::ROPAssign

ROPAssign = 0

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged’s type, with the value being the same as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPAssign  #=> 0
ModraUp::RenderingOptions::ROPDrawHidden

ROPDrawHidden = 28

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPDrawHidden  #=> 28
ModraUp::RenderingOptions::ROPDrawHiddenGeometry

ROPDrawHiddenGeometry = 29

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPDrawHiddenGeometry  #=> 29
ModraUp::RenderingOptions::ROPDrawHiddenObjects

ROPDrawHiddenObjects = 30

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPDrawHiddenObjects  #=> 30
ModraUp::RenderingOptions::ROPEditComponent

ROPEditComponent = 31

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPEditComponent  #=> 31
ModraUp::RenderingOptions::ROPSectionDisplayTurnedOff

ROPSectionDisplayTurnedOff = 27

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp's.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSectionDisplayTurnedOff  #=> 27
ModraUp::RenderingOptions::ROPSetAOColor

ROPSetAOColor = 76

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAOColor  #=> 76
ModraUp::RenderingOptions::ROPSetAOColorEnabled

ROPSetAOColorEnabled = 75

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAOColorEnabled  #=> 75
ModraUp::RenderingOptions::ROPSetAODistance

ROPSetAODistance = 72

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAODistance  #=> 72
ModraUp::RenderingOptions::ROPSetAOEnabled

ROPSetAOEnabled = 71

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAOEnabled  #=> 71
ModraUp::RenderingOptions::ROPSetAOIntensity

ROPSetAOIntensity = 74

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAOIntensity  #=> 74
ModraUp::RenderingOptions::ROPSetAOMultiplier

ROPSetAOMultiplier = 73

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetAOMultiplier  #=> 73
ModraUp::RenderingOptions::ROPSetBackgroundColor

ROPSetBackgroundColor = 12

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetBackgroundColor  #=> 12
ModraUp::RenderingOptions::ROPSetConstructionColor

ROPSetConstructionColor = 15

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetConstructionColor  #=> 15
ModraUp::RenderingOptions::ROPSetDepthQueEdges

ROPSetDepthQueEdges = 33

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDepthQueEdges  #=> 33
ModraUp::RenderingOptions::ROPSetDepthQueWidth

ROPSetDepthQueWidth = 35

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDepthQueWidth  #=> 35
ModraUp::RenderingOptions::ROPSetDisplayColorByLayer

ROPSetDisplayColorByLayer = 16

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayColorByLayer  #=> 16
ModraUp::RenderingOptions::ROPSetDisplayDims

ROPSetDisplayDims = 59

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayDims  #=> 59
ModraUp::RenderingOptions::ROPSetDisplayFog

ROPSetDisplayFog = 20

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayFog  #=> 20
ModraUp::RenderingOptions::ROPSetDisplayInstanceAxes

ROPSetDisplayInstanceAxes = 11

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayInstanceAxes  #=> 11
ModraUp::RenderingOptions::ROPSetDisplaySketchAxes

ROPSetDisplaySketchAxes = 39

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplaySketchAxes  #=> 39
ModraUp::RenderingOptions::ROPSetDisplayText

ROPSetDisplayText = 58

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayText  #=> 58
ModraUp::RenderingOptions::ROPSetDisplayWatermarks

ROPSetDisplayWatermarks = 61

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDisplayWatermarks  #=> 61
ModraUp::RenderingOptions::ROPSetDrawBackEdges

ROPSetDrawBackEdges = 63

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDrawBackEdges  #=> 63
ModraUp::RenderingOptions::ROPSetDrawGround

ROPSetDrawGround = 55

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDrawGround  #=> 55
ModraUp::RenderingOptions::ROPSetDrawHorizon

ROPSetDrawHorizon = 54

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDrawHorizon  #=> 54
ModraUp::RenderingOptions::ROPSetDrawUnderground

ROPSetDrawUnderground = 56

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetDrawUnderground  #=> 56
ModraUp::RenderingOptions::ROPSetEdgeColorMode

ROPSetEdgeColorMode = 5

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetEdgeColorMode  #=> 5
ModraUp::RenderingOptions::ROPSetEdgeDisplayMode

ROPSetEdgeDisplayMode = 4

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetEdgeDisplayMode  #=> 4
ModraUp::RenderingOptions::ROPSetEdgeType

ROPSetEdgeType = 41

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged’s type, with the value being the same as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetEdgeType  #=> 41
ModraUp::RenderingOptions::ROPSetExtendEdges

ROPSetExtendEdges = 8

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetExtendEdges  #=> 8
ModraUp::RenderingOptions::ROPSetExtendLines

ROPSetExtendLines = 18

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetExtendLines  #=> 18
ModraUp::RenderingOptions::ROPSetFaceColor

ROPSetFaceColor = 40

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp's.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFaceColor  #=> 40
ModraUp::RenderingOptions::ROPSetFaceColorMode

ROPSetFaceColorMode = 9999

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFaceColorMode  #=> 9999
ModraUp::RenderingOptions::ROPSetFogColor

ROPSetFogColor = 23

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFogColor  #=> 23
ModraUp::RenderingOptions::ROPSetFogDist

ROPSetFogDist = 24

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFogDist  #=> 24
ModraUp::RenderingOptions::ROPSetFogHint

ROPSetFogHint = 25

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFogHint  #=> 25
ModraUp::RenderingOptions::ROPSetFogUseBkColor

ROPSetFogUseBkColor = 60

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetFogUseBkColor  #=> 60
ModraUp::RenderingOptions::ROPSetForegroundColor

ROPSetForegroundColor = 13

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetForegroundColor  #=> 13
ModraUp::RenderingOptions::ROPSetGroundColor

ROPSetGroundColor = 53

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetGroundColor  #=> 53
ModraUp::RenderingOptions::ROPSetGroundTransparency

ROPSetGroundTransparency = 57

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetGroundTransparency  #=> 57
ModraUp::RenderingOptions::ROPSetHideConstructionGeometry

ROPSetHideConstructionGeometry = 51

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetHideConstructionGeometry  #=> 51
ModraUp::RenderingOptions::ROPSetHighlightColor

ROPSetHighlightColor = 14

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a numeric value identical to SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetHighlightColor  #=> 14
ModraUp::RenderingOptions::ROPSetHorizonColor

ROPSetHorizonColor = 70

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetHorizonColor  #=> 70
ModraUp::RenderingOptions::ROPSetJitterEdges

ROPSetJitterEdges = 6

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetJitterEdges  #=> 6
ModraUp::RenderingOptions::ROPSetLineEndEdges

ROPSetLineEndEdges = 34

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetLineEndEdges  #=> 34
ModraUp::RenderingOptions::ROPSetLineEndWidth

ROPSetLineEndWidth = 36

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetLineEndWidth  #=> 36
ModraUp::RenderingOptions::ROPSetLineExtension

ROPSetLineExtension = 19

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetLineExtension  #=> 19
ModraUp::RenderingOptions::ROPSetLineStyleEdges

ROPSetLineStyleEdges = 7

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetLineStyleEdges  #=> 7
ModraUp::RenderingOptions::ROPSetLockedColor

ROPSetLockedColor = 38

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetLockedColor  #=> 38
ModraUp::RenderingOptions::ROPSetMaterialTransparency

ROPSetMaterialTransparency = 43

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetMaterialTransparency  #=> 43
ModraUp::RenderingOptions::ROPSetModelTransparency

ROPSetModelTransparency = 42

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetModelTransparency  #=> 42
ModraUp::RenderingOptions::ROPSetPhotomatchBackgroundOpacity

ROPSetPhotomatchBackgroundOpacity = 65

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetPhotomatchBackgroundOpacity  #=> 65
ModraUp::RenderingOptions::ROPSetPhotomatchDrawBackground

ROPSetPhotomatchDrawBackground = 64

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetPhotomatchDrawBackground  #=> 64
ModraUp::RenderingOptions::ROPSetPhotomatchDrawOverlay

ROPSetPhotomatchDrawOverlay = 66

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetPhotomatchDrawOverlay  #=> 66
ModraUp::RenderingOptions::ROPSetPhotomatchOverlayOpacity

ROPSetPhotomatchOverlayOpacity = 67

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetPhotomatchOverlayOpacity  #=> 67
ModraUp::RenderingOptions::ROPSetProfileEdges

ROPSetProfileEdges = 9

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetProfileEdges  #=> 9
ModraUp::RenderingOptions::ROPSetProfileWidth

ROPSetProfileWidth = 10

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a numerical value identical to SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetProfileWidth  #=> 10
ModraUp::RenderingOptions::ROPSetProfilesOnlyEdges

ROPSetProfilesOnlyEdges = 37

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetProfilesOnlyEdges  #=> 37
ModraUp::RenderingOptions::ROPSetRenderMode

ROPSetRenderMode = 1

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with a value identical to SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetRenderMode  #=> 1
ModraUp::RenderingOptions::ROPSetSectionActiveColor

ROPSetSectionActiveColor = 44

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionActiveColor  #=> 44
ModraUp::RenderingOptions::ROPSetSectionCutFilled

ROPSetSectionCutFilled = 50

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionCutFilled  #=> 50
ModraUp::RenderingOptions::ROPSetSectionCutWidth

ROPSetSectionCutWidth = 49

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionCutWidth  #=> 49
ModraUp::RenderingOptions::ROPSetSectionDefaultCutColor

ROPSetSectionDefaultCutColor = 46

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionDefaultCutColor  #=> 46
ModraUp::RenderingOptions::ROPSetSectionDefaultFillColor

ROPSetSectionDefaultFillColor = 47

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionDefaultFillColor  #=> 47
ModraUp::RenderingOptions::ROPSetSectionDisplayMode

ROPSetSectionDisplayMode = 26

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the same numerical value as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionDisplayMode  #=> 26
ModraUp::RenderingOptions::ROPSetSectionInactiveColor

ROPSetSectionInactiveColor = 45

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSectionInactiveColor  #=> 45
ModraUp::RenderingOptions::ROPSetSkyColor

ROPSetSkyColor = 52

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetSkyColor  #=> 52
ModraUp::RenderingOptions::ROPSetTexture

ROPSetTexture = 3

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetTexture  #=> 3
ModraUp::RenderingOptions::ROPSetTransparencyObsolete

ROPSetTransparencyObsolete = 2

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value being the same as in SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetTransparencyObsolete  #=> 2
ModraUp::RenderingOptions::ROPSetXRayOpacity

ROPSetXRayOpacity = 62

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPSetXRayOpacity  #=> 62
ModraUp::RenderingOptions::ROPTransparencySortMethod

ROPTransparencySortMethod = 32

ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged type, with the value matching SketchUp.

Returns:

  • (Integer)

Examples:

ModraUp::RenderingOptions::ROPTransparencySortMethod  #=> 32

Instance Method Summary # collapse

Inherited from ModraUp::Entity

  • #typename ⇒ String
    Type name (e.g., Face / Edge / Group).
  • #entityID ⇒ Integer
    Entity ID within the current session: A small integer starting from 1 that increments and remains constant for the lifetime of the entity, unchanged by undo/redo operations. This ID is not preserved when saving the file; it will be renumbered upon reopening the model. For cross-session identification, use #persistent_id. Copied entities will receive new IDs.
  • #persistent_id ⇒ Integer
    Number assigned with the model: A unique, incrementing small integer starting from 1 that persists across model saves and reloads, independent of #entityID. Copied entities receive new numbers, and deleted entities do not reuse their numbers. Edges, faces, vertices, curves, groups, component instances/definitions, dimensions, leader lines/points, section planes, materials, layers, layer folders, and drawing sheets have assigned numbers; all others (rings, EdgeUses, attribute dictionaries, line types, sets, etc.) return 0.
  • #parent ⇒ ModraUp::Model, ModraUp::ComponentDefinition
    Returns the owner of this drawing context. At the root this is the model. Inside a definition it is the definition itself.
  • #model ⇒ ModraUp::Model
    The model it belongs to.
  • #to_s ⇒ String
    String form. Returns "#<Deleted Entity>” when the entity has been deleted.
  • #inspect ⇒ String
    Same as #to_s.
  • #attribute_dictionaries ⇒ ModraUp::AttributeDictionaries, nil
    Collection of attribute dictionaries. Returns nil (evaluates to false) if there are no dictionaries.
  • #attribute_dictionary(name) ⇒ ModraUp::AttributeDictionary, nil
    Retrieve an attribute dictionary by name. If none exists, return nil; if create is true, create an empty dictionary. ModraUp::Loop / ModraUp::EdgeUse / ModraUp::Curve always return nil.
  • #valid? ⇒ Boolean
    Returns true if the entity is valid, meaning it has not been deleted from the model. Revoked entities are false; even if new geometry is drawn occupying its original position, this object remains an invalid entity (still false). Repeating the action to restore it makes it valid again.
  • #deleted? ⇒ Boolean
    Opposite of #valid?.
  • #set_attribute(dict_name, key, value) ⇒ Object
    Write attribute values. Materials, groups, component instances, faces, and edges are supported. When dict_name and key are Symbols, they are converted to strings. The type of data written is the same type that will be read back.
  • #get_attribute(dict_name, key, default = nil) ⇒ Object
    Read the attribute. If dict_name and key are Symbols, convert them to strings (similar to SketchUp). If the dictionary or key does not exist, return default. The return value type is the same as what is written by #set_attribute.
  • #delete_attribute(dict_name) ⇒ Boolean
    Delete a key, or delete the entire dictionary when the key is omitted.

Instance Method Details

rendering_options[key] ⇒ Object or nil

Read an option. Boolean, integer, float, or ModraUp::Color; return nil for an unknown key. RenderMode: 0 wireframe, 1 hidden-surface, 2 shaded (whether to show textures depends on Texture), 5 solid. EdgeColorMode: 0 by material, 1 uniform, 2 by axis.

Parameters:

  • key (String)

Returns:

  • (Boolean, Integer, Float, ModraUp::Color, nil)

Examples:

ModraUp.active_model.rendering_options["DisplaySketchAxes"]  #=> true

rendering_options[key] = value ⇒ value

Set an option and refresh the viewport; the value must actually change to dispatch ModraUp::RenderingOptionsObserver#onRenderingOptionsChanged (type as the corresponding ROP… constant). Colors can be ModraUp::Color, color names, or [r, g, b(, a)].

Parameters:

  • key (String)
  • value (Object)

Returns:

  • (Object) The value passed in

Raises:

  • ArgumentError: Key does not exist, or the value type/range is incorrect

Examples:

ModraUp.active_model.rendering_options["ModelTransparency"] = true

#hatch_pattern ⇒ ModraUp::HatchPatternData

Read the default section hatch pattern of the style: the section area without any groups, components, materials, or section plane patterns uses it. The returned object is frozen; to modify it, first dup it and then assign it back. The fill color is the style's section fill color.

Returns:

  • (ModraUp::HatchPatternData)

Examples:

data = ModraUp.active_model.rendering_options.hatch_pattern
data.frozen?  #=> true

#hatch_pattern=(data) ⇒ ModraUp::HatchPatternData

Sets the default hatch pattern for the style (also setting the hatch color).

Parameters:

  • data (ModraUp::HatchPatternData) Pattern settings.

Returns:

  • (ModraUp::HatchPatternData)

Raises:

  • [TypeError] It is not a HatchPatternData.

Examples:

ro = ModraUp.active_model.rendering_options
data = ro.hatch_pattern.dup
data.rotation_angle = 45.0
ro.hatch_pattern = data

rendering_options.keys ⇒ Array<String>

All key names (sorted alphabetically).

Returns:

  • (Array<String>)

Examples:

ModraUp.active_model.rendering_options.keys.include?("RenderMode")  #=> true

rendering_options.each { |key, value| ... } ⇒ nil

Yield each key and value.

Returns:

  • (nil)

Yields:

  • @yieldparam [String] key
  • @yieldparam [Object] value

Examples:

ModraUp.active_model.rendering_options.each { |k, v| puts "#{k}: #{v}" }

rendering_options.each_pair { |key, value| ... } ⇒ nil

Like #each_pair.

Returns:

  • (nil)

Yields:

  • @yieldparam [String] key
  • @yieldparam [Object] value

Examples:

ModraUp.active_model.rendering_options.each_pair { |k, v| p [k, v] }

rendering_options.each_key { |key| ... } ⇒ nil

Yield each key name individually.

Returns:

  • (nil)

Yields:

  • @yieldparam [String] key

Examples:

ModraUp.active_model.rendering_options.each_key { |k| puts k }

rendering_options.length ⇒ Integer

Number of options.

Returns:

  • (Integer)

Examples:

ModraUp.active_model.rendering_options.length  #=> 69

rendering_options.size ⇒ Integer

Same as #length.

Returns:

  • (Integer)

Examples:

ModraUp.active_model.rendering_options.size

rendering_options.add_observer(observer) ⇒ Boolean

Register a ModraUp::RenderingOptionsObserver. Adding the same object a second time returns false.

Parameters:

  • observer (ModraUp::RenderingOptionsObserver)

Returns:

  • (Boolean)

Examples:

ModraUp.active_model.rendering_options.add_observer(ModraUp::RenderingOptionsObserver.new)

rendering_options.remove_observer(observer) ⇒ Boolean

Remove the observer.

Parameters:

  • observer (ModraUp::RenderingOptionsObserver)

Returns:

  • (Boolean)

Examples:

ro = ModraUp.active_model.rendering_options
obs = ModraUp::RenderingOptionsObserver.new
ro.add_observer(obs)
ro.remove_observer(obs)  #=> true