Please enable JavaScript to view this site.

Knowledge Base

Navigation: Scripting Language > Manipulating objects

get

We've made some changes. Use 'Ctrl-F5' to clear your browser cache.
Scroll Prev Top Next More

Gets a property from selected objects. The property names for the get command are the same as the property names in the Edit dialogue box.  For example, if you see a property called "mesh accuracy", then you can use the command get("mesh accuracy"); to get that property. It is possible to get numeric, string, drop down and checkbox properties.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

?get;

Returns a list of the properties of the selected object(s).

out = get("property");

Gets the requested property value from the currently selected object. It cannot be used to get the property value of a selected object in a group.

If multiple objects are selected get("property") is the same as get("property",i), where i is the number of the first selected objects with the requested property.

Out can be a matrix or a string, depending on the property requested.

get("property",i);

Gets the property of the ith selected object. Use this to act on a series of objects. It cannot be used to get the value of a selected object in a group.

The objects are ordered by their location in the object tree. The uppermost selected object is given the index 1, and the index numbers increase as you go down the tree.

 

Examples

This example uses the get command to get the x span of an object named substrate.

select("substrate");

x_span = get("x span"); 

 

Add 2 microns to the radius of all selected objects that have a radius property.

select("circle");

for (i=1:getnumber) {

 rad=get("radius",i);

 set("radius",rad+2e-6,i);

}

 

Set and get the vertices of a polygon object. We create an octagon with a radius of 1um.

addpoly;

theta=linspace(0,2*pi,9);

theta=theta(1:8);

x=cos(theta)*1e-6;

y=sin(theta)*1e-6;

V=[x,y];

set("vertices",V);

?get("vertices");

result: 

1e-006 0 

7.07107e-007 7.07107e-007 

6.12323e-023 1e-006 

-7.07107e-007 7.07107e-007 

-1e-006 1.22465e-022 

-7.07107e-007 -7.07107e-007 

-1.83697e-022 -1e-006 

7.07107e-007 -7.07107e-007 

 

See a list of the properties of a rectangle.

addrect;

?get;

alpha

color opacity

detail

enabled

first axis

grid attribute name

index

index units

material

mesh order

name

override color opacity from material database

override mesh order from material database

render type

rotation 1

rotation 2

rotation 3

second axis

set color opacity from material database

set mesh order from material database

third axis

type

use relative coordinates

x

x max

x min

x span

y

y max

y min

y span

z

z max

z min

z span

 

See Also

Manipulating objects, getnumber, getnamed, getnamednumber, set, haveproperty, runsetup

Copyright Lumerical Inc. | Privacy | Site Map