VISUAL BASIC MEETS MAPINFO

VISUAL BASIC MEETS MAPINFO

Anonymous
Not applicable
663 Views
7 Replies
Message 1 of 8

VISUAL BASIC MEETS MAPINFO

Anonymous
Not applicable
Hi There

Has anyone out there had any experience with using VB to convert contours derived from Mapinfo 7.8 into polylines with elevations? The contours are coming in as a block with attributes for each contour but when exploded the height information is lost. We would like to assign attribute values to the polylines.

Thanks
Sue
0 Likes
664 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Sue,

I haven't had any problems doing this at all. Although, I use Map to do this and define a query. In the alter properties section of Map assign the height object data to the polyline elevation.

You need to export the contours out of MapInfo as a *.mif file though. Quite easy to do - I've previously done 700km² of 5m contour intervals (ranging from sea level to 970m) with no problems other than chewing up the memory.

Morgan.
0 Likes
Message 3 of 8

Anonymous
Not applicable
Thanks Morgan

We have a copy of Map in another office so we'll give that a go.

Cheers
Sue
0 Likes
Message 4 of 8

Anonymous
Not applicable
Hi there

One of the other girls in the office has been looking into this so I'll pass on her post below:

We’ve been successful in loading the *.mif files into Autodesk Map, where the attributes are being correctly stored in an object table. However, I’ve been unable to write a query to take the elevation from the object table and assign it to the polyline. I tried the Define>Query menu, however when I go to the object data radio button, there are no tables listed (but if I go to the Map>Object Data>Edit Object Data, the table and all the data are there. Also, if I execute the query, it comes up with a ‘no active drawings’error.



Would you be able to give me a couple of quick directions on how to write a query which will change the elevation of the polylines?



Thanks so much for your help – I’m a complete Map novice.


Cheers,

Kate
0 Likes
Message 5 of 8

Anonymous
Not applicable
Hi,

You need to define a drawing set. Do this by Map->Drawings->Define Modify

Do this within a new blank drawing and define the drawing with the object data in it.

Then within this blank drawing set the property alterations within the define query area. You should have something like this... Elevation : :Height@Cont1

Make sure that the query mode is set to draw otherwise it won't work. When you execute the query it will draw the entities and give it the elevation associated with it.

Morgan.
0 Likes
Message 6 of 8

Anonymous
Not applicable
Thanks Morgan

I'll pass that on and see how it goes.

Many thanks
Sue
0 Likes
Message 7 of 8

Anonymous
Not applicable
Thanks so much for your help – we’ve been successfully importing files from MapInfo to dwg as polylines with elevations, however we’ve just hit another snag. We have a file that for some reason won’t import into Map, using exactly the same process that’s worked for all the others. When you import, the command line displays a message saying “0 objects imported in 0 seconds”. However when I open the mif in MapInfo, there is definitely data in it. We’re importing the mif to a new layer, with the attributes assigned from the relevant table. I’ve also tried importing without the attributes from the table, but we’re having the same problem.



Any ideas what might be causing this?
0 Likes
Message 8 of 8

Anonymous
Not applicable
Hi,

I'm unsure how this error could be occuring. I suggest double checking that the "Draw" radio button is selected and not the "Preview" button in Map to begin with. If that isn't the problem I can only suggest re-exporting the table out of MapInfo as a *.mif and go through the same process again. Hope it works.

Morgan.
0 Likes