public bool Rotate(string entityName, double angle) { if (axScSamlightClientCtrl1.ScIsRunning() == 0) { MessageBox.Show(MultiLanguage.GeSamlightNotFoundString(), MultiLanguage.GeSamlightWarningString(), MessageBoxButtons.OK); //MessageBox.Show("SAMLight not found", "Warning", MessageBoxButtons.OK); return(false); } else { double center_x, center_y; double min_x, min_y, max_x, max_y; min_x = axScSamlightClientCtrl1.ScGetEntityOutline(entityName, 0); min_y = axScSamlightClientCtrl1.ScGetEntityOutline(entityName, 1); max_x = axScSamlightClientCtrl1.ScGetEntityOutline(entityName, 3); max_y = axScSamlightClientCtrl1.ScGetEntityOutline(entityName, 4); center_x = (min_x + max_x) / 2; center_y = (min_y + max_y) / 2; axScSamlightClientCtrl1.ScRotateEntity(entityName, center_x, center_y, angle); return(true); } }
private void BUTTON_ROTATE_Click(object sender, EventArgs e) { m_samlight.ScRotateEntity(EDIT_ENTITY_NAME.Text, Convert.ToDouble(EDIT_CENTER_X.Text, CultureInfo.InvariantCulture), Convert.ToDouble(EDIT_CENTER_Y.Text, CultureInfo.InvariantCulture), Convert.ToDouble(EDIT_ANGLE.Text, CultureInfo.InvariantCulture)); }