AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linking Polyline to Database Record and Exporting to Shp file

4 REPLIES 4
Reply
Message 1 of 5
dwolford
788 Views, 4 Replies

Linking Polyline to Database Record and Exporting to Shp file

I have a database that I am linking records to polyline objects in a AutoCAD Map 3D 2010 and then exporting to a shape file. For nearly all of the records and polylines I am having no issues and it is working fine. Prior to exporting to a shape file when I test each record in the Dataview it correctly selects the appropriate polyline in model space. However after exporting to a shape file and connecting to the shape file using FDO the polylines associated with ID = 192 and ID = 193 are not in the database Table and the polylines that should have been associated with ID = 192 and 193 are now associate with ID = 194. I have used the Link Manager numerous times to delete the record links to the polylines and then recreated the links and reexported to a shape file, but the missassignment still occurs. When I select the Feature associated with ID = 194 on the FDO shape file it gives me a Geomettry type of MultiLinestring. If I check out this feature and then Extract Geomettry from the feature it will display the polylines for ID = 194, 193 and 192 as separate polylines. I do not understand why the polylines for 192 and 193 are included in the 194. I have attached a subset shp file is zip format that includes both a polyline and a text layer. On the text layer use the variable TEXTSTRING for the label as it will identify what polylines should be associated with which ID's. Thanks for your help.
4 REPLIES 4
Message 2 of 5
phmurphy
in reply to: dwolford

Is there something about the difference in the way you label these?
194
193
192
ID = 190
ID = 191

Also, some items are lines, and some are polylines. Change them all to polylines then redo the link template.
Message 3 of 5
dwolford
in reply to: dwolford

There is no significance to the method in which I labeled, other than I was not consistent. I will give that a try, thanks. I also have this issue submitted into the subscription center. I spoke with someone who said I was one of two people in the world who managed to make this happen. The file I uploaded is only a small subset in Michigan and my dataset covers the continental US. This issue also occurs elsewhere in my database. Regardless the point you are making is that this error occurs because I am linking records to lines and multiline strings in some cases and polylines in others. When this error occurs I should ensure that all of my features/objects (terminology) that I am linking to the records are polylines and not lines.

Dan
Message 4 of 5
matTech
in reply to: dwolford

I know a Wolford in Grand Rapids. Relation?
Do you want your polylines to be polygons or lines? There is no such thing as a polyline SHP file, it's an AutoCAD object.I have an option you can try. What I do is take the excel file or database and add two new columns at the end for x and y coordinates. Fill it with zeros.
Turn the layer into a polygon or line SHP file and connect using FDO. Now connect to the excel file with ODBC. This is usually done to map out points. Select x and y for lat and long. The table will now show up on your map with all the points at 0,0. This doesn't matter though. Now do a join and bulk copy the results to a shapefile. Bulk copy to shp is the only issue I ever have so you may have to do it SDF first then SHP later. If you need any help let me know. I'm pretty free right now and would write up a tutorial if you needed one.
Message 5 of 5
dwolford
in reply to: dwolford

No direct relation, but if you go back sometime in the past his family tree and my family tree will merge. I did some of my geneology on the Wolford side back to Germany.

Only problem with that method is that it won't provide database links from each individual record to one or multiple polyline objects. And yes I select the Line option in the SHP export, but the original objects are polylines. Regardless AutoCAD tech support solved part of my problem and the explanation form tech support follows below:
________________________________________________
AUTOCAD MAP TECH SUPPORT RESPONSE:
The Map Import function writes additional information to AutoCAD entities (Xdata is just a way to add extra information to a drawing database and its entities via the API) to maintain the relationships from the source application/format. An example which might apply here is that you can group objects in ArcView I have an open SR with a customer that has a data set in a Shapefile that he knows has a few sets of these groupings. He expected the Import Export process to break these groupings. This utility specifically sets this special extra information on the AutoCAD entity to null which essentially removes that entity from the 'aggregation'.

The person who wrote the utility has been kind enough to make it available so that selection sets of multiple objects can be cleared. I have added this file to the SR. The function is REMOVEMAPIMPORTGROUPS.

You would use this to clear (null) the specific Xdata for objects you know to be aggregated. If you wished to remove the aggregation from all entities for the import I’d isolate the AutoCAD layer and run this utility with a window crossing.

I have tested this with some data you sent. In the test.shp file you will see that the 9 entities were exported as 7 features. In the testxdataremoved.shp all 9 entities are discrete features after clearing the Xdata value for the aggregation.
_________________________________________________________________________
My comments:
After using the LSP file to remove the extraneous data, I successfully exported the SHP file where each record was properly linked to the proper polyline objects. The only caveat is that when I attached multple polyline objects to a single record in the exported shape file it duplicated that record for each of the multiple polyline objects. I would prefer that all of the polyline objects for that particular record would result in only one record being exported (ie the polylines would be grouped). I don't think AutoCAD Map can currently do this, but I am certain that the ESRI software.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost