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
0answers
15 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 ...
0
votes
2answers
27 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 ...
0
votes
1answer
36 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 ...
0
votes
0answers
23 views

Mapbasic crashes when simple print to text file is added

I want to log the message text in a mapbasic script to a txt file but the program now crashes. Print ProcessThese.FullPath Open file "D:\4_RefreshMB.txt" for output as #1 Print #1, ProcessThese....
0
votes
1answer
99 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 ...
1
vote
1answer
135 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 ...
0
votes
2answers
100 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?
0
votes
0answers
20 views

Unable to divide by zero mapinfo [duplicate]

I've to calculate a percentage in this query in mapbasic: Select * from Presence where Date="2016-10-09" into H1 noselect order by Municipalities Select * from Presence where Date="2016-10-16" into ...
0
votes
2answers
49 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,...
0
votes
2answers
46 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. ...
1
vote
1answer
56 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 ...
1
vote
1answer
95 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 ...
0
votes
1answer
185 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 ...
1
vote
1answer
97 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 ...
0
votes
0answers
100 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\...
1
vote
1answer
63 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
0answers
66 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 ...
1
vote
2answers
123 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
0answers
100 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 ...
1
vote
1answer
373 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 ...
2
votes
2answers
434 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 ...
0
votes
1answer
392 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 ...
1
vote
1answer
125 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 ...
1
vote
0answers
122 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 ) ...
0
votes
1answer
370 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 ...
0
votes
1answer
308 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, ...
0
votes
1answer
106 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) '...
0
votes
1answer
86 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 ...
0
votes
1answer
99 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 ...
2
votes
2answers
284 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....
0
votes
1answer
715 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 ...
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" ...
2
votes
1answer
680 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 ...
0
votes
1answer
81 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....
1
vote
0answers
81 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 ...
2
votes
2answers
380 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 ...
1
vote
1answer
294 views

Using FnodeTnode Tracing Extension in MapInfo?

I have downloaded FnodeTnode Tracer plugin from Pitney Bowes plugins repository website. It was just the MBX file that I have to regester it into my MIPRO and did it. I have water distribution ...
1
vote
0answers
138 views

How to build Geometric network in MapInfo?

I have sample dataset of Water network. I wanted to make it geometrically connected network. I was trying to trace the network end to end, I have used "FnodeTnode tracing" plugin, but I was not lucky ...
0
votes
2answers
672 views

Update Column to a Value

I'm trying to update a column to a value in Mapinfo/Mapbasic using Add Column "MMT_PARCEL_MP" (Limited_StratumTF )From Limited_Stratum Set To "T" Where intersects and just getting an 'Unable to ...
2
votes
1answer
231 views

Use Windows function GetProductInfo via MapBasic

I develop a MapInfo-based GIS and I need to be able to determine the Windows OS of a given user. So far we have used a Windows function GetVersionEx (kernel32 library) to do this but the function ...
0
votes
0answers
66 views

Mapbasic code runs but no output is generated

My code (from previous questions here) to generate a list runs but there is no output... Include "MapBasic.def" Declare Sub Main Sub Main Dim path_to_temp_tables As String path_to_temp_tables = "" ...
0
votes
1answer
498 views

Running a function in Mapbasic

I've been trying to invoke my first MB function to do some error handling and I keep getting an "Unrecognised command: OpenTab". We have Function OpenTab(ByVal TableName as String, ByVal sAlias as ...
0
votes
1answer
179 views

mapbasic update a column with centroid of object

I have a table that has a few polygons. I would like to extract the centroid of each polygon and fill up the columns named, Cent_X, and Cent_Y. The syntax for getting the centroid is CentroidX(obj) ...
1
vote
1answer
211 views

MapBasic: skip popup menu dialog to get access to standard “Modify table structure” dialog

I'm trying to develop a small program using MapBasic for MapInfo. I want to get access to the standard "Modify table structure" (or "Image registration" for raster tables) dialog through "Layer ...
3
votes
1answer
215 views

Regex expression in mapinfo sql to remove special character

Is there a way to clean the values in the column to just have A-Z 0-9 and _ ? In python/regex I run def Alphanumeric(string): import re clean_string=re.sub(r'[^a-zA-Z0-9‌​_]', '', string) return ...
1
vote
1answer
200 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 ...
0
votes
2answers
204 views

Error in MapBasic CreatePoint statement (argument out of range)

I'm writing a mapbasic create point statement and getting an argument out of range error when running the code. I've been though it a hundred times and can't figure out where my mistake is. I'm ...
0
votes
1answer
80 views

Mapbasic set mapwindow for hotlink code to run

I need to run a hotlink process on a dataset but I keep getting a "Could not convert data" Map From DSC_DCDB Browse * from DSC_DCDB Set Map Window DSC_DCDB Layer 1 Activate Using PATH_Survey+...
3
votes
3answers
834 views

Mapbasic cycle through directory of tab files

I want to cycle through a directory of .tab files and then run a process on the files. I found https://groups.google.com/forum/#!topic/mapinfo-l/reYENsRRziM but can't figure out how to define the path ...
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 ...