Questions tagged [mapbasic]

MapBasic is a programming language for the creation of additional tools and functionality for MapInfo Pro Desktop GIS

Filter by
Sorted by
Tagged with
2
votes
1answer
441 views

Adding nodes to a line by interval in MapInfo

I am a MapBasic beginner, and I just want a simple .mbx or tool that can add nodes to a line by interval (say every 50m). I don't really need it to have a start point or end point (or maybe it is ...
2
votes
1answer
552 views

Creating an annulus sector with mapbasic

Knowing the center of rotation, start and end angles, inner an outer radius, how can this be achieved with MapBasic
2
votes
1answer
217 views

How can I make a dialog box floating while working on the window?

I would like to have a floating dialog box just like the Named Views.mbx How could make my existing dialog box float while working on other window?
2
votes
3answers
860 views

Is it possible to retrieve thematic layer information for a Layer in Mapbasic?

I found this code windowinfo(FrontWindow(), WIN_INFO_CLONEWINDOW) This function gives information (mapbasic) about the front Map window which can be used to regenerate the map. Is there any ...
2
votes
1answer
1k views

How to add custom Icon to buttons on buttonpads in mapinfo?

I have made buttons with icons availabe in mapinfo but now i want to add custom icon. Is it possible my code is as follows: Include "icons.def" Declare Sub Main Declare Sub button_prompt Sub ...
2
votes
1answer
2k views

Finding text object variable names in MapInfo/MapBasic

In MapBasic you can create a text object in a layout window by using the "Create text" statement. You can also use the same statement to update this object. I am working on a tool that creates ...
2
votes
2answers
2k views

How can I Create Line Feature using two separate point features in MapInfo

I have two MapInfo Tab files as Point feature. both the layer have the same unique ID. what I was trying to do is to connect both point using the same ID as a Line feature. so the end result will be "...
2
votes
1answer
92 views

Using specific ODBC connection when writing to SQL?

I am currently writing an output file that is generated using some Mapbasic Code into a MS SQL Database: Dim SQL_output_tablename as String SQL_output_tablename = """dbo"""&"."&"""...
2
votes
1answer
258 views

Making thematic layer 50% translucent in MapBasic?

I'm trying to make this enhancement to an old program written by another author. I was able to make the layer translucent prior to Shade Window command, but its not working. Here is the code: Add Map ...
2
votes
1answer
2k views

MapBasic sentence to update column contained in an object table

I was looking for a MapBasic sentence to update a MapInfo table. I've got two tables and I want to update one of them (POINTS) with an attribute of another (REGIONS). I would like to update points ...
2
votes
1answer
599 views

Expression does not evaluate to column or table name?

This is my code: Include "MAPBASIC.DEF" Include "MENU.DEF" Dim s_filename As String s_filename = FileOpenDlg("","","TAB"," Open Table Interactive") Browse * From s_filename I want to open a ...
2
votes
1answer
97 views

In MapBasic, how do I open a connection to MapMarker so I can allow my app to geocode?

I would like my app to open up MapMarker and automatically geocode for me. I cannot get past the Open Connection statement as I am receiving an error while compiling. Here is the code: Include "...
2
votes
1answer
6k views

How to connect points to line in Mapinfo?

I am using Mapinfo and Mapbasic. I have all the points stored in a DBMS. I have four columns with four points longitude and latitude. Is there any way to connect the points? I am using Mapinfo 10....
2
votes
2answers
3k views

Creating MBO files with MapBasic and Notepad++

[Note: I have been using Notepad++ (with some customisations as per this page), rather than MapBasic itself. This may make things a bit trickier, but so far the time saved in development has been ...
2
votes
0answers
563 views

Mapinfo Layout WIndow [closed]

I have to create multiple maps using the same layout, but different map views (more than 100 maps). There is a separate rectangles layer created for each view at a specific scale using the map frame ...
2
votes
0answers
130 views

String Size/Query in Mapbasic

I want to select many objects on the screen and select other objects that share the same attributes with the chosen group. So I'm creating a tool to select many object based in five tables' columns ...
1
vote
1answer
1k views

Converting MapInfo (MapBasic) Script into ArcPy? [closed]

I have a MapBasic script that divides an irregular polygon into smaller polygons of 1 hectare each. Would anyone help me to convert the following into an ArcPy script. ' This program requires an ...
1
vote
2answers
1k views

How to add element to Mapbasic Array?

Code: Dim name_array() As String Redim name_array(10) How to add value to the array? I know we can add value by specifying index like name_array(i) = "some_value" But I don't want to specify ...
1
vote
2answers
459 views

Mapbasic JOIN and retain unmatched records

I need to run a JOIN in Mapbasic and retain all records of the first table as well as the matched records. So Select Cadastral_data_QLD_CADASTRE_DC.LOTPLAN , Austpost_Extract_08_01.Unit_Type , ...
1
vote
2answers
545 views

Bounding Co-ordinates of Polygons

I have created 250 square meter grids using the Grid Maker tool. I have given each grid a unique name. I want to find and store bounding co-ordinates (Latitude and Longitude) of each polygon in the ...
1
vote
1answer
1k views

How to close all layers in Mapinfo?

I want to close all layers in Mapinfo except one and again add one layer. How to do so in Mapinfo using Mapbasic or without?
1
vote
2answers
3k views

What are the best ways to connect two coordinates on mapinfo?

I have with the help of this forum drawn a coordinate system with longitude and latitude at different location. I am trying to connect these sites what is the best way to connect. Is it just drawing ...
1
vote
1answer
214 views

MapBasic subtract date columns

Is it possible to create a MapBasic SQL command to subtract one date column from another and get the number of days between the two (positive or negative values)? I have found the following process ...
1
vote
2answers
340 views

mapbasic convert raster to mrr

I'd like to convert a whole folder of files from GRD to MRR. Is this possible in mapbasic or from the interface or do I need to do them file by file? I have tried to searching in the mapbasic forums ...
1
vote
1answer
649 views

Create Sector PRACH in MapInfo

I am trying to write a code that creates the PRACH per sector per band for a site. My PRACH data contains: "Site name, lat, long, beamwidth, azimuth, and distance" I got to the point of creating ...
1
vote
1answer
3k views

How to run query in mapbasic?

I made a Query in Mapbasic like : Dim query As String query = "Select * from some_table" How to run query to form table? Is it possible to save selected value in variable without forming table?
1
vote
1answer
2k views

How to handle select query to return numeric value?

I have the following select Query : Dim count As Integer Select count(*) as mycount from some_table into temp_table Fetch First From temp_table count = some_table.mycount But it sends error: ...
1
vote
1answer
155 views

MapBasic IDE Switch from Code view to Design view

I am brand new to mapbasic and I am working on a mapbasic project already developed. The previous developer has left and is not available for questions. I have searched mapbasic documentation and ...
1
vote
2answers
136 views

Opening and saving multiple shapefiles as .tab files? [closed]

How do I open several shapefiles, save as Tab files then append as one table using MapBasic code? I have created a list that contains the tables and path to tables. But cannot loop to save tables ...
1
vote
2answers
1k views

How to get selected object data?

I want to get attributes from object what was selected on map. I understand how to get selected object: Dim nrecords as Ineger Dim obj as Object nRecords = SelectionInfo(SEL_INFO_NROWS) For i = 1 To ...
1
vote
1answer
648 views

How to take object style (pen, brush, symbol) in MapBasic?

How can I take style from existing object? Brush from region, symbol from point? In MapBasic documentation and in Google I can find only how to change object's style but can't find how to take it.
1
vote
1answer
304 views

MapInfo/Mapbasic - test if a mapper is open

I have a custom menu that I created which opens a mappable table and I'm trying to work out how I open it when there is no other .tab files or mapper windows open there are other .tab files open ...
1
vote
1answer
127 views

Dialog Table Name Prompt Error In MapBasic_Mapbasic

I am trying to prompt the Table name from the opened tables and to use it in the rest of the program, but what i get is (Table (i) is not open) after clicking ok the Sub Procedure is below, please ...
1
vote
1answer
81 views

Strange results

I am getting a strange error within GIS, when using the internal MapInfo Select query for objects. SELECT featurecode, area(obj,"sq km"),theme, DescriptiveGroup,count(*) from ...
1
vote
1answer
4k views

How to create a circular sector in Mapinfo?

I want to build a tool that creates a cell sector from data like that below. The sector diagram should be like the second picture. The first picture shows a Mapinfo tab file with the required fields ...
1
vote
1answer
289 views

Which version of mapbasic to use for maximum interoperability with different mapinfo versions?

The oldest mapbasic download offered by pbinsight these days seems to be version 9.5. I wonder can all subsequent versions of mapinfo run compiled code written with this? If so, is an older (and ...
1
vote
1answer
2k views

Is it possible to create Thematic Maps using two columns in Mapinfo?

I have created Thematic map with one column in Mapinfo. Is it possible to create Thematic Map using two columns in Mapinfo? For Example: I have a column with name of place and a column with date. ...
1
vote
1answer
113 views

Mapbasic work in current directory

Is it possible to get mapbasic to use the current directory for processes? So rather than the following where WFolder is manually set as the working folder can I get it to just work in the folder ...
1
vote
1answer
101 views

Mapbasic write and read csv into python tuple type structure

In mapbasic I need to read a csv into an array but arrange each row of the csv independently. See the current result, code etc below. I want it to be something like a python dictionary ([Bushfire_V ...
1
vote
1answer
77 views

Performing multiple selection using MapBasic?

I am new to MapBasic programming. I am trying to make multiple selection from a table where the ID number exist in my array and save all the values into another table which called results. ...
1
vote
1answer
437 views

MapInfo/MapBasic SQL query

I've done a little bit of SQL query in MapBasic, but somehow get lost in this problem. I'm hoping that someone can help me out. I have a table of polygons in 2 groups, F and E. F polygons are larger ...
1
vote
1answer
89 views

How to reuse code with a few inputs each time in mapbasic (sub or function)?

I need to run a string of code multiple times in a mbx while just changing 2 parameters. I tried a sub and function but both failed. How can I do this. The code is Print "Starting DCDB_FeatureName" ...
1
vote
1answer
188 views

Open multiple files using fileopendlg() function

I want to open multiple files using fileopendlg() function, when I code it selects only one file at a time. Is there any function or procedure to select multiple files at a time?
1
vote
2answers
353 views

How to Close all Layers but keep Tables on MapInfo using MapBasic

I'd like to know how to close all the layers on MapInfo but keep the tables open using MapBasic code. The idea is to be able to keep the tables open so that I can create multiple different maps using ...
1
vote
1answer
459 views

Deleting from a view. Mapbasic

I'm using MapBasic and have used a query to get the rowids (populated in a column) of minimum values Select SUBSECT_ID, Row, Min(MaxLV)from LVQuery group by SUBSECT_ID into MinLV Now, I want to ...
1
vote
2answers
141 views

PRACH all counters plot not well visualized

Here's the output that Im getting: Im not sure why it is doing this.. I want it to be more like this When i try plotting only two counters (two radii): It is giving me this: I hope it is clearer ...
1
vote
1answer
322 views

Run the Sub procedure by selecting an object from the map

In Mapbasic made custom menu selected item to run sub procedure, what i want to make the Sub procedure to be ready to run by selecting an object from the map and run again by selecting another object,...
1
vote
1answer
500 views

What arguments does MapBasic's ColumnInfo() take?

MapBasic's tableInfo() function has a KnowledgeBase docs page here listing the arguments and all the attributes it takes, and a usage example in the reference document. columnInfo() has neither of ...
1
vote
1answer
2k views

In MapBasic, how do I display a dialog box as the result of a menu item being clicked on?

I have created a menu item in MapBasic. I need to call a procedure to open a dialog box as the result of one of the menu items being selected. I believe I am having trouble declaring the sub ...
1
vote
2answers
737 views

Selecting an item with the mouse in MapBasic

This may seem relatively simple, but I'm pretty confused. I have written a mapbasic tool that does things to the table 'Selection' depending on user choices in a popup menu, but currently you need to ...