To remember to specify the projection/coordinatesystem used before setting/retieving coordinates, like this '**Reading the max Y & Y from the active mapper Set CoordSys Window FrontWindow() fMaxX = MapperInfo(FrontWindow(), MAPPER_INFO_MAXX) fMaxY = MapperInfo(FrontWindow(), MAPPER_INFO_MAXY) '**Inserting a point into the cosmetic layer of the active mapper Insert Into WindowInfo(FrontWindow(), WIN_INFO_TABLE) (OBJ) (CreatePoint(fMaxX, fMaxY)) HTH, Peter Horsb�ll M�ller GIS Developer Geographical Information & IT COWI A/S Odensevej 95 5260 Odense S. Denmark Tel + 45 6311 4900 Dir +45 6311 4908 Mob +45 5156 1045 Fax + 45 6311 4949 E-mail [EMAIL PROTECTED] http://www.cowi.dk <http://www.cowi.dk/>
________________________________ From: James Stott [mailto:[EMAIL PROTECTED] Sent: Fri 03-Dec-04 17:23 To: [EMAIL PROTECTED] Subject: MI-L Problem with Create point coordinate systems? All I am fairly new to MapBasic but have experience of programming in other languages. I have hit a problem while trying to write a mapbasic tool. Firstly, the user opens a map window with a table that the user specifies in a FileOpenDlg. Once this table has been opened and is displayed in a mapper window, I try to extract the min_x, min_y, max_x and max_y coordinates using the MapperInfo() function. The values that are returned from these functions are not the same as the coordinates of the window. For example, I have added a section of code to the tool so the user can input an x and y coordinates (british national grid) to create a point (uses the CreatePoint() function). However the point created is not at the coordinates entered i.e. if coordinates entered are x = 457980, y = 263570 the created point comes out as x = 400,000 , y = 4,470,000 Any help would be much appreciated. James Stott This Electronic Transmission is intended only for the attention of the addressee. It may contain privileged and confidential information. If you are not the person for whom it is intended, you must not copy, distribute or take any action in reliance on it. If you have received this electronic transmission in error please notify us immediately by telephone, delete the transmission and destroy any hard copies. Nicholas Pearson Associates has used all reasonable efforts to ensure that this message and any attachments are free from viruses. Nicholas Pearson Associates Environmental Planners - Landscape Architects - Ecologists 30 Brock Street, Bath,BA1 2LN Tel: +44 (0) 1225 445548 Fax: +44 (0) 1225 312387 www.npaconsult.co.uk
