Map Basic - Import, Browse, Create Points, Display

292 views
Skip to first unread message

Michael Roberts

unread,
Jul 14, 2014, 7:52:49 AM7/14/14
to mapi...@googlegroups.com
Hi 

I am new to MapBasic and am trying to create a tool to import an excel file, browse the data and then automatically create the points in UTM WGS84 36N Projection.  I want to specify the type of symbol, colour and size as well (this is something I have been unable to get to work at all.

I have had an attempt at creating the MapBasic code but would really appreciate some advice as to why it is not working and or ways to improve it.  My end aim is to be able to do this process for about 8 files in sequence and slowly learn from there.

My code is as follows:

Declare Sub Main

Sub Main
Register Table "C:\Export_Data_MapInfo\B14_EXPORT_ASSAY.xlsx"
TYPE XLS Titles  Range "B14_Export_ASSAY!A2:X74109"

Open Table "C:\Export_Data_MapInfo\B14_EXPORT_ASSAY.tab" As B14_EXPORT_ASSAY
Browse * From B14_EXPORT_ASSAY

Create Map For B14_Export_Assay CoordSys Earth Projection 8, 104, "m", 33, 0, 0.9996, 500000, 0 Bounds (-7745844.29597, -9997964.94324) (8745844.29597, 9997964.943)

Set CoordSys Table B14_Export_Assay

Create Point (East,North)
End Sub

Thanks in Advance


Ahmet DABANLI

unread,
Jul 17, 2014, 1:44:58 AM7/17/14
to mapi...@googlegroups.com

Dear Micheal
Change
Create Point (East,North)
To
Update B14_EXPORT_ASSAY set obj = CreatePoint (East,North)

It is done
Create Point (East,North) statement is used to create a point into current editable layer/layout
Or into a variable.
You need to create a point for each record in databese so you should use createpoint function.

Best regards

17 Tem 2014 08:12 tarihinde "Michael Roberts" <michael_...@btinternet.com> yazdı:
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Roberts

unread,
Jul 17, 2014, 3:10:40 AM7/17/14
to mapi...@googlegroups.com
Thanks, 

Do you know the correct notation for applying a specific symbol type and colour?  I also had trouble using the RGB colour combination code.

Many Thanks

Mike

James Moloney

unread,
Jul 17, 2014, 9:40:30 PM7/17/14
to mapi...@googlegroups.com
Hi Mike,

Here is an example of how to change object styles


Cheers

James

Søren Breddam

unread,
Jul 21, 2014, 4:42:14 AM7/21/14
to mapi...@googlegroups.com

Hi Michael,

 

Just before the update statement you can set the style:

    Set Style Symbol MakeFontSymbol (37,255,12,"MapInfo Real Estate",256,0) ' if you want a truetype font

    Set Style Symbol MakeSymbol (33,255,12)  ' if you want a symbol from the MapInfo 3.0 symbol set

 

You can experiment with the values in the symbol clause if you open the mb window and alter the display of a symbol style in one of your open layers. The values are displayed in the mb window. 

Venligst / regards
Søren

arkelly perez alayo

unread,
Feb 21, 2015, 6:24:26 PM2/21/15
to mapi...@googlegroups.com

Thanks ozancik
 
It's what i was looking for 

Reply all
Reply to author
Forward
0 new messages