­

Here I have added some bugs in AutoCAD I have run into and when possible a workaround for it as well.

  • Q: I get the following error:
    "FATAL ERROR: Unhandled Access Violation Reading 0x0004 Exception at 3009fd10h"

    A: This is related to objects from ADT in the drawing. It might also be in connection with use of dbConnect. It could be either visual or not visual ADT objects within the drawing. To fix the drawing run RECOVER. Then -WBLOCK using *.
     
  • Q: When using TRIM or EXTEND I get the following error:
    "FATAL ERROR: Unhandled Access Violation Reading 0x0000 Exception at 892a7ch".

    A: (Fixed in 2004) This occurs when there is an xref with custom arx-objects (could be from ADT, MDT or some 3:rd party application) that you try to trim to and you don't have that application installed or an Object Enabler for it. There is an error in AutoCAD's TRIM and EXTEND code in which it doesn't handle trimming or extending against a proxy in an xref properly. Workaround is to draw a temporary object and trim or extend to that one instead of the one inside the xref.
     
  • +OPTIONS default value doesn't work correctly. (Found in 2002 and is still there in 2006)
    Enter the command +OPTIONS and press enter you would suppose to get to the first tab but you comes to the second. To solve this you have to enter 0 as the Tab index to get it correct.

 

 

  • When creating a PDF with Adobe PDF Writer there might be problems if you're using TTF-fonts. You can notice the bug if you have TTF-text in modelspace and in paperspace having a viewport that clips the text. The text doesn't event have to be clipped, just close to the edge to be invisible in the PDF-file. Solution is to use Distiller instead.
  • Sometimes Adobe PDF Writer can crop/cut TTF-font-text even in paperspace. Solution is to use Distiller instead.
  • Q: True Type fonts plot beyond boundary of floating viewport when plotting layout. This only affects True Type Fonts.

    A: This might happen with some HP and OCE plotters. http://support.autodesk.com/getdoc.asp?id=TS47944

 

  • If you create a connection with dbConnect to a SQL Server you will run into problems if the table name is starting with numbers. Prefix the table name with a letter and it will work better.
  • Q: I have freestanding labels, linked to a database, in a drawing containing multiple lines of text
    (Description, Part Number, etc..). The labels are setup to be a specific width (i.e. 3").
    Is there a way to maintain the width of the labels when they are reloaded or can you
    programmatically restore certain properties of the label (i.e. the width) after reloading the label.

    A: After you reload, open the label edit dialog box and press OK.
  • Q: The scenario is the following. I have an Access 97 database with values that is not showed correctly with
    dbConnect. To reproduce it make a simple database with a table with values in a series
    like this: 0.01,0.02,0.03,...

    When looking at the values in Data View of dbConnect the values shows up
    like below:
    0.01,2.9999999999999999E-2,4.0000000000000001E-2,....,0.10000000000000001,
    etc.

    A: dbConnect is just reporting the number that Access stores.  Access is storing the number in industry-standard binary form, which entails conversion from and to the decimal numbers people keep insisting on using. Many numbers which are easily represented exactly in decimal form are infinitely repeating decimals in binary form and cannot be represented exactly in a finite number of binary digits. When you convert such a number from decimal to binary and than back again, what you get out is not exactly what you put in.  The ultimate problem lies in the fact that you're using a binary digital computer. At http://www.fmsinc.com/tpapers/math/ it's described in detail.

 

There is a bug in AutoCAD 2002 (fixed in AutoCAD 2004) that don't let you save changes to the registry by code. According to an Autodesk developer: "Looking at the code, we only save these settings via the Options dialog, closing down AutoCAD, or when we close all documents and enter a "zero-doc" state."

You will notice the problem by using any API command (Visual LISP or VBA) that should save the settings to the registry profile.

This workaround solves the problem. Run this code below before exporting a profile or setting it current or something like that by code, otherwise many setting will not be saved.

1) (getenv "Toolbars\\ACAD.TB_zoom")
2) Move the toolbar "zoom" manually
3) (getenv "Toolbars\\ACAD.TB_zoom")
4) Nothing happens
5) (startapp "wscript" "R:/OptionsClose.vbs")
6) (getenv "Toolbars\\ACAD.TB_zoom")
7) Now it works and you can see that the changes where saved to the registry!

But the above code will not work within one Lisp/VBA session since Options command can't be called transparently. The external code has to end with calling the rest of the internal code.

Below is an example how to do it from within VBA code:

Public Sub subExportProfile()
    Shell "wscript R:\OptionsClose.vbs"
End Sub
Public Sub subImportProfile()
    Dim preferences As AcadPreferences
    Dim currActiveProfile As String
    Dim strProfileToImport As String
    Set preferences = ThisDrawing.Application.preferences
    currActiveProfile = preferences.Profiles.ActiveProfile
    preferences.Profiles.ExportProfile currActiveProfile, _
"r:\TestProfile.arg"
    
    strProfileToImport = "TestProfile"
    On Error Resume Next
    preferences.Profiles.DeleteProfile strProfileToImport
    preferences.Profiles.ImportProfile strProfileToImport, _
"r:\TestProfile.arg", True
    preferences.Profiles.ActiveProfile = strProfileToImport
End Sub

Save the following code to a vbs file named OpenAndCloseOptions.vbs or you can make an exe-file in VB of it.

