Rotate() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Allows an object (not a text object) to be rotated about the rotation anchor point. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Rotate( object, angle )

object represents an object that can be rotated. It cannot be a text object.

angle is a float value that represents the angle (in degrees) to rotate the object.

Return Value

A rotated object.

Description

The Rotate() function Rotates all object types except for text objects without altering the source object in any way.

To rotate text objects, use the Alter Object OBJ_GEO_TEXTANGLE statement.

If an arc, ellipse, rectangle, or rounded rectangle is rotated, the resultant object is converted to a polyline/polygon so that the nodes can be rotated.

Example

dim RotateObject as object
Open Table "C:\MapInfo_data\TUT_USA\USA\STATES.TAB" 
map from states
select * from States where state = "IN"
RotateObject = rotate(selection.obj, 45)
insert into states (obj) values (RotateObject)

See Also:

RotateAtPoint() function