I'm currently using the xamMap to display a floor plan of a building. Each desk will need to be given a unique reference in the AutoCAD drawing, which should be exported to a ShapeFile via Cad2Shape. Essentially the desk references will be mapped against users in a SharePoint directory, and their details displayed when their desk is clicked on, etc.
However - I don't know how to create the polygons in AutoCAD with a desk reference that will be exported out to the ShapeFile? Currently when I export the drawing to shapefiles, it seems each polygon is given an ID, which I can use - but my client wants to use specific desk references. Any ideas how I can create these in AutoCAD to be exported to the shapefiles?
...or am I going about this the wrong way??
Hi Davros85,
I am not sure how this can be achieved in AutoCAD, I believe you can create custom properties for your shapes. Another option will be to edit the shapefiles and add the desk reference for each object. Please taka e look at this page about creating and editing custom shapefiles: http://help.infragistics.com/NetAdvantage/DV/2011.1/CLR4.0/?page=xamWebMap_Creating_and_Editing_Custom_Shapefiles.html
HTH,
Ivan Kotev
Ok, that's cool thanks - i've got a copy of MapWindow GIS now, so I can test my shapefiles and hopefully add my custom attribute there.
One other thing - I've mocked up a test in AutoCAD, and used Cad2Shape to export the polygons from a specific layer to a shapefile. It all seems to work ok, and exports 27 objects - and I can open the file in MapWindow GIS and it looks great (27 desks).
However - as soon as I use it with XamMap it renders the screen blank. At the point of MapLayerImportAction.End it tells me that there are 27 elements in the layer - but I can't see anything on the screen??
Here is the sample code i'm using:
XamMap xamMap = new XamMap();
this
.LayoutRoot.Children.Add(xamMap);
MapLayer
layer_pol =
new MapLayer();
layer_pol.Name = "layer_pol";
xamMap.Layers.Add(layer_pol);
ShapeFileReader reader_pol = new ShapeFileReader();
reader_pol.Uri =
"ShapeFiles/BLUESOURCE_pol";
layer_pol.Reader = reader_pol;
Could you try with my shapefile / give me an idea? It works successfully with others I have used in the past...
Cheers.