Skip to content

Lua: Create Accesses with create_access

Description

In Lua context, modalys.create_access creates an access on a Modalys object. The same function is also available as create_access, make_access, and modalys.make_access.

Lua Syntax

local access = create_access{
    where = object,
    position = 0.35,
    kind = "trans0",
    name = "StringAccess"
}

Parameters

  • where or object: the Modalys object on which the access is created.
  • position or location: access location. If omitted, the default value is 1.
  • kind: access direction or type. If omitted, mlys.lua chooses a default from the object class.
  • name: optional name. Names are made unique automatically.

If position is a number or table, mlys.lua creates an internal dynamic controller for the access position. If position is already a controller, it is used directly.

Default Access Kinds

When kind is not supplied, mlys.lua chooses a kind based on the target object class:

  • normal for harmonic oscillators, radiators, point objects, bars, finite elements, plates, and membranes.
  • base for bridges.
  • long for tubes.
  • trans0 or trans1 for strings, two-mass objects, hanging chains, and other bidirectional cases.

Hybrid Accesses

local hybrid = create_hybrid_access{
    object = hybridObject,
    access = { access1, access2 }
}

Hybrid accesses are available through modalys.create_hybrid_access, create_hybrid_access, create_access_hybrid, make_hybrid_access, make_access_hybrid, modalys.make_hybrid_access, and modalys.make_access_hybrid.


★     ★