Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hatching based on ms access information

Status
Not open for further replies.

revster

Technical User
Apr 13, 2005
4
0
0
US
I am working on a project where I update furniture/office layouts with the occupants name and hatch departmental areas. The names and departmental information are contained in an Access Database. Linking the name to the drawing and displaying as a label is not a problem. I would also like to hatch the areas depending on the department listed in the database. Is this possible? If so, what set up steps do I need to take? I assume I need to create polylines around each unique space but do not know where to go from there.


Thanks,

Chris
 
Hi Chris,

Yes this is possible, you'll to know some VB/VBA to make it all happen but it's doable.

You obviously have some information in your database regarding the the departments, from there, you'll need to decide how your going to size and place your polylines (or hatching boundaries), and then from there it's a fairly simple matter to add hatching.

If you can identify these items and maybe give a little more detail as to how you are already linking the database, we might be able to give a more "nuts and bolts" answer.

HTH
Todd
 
Todd,

I am still developing the database but will have a table with names, business units, departments, sub-groups and room number. In my autocad drawing I will put my polylines around each individual room. I wish to link these polylines to the coorsponding "room number" in access and read the "department" and "sub-group" fields to create my hatch color and pattern.

I will also be reading the "name" field from the same table and inserting it as a label into the drawing. This part I have done before, using dbconnect, creating a label templet and then creating the links between the drawing and the table.


Thanks again,

Chris

 
Hi Chris,

Do you know any VB/VBA? Take a look at faq687-5800 and see if you think that's something you'd be comfortable doing.

Reason being, if I remember right, dbConnect won't do anything other than labels, so you'll need some code to handle your hatching. It's not terribly difficult but it is involved.

Let me know...
Todd
 
Todd,

Sorry for the delay in replying, this is only one of may projects on my plate. My database is set up and populated and I am able to pull in the names and depts into AutoCad through dbConnect, (the easy part of my dilema). They are inserted as labels and not directly linked to any objects.

I have not used any VB/VBA, but it does not appear too complex. The FAQ document has usefull information, but not exactly what I am looking for. I need to know how to tie the polylines, (each one to a seperate record), in my Access database, populate the squarefootage field, and then pull the departmental information from a seperate table or query to create the hatching. This will need to be done for all workstations, offices and rooms. If I can get it set up once, I am sure I can duplicate it over and over.


Thanks,

Chris
 
Hi Chris,

All you'll need to do is figure some way to uniquely identify your polylines. If you can, just turn your polylines into blocks with a hidden attribute, then, when you collect all of your boundaries, you just read the hidden attribute to determine which polyline (or office area) it references. If you can't make them blocks, then, I would use xdata to identify each polyline.

Let me know what you think...
Todd
 
Turning the poly's into blocks should work. I can name the block with the room/workstation number. This way each polyline is referenced to the item it surrounds as well as the cooresponding record in Access. I have set up a few already. Is this going to make my dwg huge? With the label links and polylines, (only 4 turned to blocks), the dwg is 2x the original size.

I looked up the xdata command but do not fully understand it. Thanks again for all your help.


Thanks,

Chris
 
Hi Chris,

If you create each boundary as a separate block, your drawing will probably grow quite large depending on how many blocks you have stored in it. A better approach might be to use one block, and scale it appropriately for each area. This way, you have only one block defined in your drawing instead of several, this will help keep the size down and may actually make your drawing size less.

For more information on using xdata in AutoCAD VBA, look up SetXData, and GetXData.

HTH
Todd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top