' Start from AutoCAD with
' (startapp "wscript" "r:/OptionsClose.vbs")
'   or from VBA with Shell "wscript R:\OptionsClose.vbs"
On Error Resume Next
Set AcadApp = GetObject(, "AutoCAD.Application")
Set AcadDoc = AcadApp.ActiveDocument
AcadApp.Visible = True
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate AcadApp.Caption
WshShell.SendKeys "OPTIONS ", True
WshShell.SendKeys "{Esc}", True
' Call the rest of the VBA code to continue
WshShell.SendKeys "{(}vl-vbarun ""subImportProfile""{)} ", True

 

I got a problem with the dialog boxes where AutoCAD 2002 and AutoCAD LT 2002 browses for files. It took more time than before and for folders with hundreds of files it took forever. It was so slow.

I checked with File Monitor from www.systeminternals.com and found the following. Compared to a PC where this problem where nonexistent AutoCAD where not reading the file stream information like SummaryInformation on each file in the folder.

4809 0.01369895 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg:
Raec25ph4sudbf0hAaq5ehw3Nf:
$DATA FILE NOT FOUND Attributes: N Options: Open
4810 0.01348607 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:
$DATA FILE NOT FOUND Attributes: N Options: Open
4811 0.01341148 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4812 0.01337544 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4813 0.01347238 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SummaryInformation:$DATA FILE NOT FOUND Attributes: N Options: Open
4814 0.01371934 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4815 0.01354194 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SummaryInformation:$DATA FILE NOT FOUND Attributes: N Options: Open
4816 0.01362073 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4817 0.01338829 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
DocumentSummaryInformation:
$DATA FILE NOT FOUND Attributes: N Options: Open
4818 0.01355787 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_DocumentSummaryInformation:
$DATA FILE NOT FOUND Attributes: N Options: Open
4819 0.03258022 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SummaryInformation:$DATA FILE NOT FOUND Attributes: N Options: Open
4820 0.01330169 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4821 0.01346875 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SummaryInformation:$DATA FILE NOT FOUND Attributes: N Options: Open
4822 0.01358357 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SummaryInformation:$DATA FILE NOT FOUND Attributes:
 N Options: Open
4823 0.02074817 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
SebiesnrMkudrfcoIaamtykdDa:
$DATA FILE NOT FOUND Attributes: N Options: Open
4824 0.01414593 acad.exe:1376 IRP_MJ_CREATE R:\4108\003.dwg\:
Docf_SebiesnrMkudrfcoIaamtykdDa:
$DATA FILE NOT FOUND Attributes: N Options: Open

Solution at last!

I hunted this down. I don't know what else this setting is for but by changing it everything works fine. Do you know what this byte do?

Set the two-digit value in the 17:th byte to 00. Many of the other bytes are controlled by settings that is controlled via Explorer > Tools > Folder Options > View.

Observe that you have to manually change this one byte in REGEDIT. You have to restart AutoCAD to have the effect.

Correct key below:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] "ShellState"=hex:24,00,00,00,20,28,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ,\ 01,00,00,00,0a,00,00,00,00,00,00,00,00,00,00,00

Erroneous key below:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] "ShellState"=hex:24,00,00,00,73,a8,00,00,00,00,00,00,00,00,00,00,05,00,00,00 ,\ 01,00,00,00,0a,00,00,00,00,00,00,00,00,00,00,00

Update: the bug still exists in AutoCAD 2004. Latest news is that I cannot replicate it. It might been fixed in a Service Pack.

 

I can't get the all different values extracted from the attributes.

I would like to have the three values STND-N-YY-1015;STND-N-YY-1010;STND-N-YY-1011 extracted.

The result below means nothing to me. How can it? I don't know in what drawing 'STND-N-YY-1010' comes from and the value 'STND-N-YY-1011' isn't showed at all, except as a number included in row 1. But that value shows 'STND-N-YY-1010'.

Block Name;Count;Attribute;AttributeValue
BLANKETTA4S;2;DN;STND-N-YY-1010
BLANKETTA4S~F:\try\STND-N-YY-1015-0.dwg;1;DN;STND-N-YY-1015

The result below looks more correct in my eyes then.
I get the attribute DN with it's value on each drawing. But this result doesn't come from EATTEXT

Block Name;Count;Attribute;AttributeValue
BLANKETTA4S~F:\try\STND-N-YY-1015-0.dwg;1;DN;STND-N-YY-1015
BLANKETTA4S~F:\try\STND-N-YY-1010-0.dwg;1;DN;STND-N-YY-1010
BLANKETTA4S~F:\try\STND-N-YY-1011-0.dwg;1;DN;STND-N-YY-1011

Autodesk answer on the above bug was:
"The reason why the CSV file looked something strange is because the same Block Name is existed in several files. So the same Block Name after the second file will append the filename at the end of the Block Name with a '~' in between. This is the behavior of the design for this command."

Another problem I have in a Swedish environment is that XLS-file from EATTEXT creates everything in one column instead of multiple ones.

Conclusion is that EATTEXT is useless for at least my needs.

Update: Unfortunately this was not making it to be solved for AutoCAD 2004 or AutoCAD 2005. But for AutoCAD 2006 it's almost solved. Everything seems to work well except it's not possible to get the file path and name extracted.

Have any questions? Contact us

­