Manipulate AutoCAD Objects based on Database Data

Manipulate AutoCAD Objects based on Database Data

KevinCollinsNEI
Contributor Contributor
1,598 Views
7 Replies
Message 1 of 8

Manipulate AutoCAD Objects based on Database Data

KevinCollinsNEI
Contributor
Contributor

First off: I'm a total newbie to GIS/AutoCAD MAP, short of importing and using SHP files from various locations.  I'm very knowledgeable in AutoCAD and Civil 3D, but I'm hitting a brick wall and need some help.

 

Goal:  Create a drawing with many (200+) polygons from a collection of polylines that represent property boundaries.  These polygons would have data linked to them from an Access (or SQL) database table/query.  Based on the data, the polygon's border and fill will change (different colors and patterns) and an identifier from the database would be placed in the center of the polygon.  I would like to have it so that when the database data changes, the appearance of the respective polygons change.

 

I can get the data linked to polygons, but I can not do the rest of the process.  It appears as though most of the commands depend on object data rather than linked data and I can't find the proper resource to get me past that problem.

 

Any help or pointers to get me moving would be appreciated.

0 Likes
Accepted solutions (1)
1,599 Views
7 Replies
Replies (7)
Message 2 of 8

parkr4st
Advisor
Advisor

Can you post an example of the data, maybe a couple of the polygons with the linked data?

0 Likes
Message 3 of 8

nkg2
Collaborator
Collaborator

Have you tried setting your conditions within the style itself?  Looks like the data is there as you pointed out but your style is not updating to what you want. 

***Viewer/Reader Discretion is Advised***
Autodesk 2025- Architectural, Engineering and Construction Subscription & Infraworks
Windows 11 Professional, x64, Microsoft Surface Studio 2
0 Likes
Message 4 of 8

KevinCollinsNEI
Contributor
Contributor
Accepted solution

So throughout last night and today I've been able to solve our issue.  Let me explain.

 

To Manipulate Objects Based on the Data from the Database: I used the information provided on this page.  The key is the objects I need to manipulate needed to "queried" into a new drawing to make things work.  This means I'm going to end up with a drawing with JUST the property boundaries (polylines or polygons) with the linked data.  Then in a different drawing,  I will have several queries, as described in the linked page, altering those boundaries to create the "style" I need for the map I'm creating.

 

Getting Annotation Added to the Boundaries Based on Data from the Database:  This is the craziest thing ever, for two reasons.  First, I used this guide, which in step 6 says to click "Edit Annotation Text" on the ribbon.  Problem is that tile doesn't exist.  Luckily, the guide listed the command as well and I was able to key it in to get things running.  The second issue is that once I created my annotation template and told my query to use it, all I would get was a "0" instead of the tract number.  (That field in the database was defined as an "integer" data type.)  To get this working, I discovered that the data type for the database field needed to be either a "real" number or string/text.  We altered a query in the database to convert the tract number to a string and now the annotation template works.

 

While my goal is achieved, I'm surprised that I had to jump through these hoops to get it accomplished.  I just hope that I've described the process well enough here that I help someone else.

Message 5 of 8

nkg2
Collaborator
Collaborator

Yes it is not very user friendly unfortunately.  Glad you got it resolved.  

***Viewer/Reader Discretion is Advised***
Autodesk 2025- Architectural, Engineering and Construction Subscription & Infraworks
Windows 11 Professional, x64, Microsoft Surface Studio 2
0 Likes
Message 6 of 8

parkr4st
Advisor
Advisor
0 Likes
Message 7 of 8

ChicagoLooper
Mentor
Mentor

Congratulations achieving your goal. Yes, object data and queries are undervalued tools and deserve better understanding and utilization.

 

Depending on the 'label' you are trying to pull out of the object data you may, or may not, even need to go through an annotation template since you can produce text directly from the object data itself bypassing the annotation template altogether. While it is true that an annotation template can access object data to produce a label, a label which you, in turn, will use as a parcel identifier, a more streamlined way is entirely possible. 

 

The key is to describe, without generalizations, what you are trying to achieve. Your detail in explaining your result as well as your willingness to disclose your 'data' so your target outcome can be easily understood and replicated by others will be highly beneficial and expedite an appropriate work flow akin to 'best practice' protocol. 

 

As it is now, you have developed your own work flow but have stumbled as per the third paragraph in your original opening post. Have you considered whether the work flow itself is suitable for your goal? If you consider an anno template an improvement to your work flow, you must also consider whether using it comes at the expense of overall efficiency. Is the anno template the soul reason you needed to jump through more hoops? Can your goal be achieved without the anno template? 

 

You have composed verbiage explaining your work flow but have not given equal representation to the behavior needed in your target outcome. Your work flow to manipulate objects begs the question: Is it ‘a’ solution or is it ‘the’ solution?  

Chicagolooper

EESignature

0 Likes
Message 8 of 8

O_Eckmann
Mentor
Mentor

Hi,

 

A little screencast to explain how you can create a thematic map from data stored in a DataBase linked to CAD objects and how to update dynamicly this map after modifying data from AutoCAD. I've made screencast with Access DB but it works with any connection.

 

For annotation template, you can use lisp expression "itoa" to convert integer to string for using this type of data. 

 

Olivier

Olivier Eckmann

EESignature

0 Likes