ObjGetProps

ObjGetProps returns the properties of a document page, diagram or drawing object.

oProps = ObjGetProps(hObj)

Return Value

oProps.

Parameters

hObj

hObj is the handle of a layer or drawing object.

Comment

Note

This function is a beta version. The release version will be available in one of the next updates.

Hilfsfunktionen

props_flat

props_flat converts an object with nested objects into an object with only one level. With props_unflat this conversion can be undone.

r = props_flat(o)
* a
[.
    b = [.
        c = 1
        d = [.
            a = 1
        ]
    ]
    c = "Hello"
]
* props_flat(a)
[.
    b.c = 1
    b.d.a = 1
    c = "Hello"
]

props_unflat

props_unflat see props_flat.

r = props_unflat(o)
* b
[.
    b.c = 1
    b.d.a = 1
    c = "Hello"
]
* props_unflat(b)
[.
    b = [.
        c = 1
        d = [.
            a = 1
        ]
    ]
    c = "Hello"
]

props_get

props_get returns a object with the given keys.

r = props_get(o, keys)
* props_get([. a = 1, b = 2, c = 3], "a c")
[.
    a = 1
    c = 3
]

props_remove

props_remove removes elements from a given object.

r = props_remove(o, keys)
* props_remove([. a = 1, b = 2], "a")
[.
    b = 2
]
* props_remove([. a = 1, b = 2], "a b")
[.
]

props_fromstring

props_fromstring converts a string with “Key=Value” pairs into an object.

o = props_fromstring(s)
* props_fromstring("a = 12.34 b = Hello")
[.
    a = 12.34
    b = "Hello"
]

props_tostring

props_tostring converts an object into a string or string matrix with 2 columns.

s = props_tostring(o)
s = props_tostring(o, options)

The second optional parameter is an object with the following default value: [. tomatrix = 1, nodefault = 1].

* o = ObjGetProps(39)
* o
[.
    arrow-lenght = 5
    ...
    x1 = 4.7
]
* props_tostring(o)
x1     4.7
arrow-lenght   5

* props_tostring(o, [.tomatrix=0])
x1='4.7' arrow-lenght='5'

props_dialog

props_dialog displays a simple dialog box to select properties. The result is a string with the property names.

s = props_dialog(o)

props_diff

props_diff returns an object with properties which are not identical in o1 and o2. The property values of o1 are returned.

r = props_diff(o1, o2)
* props_diff([. a = 1, b = 1], [. a = 1, b = 2, c = 3])
[.
    b = 1
    c = 3
]

History

Version Description
R2016 New.

id-1611894