Saturday, August 29, 2009

Partial drawing

In AutoCAD 2009 you may run across what I term is a ‘bug’ when it comes to partial drawings. I have had an issue when starting a new drawing that it will actually start as a partial drawing. This can become annoying, especially if you have any customizations that may be dealing with layers. What is even more amazing to me is that this ‘bug’ has not been caught in any of the service packs.


In a nut shell, AutoCAD has a new variable - openpartial which is defaulted to 1 which allows you the ability to open a drawing in partial open. It is my feeling that when you are starting a new drawing, you should not have to be concerned that it has a ‘bug’, especially an inconsistent one that does not ‘show up’ all of the time. Therefore, in order to alleviate the worry of a ‘bug’, the very first thing that should be done is to change the variable to 0.

Partial open is suppose to work when the drawing is saved in paper space and the variable INDEXCTL is set to non 0.


The following are the definitions for these two variables:openpartial - Two conditions must be met for this system variable to have an effect. The drawing must have been saved with paper space displayed (TILEMODE is set to 0), and the INDEXCTL system variable must be set to a non-zero value.


Indexctl - To receive the maximum benefit of demand loading, it is recommended that you save any drawings that are used as xrefs with layer and spatial indexes.


The point I wanted to emphasize in this blog is if you do use partial open drawings, you need to be aware that your new drawings may start off with the ‘bug’ described earlier and you need to deal with it. If you do not use partial open, set both variables to 0.



Patrick Johnson

Labels: ,

Share it:  Del.icio.us |  Digg |  Reddit |  Yahoo |  Google

| 0 Comments

Sunday, August 2, 2009

Updating Sheet numbers

Updating sheet numbers in your Paper Space tabs automatically can be a challenge and time consuming when doing it manually -especially if you do not use the simple approach of 1 thru 10. Updating of your sheet numbers happens any time automatically when a template is added, deleted or changed. If you are using the scheme to give each sheet the same name as the Sheet Number (e.g. M1, M2, M3 for Mechanical drawings and E1, E2, E3, E4, E5 for Electrical drawings) and you want to label your drawings as (M1 of M3) or (E1 of E5) a new challenge arises when you remove a sheet or add a sheet and need to be able to update all the remaining sheets correctly (e.g. M1 of M4 when adding one additional Mechanical sheet).

CAD Enhancement Inc. has developed an application that automates the process of updating sheet numbers as described in the previous examples. This is one of those tools we have found helpful to eliminate the need to go into Paper Space objects and is extremely cost effective with a quick ROI.
If you are interested in implementing this tool at your facility all we would need is to review your sheet number standards.

Feel free to contact us if you have comments, questions or interest in this application.


Patrick K Johnson

Labels: ,

Share it:  Del.icio.us |  Digg |  Reddit |  Yahoo |  Google

| 0 Comments

Wednesday, June 10, 2009

Multiple languages - use of Dictionary and Xrecords

I’ve been seeing a lot of chatter on the internet about providing drawings in multiple languages. You may have noticed I touched upon this topic in my previous blog on Dictionaries and in one of the comments I was asked to elaborate a bit on how to use dictionaries and Xrecords to make this happen.

First, I feel the need to state this disclaimer; using the technique described in this blog will not translate English text to Spanish text or any other language automatically, you need someone that knows the languages to help set the text in each language. Also, the number of languages that can be stored in a drawing is up to the user.

As I mentioned in the Xrecord blog and the Dictionary blog, there is nothing available ‘out of the box’ to use these tools. These data containers must be implemented with the use of lisp and/or dot net. I recommend dot net for any AutoCAD version 2007 and newer. I would say that dot net is about 4 times faster than lisp and 100 times faster than VBA. You would notice the speed difference when you switch languages, especially for large drawings.

The following is a description in a step-by-step process for using dictionaries and Xrecords to create a drawing in multiple languages:

1.) The first thing you need to decide is how many languages you want to use in your drawing. The number of languages will be the number of Xrecords you will need per extension dictionaries.
2.) You need to build your set of tools to handle these different languages.
3.) You need to create an individual command that will set an extension dictionary and the Xrecords to each entity that holds text (dbtext, mtxt, dimensions, etc....) and set the current language text to the Xrecord.
4.) You need to create a command that will scan a whole drawing and set the extension dictionary and Xrecords to the text entity.
5.) You need to create a command that will display a dialog box that allows a user to add the text to each Xrecord. Note: This is where you would edit your different languages.You need to create a command that allows user to select what language to display in the drawing. Actually, this data would get stored in the NOD, the main dictionary of the drawing file.

