AutoCAD Map 3D General Discussion

AutoCAD Map 3D General Discussion

Reply
Active Member
JayGuengerich6556
Posts: 7
Registered: ‎02-26-2010
Message 1 of 6 (657 Views)

Object data linked to external database

657 Views, 5 Replies
07-14-2011 09:07 PM

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 :smileyhappy:.

 

Jay

*Expert Elite*
antoniovinci
Posts: 1,644
Registered: ‎06-03-2011
Message 2 of 6 (649 Views)

Re: Object data linked to external database

07-15-2011 01:32 AM in reply to: JayGuengerich6556

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

Active Member
JayGuengerich6556
Posts: 7
Registered: ‎02-26-2010
Message 3 of 6 (637 Views)

Re: Object data linked to external database

07-15-2011 07:48 AM in reply to: antoniovinci

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

*Expert Elite*
antoniovinci
Posts: 1,644
Registered: ‎06-03-2011
Message 4 of 6 (631 Views)

Re: Object data linked to external database

07-15-2011 10:53 AM in reply to: JayGuengerich6556

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...

*Expert Elite*
antoniovinci
Posts: 1,644
Registered: ‎06-03-2011
Message 5 of 6 (269 Views)

Re: Object data linked to external database

07-12-2013 03:25 AM 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

*Expert Elite*
norman.yuan
Posts: 982
Registered: ‎04-27-2009
Message 6 of 6 (239 Views)

Re: Object data linked to external database

07-16-2013 07:04 AM in reply to: JayGuengerich6556

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.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.