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
1 vote
2 answers
74 views

Using MapBasic Layout

I'm trying to create a Layout window in Vb6 using MapInfo 2021 but the Layout function in this version seems to not be functioning as the older versions. In MapInfo 10.5, a layout window could be ...
OmniMapper's user avatar
1 vote
1 answer
30 views

Mapbasic Record Count Legend

Is there any way to check/activate the 'Show Record Count' through Mapbasic instead of manually checking it in MapInfo like with the Range? Open Window Legend Set Legend Layer Prev Display on Shades ...
OmniMapper's user avatar
0 votes
0 answers
16 views

MapInfo Print StatusBar

Is there a way to directly print the information from the MapInfo Statusbar to like a .txt file or to be used as a string for either mapbasic or VB6?
OmniMapper's user avatar
0 votes
1 answer
23 views

Initiating object creation without ToolButton using MapBasic

Is it possible to have a subroutine in MapBasic that will initiate object creation, in same way as if you clicked Spatial->Insert->Polyline for example. I know I can create custom ToolButton and ...
Kevin Malone's user avatar
1 vote
0 answers
46 views

Create object in MapBasic and taking information from table to fill objects features

I'm currently using MapBasic 16 version. What I'm trying to do is define a function that can create a point that can be activated with a button. When the process of placing a point is complete, I want ...
lakmerol's user avatar
1 vote
1 answer
55 views

MapBasic - Select return 4 dig for Latitude/Longitude

I have a table point (Lat/Long) 6 digits long; however, when I run SELECT the return values are 4 Digits long. How can I preserve 6 digits after running SELECT?
ule's user avatar
  • 11
0 votes
0 answers
22 views

Querying User input

I have a small program that selects the table and columns, however I want to query specifically columns that matches the user input. Table_Name = TableInfo(iTabSelection, TAB_INFO_NAME) 'get the Table ...
ule's user avatar
  • 11
0 votes
1 answer
33 views

Find Raster data in a Mapinfo workspace

I want to check if there is a raster layer in a map window using Mapbasic v2019. For Group Layers I use the following but I want to do the equivalent with Rasters. Sub Remove_Group (ByVal Group_Name ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
79 views

Using MapBasic, is there a method to compress GeoTIFF after programatically creating the GeoTIFF?

I need to compress the file sizes of GeoTIFFs that are created when running the MapBasic application. In a .Net application, I transform the GeoTIFF into a compressed JPG using ImageMagick; which ...
MapinTX's user avatar
  • 309
1 vote
1 answer
48 views

MapBasic issue in creating Thematic with Shade

I'm trying to write a bit of code that looks the columns of a table and if they match by text, then generate a thematic of predefined ranges. So far: Include "MapBasic.def" Declare Sub ...
SlagMuffin's user avatar
0 votes
1 answer
205 views

MapBasic, MapInfo Pro automation of existing Raster Operations

I have the latest version of MapInfo Pro and I would like to know if it is possible to fully automate the use of existing Raster operations into several files at once? For example, having several ...
William's user avatar
0 votes
1 answer
37 views

Does Mapbasic work with MapInfo Discover?

Does Mapbasic work with MapInfo Discover? From what I've been able to figure out it does not. I was really hoping to make some macro style things to help automate some of our process but it doesn't ...
Adam's user avatar
  • 1
1 vote
0 answers
261 views

Nearest statement - Mapbasic

When I use the nearest statement in mapbasic, not all the "from table" points show up. For example I am looking for the nearest distance neighbor of every point in a table (called Points). I use this ...
user6683594's user avatar
0 votes
1 answer
98 views

Mapinfo - Compare Road Direction

I have two layers of Road Networks. How do I compare the difference in road direction between the two layers - both are polylines?
Pauline's user avatar
0 votes
0 answers
134 views

Get last word of string in MapInfo

In pure Mapinfo SQL Update code I need to extract the last word of a string. Ex SUTHERLAND STREET BURKE DEVELOPMENTAL ROAD Street Not Specified The following Update DCDB_DNRME Set road_type = Mid$(...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
87 views

Write variable content into specific cell of datasheet (Mapbasic)

I have a value stored in a variable. How can I write this value to a table (for example into Row2 Column4) using Mapbasic?
sn1ks's user avatar
  • 3,002
1 vote
0 answers
270 views

Converting MapInfo to interactive layered PDF to access the full map?

I want to convert the full map I have in Pathloss 5.0/MapInfo 9.5.1 format into PDF so that I can access the whole map in a PDF file. If I zoom in, the PDF file will be zoomed into the smallest ...
A S's user avatar
  • 11
0 votes
2 answers
52 views

Mapbasic v15 open wor within existing mapview

Using Run Application "G:\System\SSA\wor\Current\Townplanning_2018_v1\Zoning.wor" that's called from within a mapbasic program I want to load the workspace in the current map view rather than in a new ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
116 views

Get code to run on every column in a table -Error "Could not find a public static method named ..." -Mapbasic 17

I need to run a table update command on every column in a table. The code works fine when I manually define the column to work in but not when it is part of a for loop that gets all the column names I ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
338 views

Custom tool for Mapinfo

I'm new to Mapinfo and Mapbasic as well. I need to build a tool like in ArcMap (pythonaddins). The goal is to have a gui application which has three dropdown lists. First is a list of layers in ...
Pavel Pereverzev's user avatar
1 vote
1 answer
284 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 ...
MapinTX's user avatar
  • 309
1 vote
2 answers
267 views

Show MapBasic Window equivalent in QGIS, e.g. Python Window

Is there a Show/Hide MapBasic Window (or equivalent) in QGIS such as in MapInfo? I would like to learn SQL expressions parsing, or a Python Window viewer?
Pescariz's user avatar
  • 882
0 votes
2 answers
254 views

Mapbasic Error - Alter Object cannot operate on an unitialized object variable

I get this error when running an mbx in Mapbasic Include "MapBasic.def" Include "Menu.def" 'assign brush/pen symbology for all but easements dim b1 as Brush b1 = makebrush (1,...
GeorgeC's user avatar
  • 8,228
0 votes
2 answers
240 views

Run mapbasic 32 bit mbx from larger mapbasic 64bit project

I need to run a 32-bit mbx within a 64-bit mbx -is this possible? Basically within a larger 64bit mbx routine, I need to call a mapbasic 32 bit mbx so that I can apply some regex code to a table. ...
GeorgeC's user avatar
  • 8,228
1 vote
1 answer
123 views

Creating hotlinks only on objects that have value using MapBasic?

In mapbasic I am creating hotlinks with the code below. However when there is no value in the column it creates a hyperlink that doesn't work and this is frustrating for users. Is it possible to only ...
GeorgeC's user avatar
  • 8,228
1 vote
1 answer
356 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 ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
588 views

How to print table information using mapbasic

How do I print a tables information in Mapbasic? I have a snippet of code - I want to select all features within a buffer and then print the results as a message in mapinfo that can be copied out into ...
Jonathan West's user avatar
1 vote
1 answer
197 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 ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
476 views

Converting .grd to .asc using MapBasic in MapInfo 16

Can someone please provide an example to show how this would work. For example, I am trying to convert from .GRD to .ASC, would my MapBasic code look like this: public void Convert(string "C:\Users\...
MapInfoNewbie's user avatar
1 vote
1 answer
260 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. ...
Ehsan Aliverdi's user avatar
1 vote
0 answers
90 views

MapInfo and Mapbasic [closed]

I'm looking to run an automation using MapInfo and Mapbasic. What I want to achieve is to run through a MapInfo table on a row by row basis producing a map for each row within the table and then ...
user116134's user avatar
1 vote
2 answers
386 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 ...
Donna's user avatar
  • 11
1 vote
0 answers
234 views

MapBasic: expression does not evaluate to a column or table name

I want to create a new table using MapBasic to fill it later with log events. Those log will go in a new table created each year. Here is my code (error occurs on row with Create Table): ' --- Log ...
AJ23's user avatar
  • 11
1 vote
2 answers
1k 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 ...
Marlin's user avatar
  • 13
2 votes
2 answers
1k views

Mapbasic Code - Change Symbol Style Basic on Column Content

I wrote a piece of code a while ago for colouring lines depending on what was in a certain column. I struggled through it, but managed to get it to work. Now, I want to write a piece of code that will ...
E Forsyth's user avatar
  • 113
1 vote
1 answer
647 views

MapInfo 12.5 or 16 writing scripts

Fairly new to MapInfo both versions. I am a efficient user of ArcGIS, but my query being I was reading up on MapBasic but all the examples for these scripts are for running within MapInfo. Is there ...
user3754653's user avatar
1 vote
1 answer
206 views

How to classify points in mapinfo table into their enclosing polygons (non overlapping polys) in one run

The objective is to classify a group of points to its enclosing polygons in one run rather than using select for each polygon and do it on one by one basis (for 100,000 point and 5000 polygons it can ...
Medo's user avatar
  • 13
1 vote
0 answers
201 views

Get username info from active connection in Mapbasic [closed]

I'm trying to retrieve information on username from active connection (SQL Server Express) in MapInfo 11.5 32bit. First I tried using Server_ConnectInfo( ConnectionNo, SRV_CONNECT_INFO_SQL_USER_ID ) ...
Kevin Malone's user avatar
0 votes
1 answer
658 views

Create polyline using MapBasic (unknown number of nodes)

I'm trying to create pline using MapBasic. My idea was to create simple tool with dialog box containing couple of EditBox, PopupMenu's to retrieve pline attributes from user. So far I have only making ...
Kevin Malone's user avatar
0 votes
1 answer
605 views

Printing select query result in text file in mapbasic

I want to print a select query having number of records in text file in mapbasic but no successful results as i am using below code: Open file "E:\Export.txt" for output as #1 Print #1, select Col1, ...
user514348's user avatar
0 votes
1 answer
250 views

unrecognized Do loop error in mapbasic

unrecognized command do is occurring when i am trying to use below code in mapbasic window. can anyone help me how to fix it although syntaz is correct fetch first from t1 Do while Not EOT(t1) '...
user102435's user avatar
0 votes
1 answer
142 views

Error in SQL query in mapbasic

I am writing below SQL query in mapbasic to insert columns from two tables t1 and t2 into table Sites but error is occuring "Variable or field t2.CELLID not defined" Table Sites (Source integer, N ...
user102418's user avatar
0 votes
1 answer
181 views

One to many join mapbasic

I have a dataset with parcels with a unique lotplan - lets say it has 10,000 records. I have a dataset which has owner info which has one or many owners for each lotplan lets say it has 11,0000 ...
GeorgeC's user avatar
  • 8,228
2 votes
2 answers
571 views

Split polyline every Xm in MapBasic

I need to split large contour polyine datasets every 100m to be used for tiling. It currently has each (25cm) contour as a single (very long) line that extends beyond the tile and impacts labeling etc....
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
2k views

Changing format of column from character to decimal or float in Mapinfo

We have some Mapbasic software that updates character fields in existing mapinfo tables to decimal or float. The character fields are mostly numeric but some values are N/A to indicate not applicable ...
LeasMaps's user avatar
  • 737
1 vote
1 answer
149 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" ...
GeorgeC's user avatar
  • 8,228
3 votes
1 answer
1k views

replace character in string in mapbasic

Is there an equivalent to python .replace in mapbasic? Something like search = search.replace(',', ' ') I have found the search and replace tool for mapinfo and it works well but I need something ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
181 views

MapBasic centroid in EPSG:28354

I have a table in MG94 Z 54 (EPSG:28354). My MapBasic statement is Commit Table DCDB As "C:\DCDB_Full_Copy.TAB" TYPE NATIVE Charset "WindowsLatin1" CoordSys Earth Projection 8, 116, "m", 141, 0, 0....
GeorgeC's user avatar
  • 8,228
1 vote
0 answers
152 views

HttpPOST and MapBasic

Can anyone provide an example of how one would use the (pre-defined) function Function HttpPost( ByVal strURL As String , ByVal strHeaders As String , ByVal ...
Alex's user avatar
  • 479
2 votes
2 answers
763 views

MapBasic: syntax to move a point?

I'm trying to write a tool that moves a selected point from its old location to wherever I click, but can't seem to find the code in the MapBasic user guide. Ideally, I would like to select an ...
ta harp's user avatar
  • 21

1
2 3 4 5 6