Through the use of dictionaries and Xrecords you will keep your drawing much cleaner. If you move the text the languages will follow. It is much cleaner and user friendly than trying to manipulate with layers. There are more items that could be built into this, such as an interference check (some languages will require longer text strings) or create a batch routine to change a folder of files to the new language to display or set the dictionaries and Xrecords.We have all the logic to do this within our framework. There is so much more you can do and of course, we need to take into consideration that each company will want to add their own touch to this.

Feel free to contact us if you would like a collection of commands to work with your language issues in your drawings.
Patrick K. Johnson

Labels: ,

Share it:  Del.icio.us |  Digg |  Reddit |  Yahoo |  Google

| 0 Comments

Sunday, May 10, 2009

Dictionaries inside AutoCad

I am writing this blog on Dictionaries inside AutoCAD as follow-up to my last blog posting defining Xrecords inside AutoCAD. Dictionaries are containers in essence, that by themselves do not hold the data you intend to store and retrieve. They hold a variety of other objects that contain the data; Xrecords for example. Dictionaries can also contain other dictionaries; basically you can nest the dictionaries. Using dictionary and Xrecords is a means to store data that has no graphical representation - a means to what I call creating a smart drawing. You can store data for variables, create parametric drawings, store selection sets, etc.... Since the data is stored when you save the drawing, anything you store will be available the next time you open the drawing. To me the limiting factor is your imagination.

There are 2 types of dictionaries I am going to talk about, one being the Named Object Dictionary (NOD) and the other is an Extension Dictionaries.

NOD
This dictionary is the parent dictionary that owns all other dictionaries. This is where you should place data for the entire drawing so you can gain access to it at any time during your programming and know that it is drawing specific - I refer to this as global access. This dictionary will always be preset in the database. Since AutoCAD uses this dictionary for items such as mlines, you do not want to store your Xrecords directly into the NOD. You will want to create a dictionary that is specific to you inside the NOD where you will store your Xrecords. I believe this helps to organize your data more efficiently.

Extension Dictionary
This dictionary is nothing more than a dictionary that attaches to entities that store Xrecords which are entity specific. There is a lot you can do that is entity specific, such as point to other entities or possibly create entity specific standards. Here is an example of how I’ve seen an extension dictionary used: Consider you are working on a drawing in English and it needs to be read in both Spanish and English. You can merely attach an extension dictionary to the text entities that can hold both English text and the Spanish text and have the drawing update to either version. Of course, there is more involved to this process than just adding the extension dictionary – but the intention of the example is to help clarify how an extension dictionary can be used effectively.Hopefully this information helps to explain what dictionaries are and how you can use them with Xrecords to expand the ability of a drawing.

In the near future I will be sharing code examples to show you how to get at dictionaries, add dictionaries, add Xrecords, etc...

To share your comments and questions, please contact me or respond to this blog.

Patrick Johnson

Labels: ,

Share it:  Del.icio.us |  Digg |  Reddit |  Yahoo |  Google

| 3 Comments

Saturday, May 2, 2009

Xrecords - what are they

I have been surprised by the number of people who have no idea what I am talking about when I mention Xrecords. For that reason I am taking this opportunity to explain what Xrecords are.

The first thing we need to acknowledge is that an AutoCAD drawing is not only a drawing but it is also a database with graphical representation. For this blog topic we are going to talk about the database side of AutoCAD drawings.

Xrecords are a means to store data within the database of the drawing using group codes. In short, Xrecords are data containers that have no graphical representation. Xrecords can hold any data you desire and makes use of the same group code numbering system as the AutoCAD objects (lines, circles, etc...). This data can be as simple as a layer name to a class object that is serialized and streamed into an Xrecord. One common practice I like is to use Xrecords as a means to store variables such as width, height and length of an object and use it in equations within a program. The class object is quite powerful as it allows you to use the data within the Xrecord at anytime in your program such as for engineering calculations for a drawing that can be connected to a third party application.

Xrecords are created in two arrays, one being the group codes and the other the data itself. The size capacity for an Xrecord is huge. Xrecords are placed in dictionaries which, in turn, can be stored within the overall drawing file or attached to an entity. (Dictionaries and xdata are two items we will discuss in greater detail at another time.) It is important to note you cannot gain access to Xrecords from standard ‘out of the box’ commands in AutoCAD. Access to Xrecords requires programming ability.

When it comes to the use of Xrecords your imagination is your only constraint.

Please contact me or respond to this blog to share your comments and questions.

Patrick Johnson

Labels: ,

Share it:  Del.icio.us |  Digg |  Reddit |  Yahoo |  Google

| 0 Comments