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: 

Object data linked to external database

5 REPLIES 5
Reply
Message 1 of 6
JayGuengerich6556
1095 Views, 5 Replies

Object data linked to external database

For some reason, I can't seem to find all the right steps in the right order to accomplish this.  Maybe what I'm trying to do isn't possible.

 

Using either Map3D 2011 or Map3D 2007:

 

I have a database (SQL Server) and a drawing (.DWG) with object data fields.  For simplicity, lets say the database field names match the object data field names.  The key field in the object data is already filled in.  I would like to link to the database so the rest of the object data fields are filled from the database.  Is this possible?  If so, how?  The closest I have gotten so far is creating a link template and using mapod2ase, but that creates a separate set of Link Template fields instead of filling in the Object Data fields.  Any help would be greatly appreciated.  BTW, I'm the "IT guy", not the "AutoCAD guy", so specific menu/button names and sequences would be greatly appreciated Smiley Happy.

 

Jay

5 REPLIES 5
Message 2 of 6

From "IT folk" to "IT guy"

In my opinion, one of the simplest ways is this:

 

1] start over, erasing ALL the existing object data fields in your drawing

 

2] link the database records to graphic objects, by means of _ADEGENLINK command, configured in this manner

 

3] check the properties, it should appear like this

 

4] export to shape file (_MAPEXPORT) paying attention to the second tab DATA > SELECT ATTRIBUTES (like this)

 

5] open a blank drawing, and import the brand new shape (_MAPIMPORT) with these mandatory options

 

6] check the properties, it should appear like this

Message 3 of 6

antoniovinci,

 

Thanks for the step-by-step instructions.  I have 2 questions.

 

1) If I remove all the existing object data fields, how does it know which database record goes with which object?

 

2) This is a very large DWG file with many, many objects.  Most of them already have the correct object data.  Is there a way I can do something similar but only have it affect a smaller number of objects that I select?

 

Jay

Message 4 of 6

Answer #1 : Autocad links automatically the unique ID of one record, with the same ID enclosed as text in your drawn objects.

 

Answer #2: I have no idea how to accomplish it for a limited subset of the OD list, sorry...

Message 5 of 6
antoniovinci
in reply to: antoniovinci

I'd like to update the above dead links to the helpful images:

1] start over, erasing ALL the existing object data fields in your drawing

 

2] link the database records to graphic objects, by means of _ADEGENLINK command, configured in this manner

 

3] check the properties, it should appear like this

 

4] export to shape file (_MAPEXPORT) paying attention to the second tab DATA > SELECT ATTRIBUTES (like this)

 

5] open a blank drawing, and import the brand new shape (_MAPIMPORT) with these mandatory options

 

6] check the properties, it should appear like this

Message 6 of 6

There no built-in way to link Object Data to external data source (in your case, a SQL Server DB), The approach replied by antoniovinci is actually one-time import, which is OK if you only need to import the data from external DB once into drawing as Object Data.

 

However, if by "Linked" you mean Object Data in drawing could be updated when external data being changed, or the other way around, when Object Data is updated in drawing, you want external data also  to be updated, then, the only way to do it is, you must guest it since you are IT guy, to write some code/program. It can be done with VBA, LISP, .NET..., so that the user start a command, the code get data from the side of source of truth (drawing, or external DB) and synchronized it the other side.

Norman Yuan

Drive CAD With Code

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost