Home/ Reference/ Application

app.ActiveSelectionRange(n)

The n-th shape in the current selection, as a single Shape. Use it to grab an image right after Import (n starts at 1).

Signature

app.ActiveSelectionRange(n)

Notes

The n-th shape in the current selection, as a single Shape. Use it to grab an image right after Import (n starts at 1).

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.ActiveLayer              # active layer; imports and new shapes go here
layer.Import("D:/images/photo1.jpg", 0, None)         # after import the object is selected automatically

img = app.ActiveSelectionRange(1)                # first selected item (1-based)
print("Imported image size: ", img.SizeWidth, "x", img.SizeHeight)

About this section: Application

Application — the CorelDRAW application object.

Other entries in this section