Skip to content

SET_OBJ_POS

SET_OBJ_POS sets the position of a modeling object.

Syntax

leo-grammar
CC "Modeling" SET_OBJ_POS objid:idValuex:measureValue y:measureValue .


# --> RESULT ecode:intValue .
CC "Modeling" SET_OBJ_POS objid:idValuex:measureValue y:measureValue .


# --> RESULT ecode:intValue .

Parameters

  • objid (idValue) -
  • x (measureValue)
  • y (measureValue)

Returns

  • ecode (intValue) - Contains the error code or is 0 in case of success.

Details

See Also

Examples

asc
CC "Modeling" GET_SELECTED
FOR objid in:(objids) {
    CC "Core" GET_CLASS_ID objid:(VAL objid)
    IF (NOT isrel) {
        # get position
        CC "Core" GET_ATTR_ID classid:(classid) attrname:"Position"
        CC "Core" GET_ATTR_VAL objid:(VAL objid) attrid:(attrid)
        LEO parse:(val) get-tmm-value:x:"x" get-tmm-value:y:"y"
        # increment x coordinate and set new position
        SET x:(x + 1cm)
        CC "Modeling" SET_OBJ_POS objid:(VAL objid) x:(x) y:(y)
    }
}
CC "Modeling" GET_SELECTED
FOR objid in:(objids) {
    CC "Core" GET_CLASS_ID objid:(VAL objid)
    IF (NOT isrel) {
        # get position
        CC "Core" GET_ATTR_ID classid:(classid) attrname:"Position"
        CC "Core" GET_ATTR_VAL objid:(VAL objid) attrid:(attrid)
        LEO parse:(val) get-tmm-value:x:"x" get-tmm-value:y:"y"
        # increment x coordinate and set new position
        SET x:(x + 1cm)
        CC "Modeling" SET_OBJ_POS objid:(VAL objid) x:(x) y:(y)
    }
}

Versions and Changes

Available since ADOxx 1.3