Gets the rotation angle of the image.
Syntax: |
---|
DlxShoot.GetRotation() |
Return Value
Returns the rotation angle of the image in degrees.
Example
Copy code | |
---|---|
var prj = DlxApp.GetJob().GetProject("Example Sch");
if (!prj.IsValid())
prj = DlxApp.GetJob().NewProject("Example Sch");
var doc = prj.GetDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
if (!doc.IsValid())
{
doc = prj.NewDocument("Examples Sch", DlxApp.DOCTYPE_SCHEMATIC);
doc.SetPageFormat("A4", false);
}
if (doc.IsValid() && doc.Activate())
{
var page = doc.GetActivePage();
if (page.IsValid())
{
var layer = page.GetLayerFromType(DlxApp.LAYERTYPE_DRAWING);
if (layer.IsValid())
{
var pos = layer.GetFrontObjectIterator();
while (pos.IsValid())
{
var obj = layer.GetNextObject(pos);
if (obj.GetType() == DlxApp.OBJTYPE_SHOOT)
{
obj.Rotate(45);
DlxApp.Printf("Rotation angle: %.1f", obj.GetRotation());
DlxApp.Printf("BL corner: %.1f,%.1f", obj.GetCornerPoint(DlxApp.CORNERINDEX_BOTTOMLEFT).x, obj.GetCornerPoint(DlxApp.CORNERINDEX_BOTTOMLEFT).y);
DlxApp.Printf("BR corner: %.1f,%.1f", obj.GetCornerPoint(DlxApp.CORNERINDEX_BOTTOMRIGHT).x, obj.GetCornerPoint(DlxApp.CORNERINDEX_BOTTOMRIGHT).y);
DlxApp.Printf("TL corner: %.1f,%.1f", obj.GetCornerPoint(DlxApp.CORNERINDEX_TOPLEFT).x, obj.GetCornerPoint(DlxApp.CORNERINDEX_TOPLEFT).y);
DlxApp.Printf("TR corner: %.1f,%.1f", obj.GetCornerPoint(DlxApp.CORNERINDEX_TOPRIGHT).x, obj.GetCornerPoint(DlxApp.CORNERINDEX_TOPRIGHT).y);
}
}
}
}
}
|