ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::ShadowInfo

Inherits:
ModraUp::Entity show all
Includes:
Enumerable

Overview

23 parameters for model or scene shadows. Time is stored as local clock hours in UTC; SunDirection is a derived read-only vector.

Examples:

ModraUp.active_model.shadow_info["ShadowTime"] = Time.utc(2026, 9, 30, 12)

Class Method Summary # collapse

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.
  • #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.
  • #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.

Class Method Details

.keys ⇒ Object

List of ordered keys. @return [Array<String>]

.each_key ⇒ Object

Iterate over keys. @return [Enumerator, nil]

Instance Method Details

#[] ⇒ Object

Shadow parameter retrieval; returns nil for unknown keys. @return [Object, nil]

#[]= ⇒ Object

Writes writable parameters; raises KeyError for invalid/readonly keys, TypeError for type errors, and returns false on out-of-bounds. @return [Object, false]

#keys ⇒ Object

List of ordered keys. @return [Array<String>]

#each ⇒ Object

Iterate through keys; returns an Enumerator if no block is given. @return [Enumerator, nil]

#each_pair ⇒ Object

Alias for each. @return [Enumerator, nil]

#each_key ⇒ Object

Iterate over keys. @return [Enumerator, nil]

#length ⇒ Object

Number of edges. @return [Integer]

#size ⇒ Object

Number of edges. @return [Integer]

#add_observer ⇒ Object

Register an observer, returning false again. @return [Boolean]

#remove_observer ⇒ Object

Remove observer. @return [Boolean]

#model ⇒ Object

Belongs to model. @return [ModraUp::Model]

#valid? ⇒ Object

The object still belongs to the current document and the scene has not been deleted. @return [Boolean]

#deleted? ⇒ Object

The object is invalid. @return [Boolean]