Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: vb.net - dxf issue

  1. #1
    Member
    Join Date
    2012-01
    Posts
    12

    Default vb.net - dxf issue

    I've got a vb.net program that reads coordinates in from an excel file. It places blocks (dwg file) that are called into autocad at the coordinates read from the excel file.

    The program appeared to function well until I stumbled across an issue with the generated autocad drawing. Once the program is complete and all the blocks are drawn in autocad I can save the file as a .dwg file and open it again without issue. The problem I'm having is when I save the file as a .dxf file (2000, or 2007 version) and try to open it again in autocad, I'll get a message like the following:

    Error in BLOCK_RECORD Table
    Invalid symbol table record name: "" on line 1824.
    Invalid or incomplete DXF input -- drawing discarded


    I really don't even know where to start looking to resolve this. Why would the .dwg file be fine (or so it appears) but the .dxf file has this issue??

    Thanks,
    Rob

  2. #2
    AUGI Addict
    Join Date
    2006-12
    Posts
    1,495

    Default Re: vb.net - dxf issue

    Does the DWG file pass a call to AUDIT?
    If you are going to fly by the seat of your pants, expect friction burns.
    Windows XP is now over 10 years old, in software terms it makes Joan Collins look like the new kid on the block. - Statler
    Everyone else being wrong is not the same thing as being right.

  3. #3
    Member
    Join Date
    2012-01
    Posts
    12

    Default Re: vb.net - dxf issue

    Quote Originally Posted by dgorsman View Post
    Does the DWG file pass a call to AUDIT?
    I don't really know what "AUDIT" is. I would assume not.

  4. #4
    Forum Manager, Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    4,776

    Default Re: vb.net - dxf issue

    AUDIT is a command that checks the dwg file for errors. Its under Drawing Utilities menu in the Quick Access Toolbar. You may not be inserting the blocks properly or one of the blocks has issues. The AUDIT command should tell you which one.
    C:> ED WORKING....

  5. #5
    Member
    Join Date
    2012-01
    Posts
    12

    Default Re: vb.net - dxf issue

    Thanks for the help guys.

    After auditing the generated drawing in autocad the "errors" were all fixed and I was able to save and open the dxf without issue.

    I notice that if I list one of the blocks inserted into Autocad prior to running the audit command the block name is an empty string. After running the audit command the block names are assigned "audit......" which apparently fixes the issue.

    Inserting this same drawing using VBA, assigned the file name as the block name by default. That's not the case with vb.net.

    Now I have to figure out how to send the audit command via vb.net.
    Application
    .AcadApplication.audit() doesn't seem to do anything.

  6. #6
    AUGI Addict
    Join Date
    2006-12
    Posts
    1,495

    Default Re: vb.net - dxf issue

    I usually recommend to my users to run AUDIT at least once a day on every drawing they open, either right after opening or right before closing. Keeps the roaches from multiplying too far out of control so they can be stepped on rather than calling the exterminator.

    I wouldn't count on an AUDIT to fix these, but rather fix the originating problem instead. Perhaps the block name you are passing is getting reset/not set or throwing a error thats not being caught?
    If you are going to fly by the seat of your pants, expect friction burns.
    Windows XP is now over 10 years old, in software terms it makes Joan Collins look like the new kid on the block. - Statler
    Everyone else being wrong is not the same thing as being right.

  7. #7
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,211

    Default Re: vb.net - dxf issue

    Quote Originally Posted by robtemp View Post

    Now I have to figure out how to send the audit command via vb.net.
    Application
    .AcadApplication.audit() doesn't seem to do anything.
    Try to use Sendcommand in seperate Sub
    Code:
                       Dim cmd As String = String.Format("_audit{0}N{0}", " ")
                           doc.SendStringToExecute(cmd, False, False, False)
    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  8. #8
    Active Member Kerry Brown's Avatar
    Join Date
    2006-08
    Location
    Brisbane : GMT+10
    Posts
    87

    Default Re: vb.net - dxf issue

    Quote Originally Posted by robtemp View Post

    Error in BLOCK_RECORD Table
    Invalid symbol table record name: "" on line 1824.
    Invalid or incomplete DXF input -- drawing discarded


    I really don't even know where to start looking to resolve this. Why would the .dwg file be fine (or so it appears) but the .dxf file has this issue??

    Thanks,
    Rob
    Open the DXF file in a text editor ..navigate to the nominated line ( 1824 in the example)
    You'll find that a block probably does not have a name .. ie ""

    I'm surprised that the runtime does not spit the dummy at you.
    Without seeing your code we're guessing.
    Perhaps you need to set come exception handling that has a neaningful statement in the catch segment.

    Have you tried to debug the code and stepping through the operations.

    Can you identify from the DXF file the blockRecord that is causing the error ?
    another Swamper

  9. #9
    Member
    Join Date
    2012-01
    Posts
    12

    Default Re: vb.net - dxf issue

    Quote Originally Posted by fixo View Post
    Try to use Sendcommand in seperate Sub
    Code:
                       Dim cmd As String = String.Format("_audit{0}N{0}", " ")
                           doc.SendStringToExecute(cmd, False, False, False)
    ~'J'~
    Thanks. I just changed the "N" to "Y" and it worked perfectly.

  10. #10
    Member
    Join Date
    2012-01
    Posts
    12

    Default Re: vb.net - dxf issue

    I'm not sure I know what you mean by opening a dxf with a text editor. I can use the list command in autocad to see that the blocknames are an empty string. The Audit command assigns a name to the blocknames.

    So how can I assign the blockname? I tried to assign a block name but it's a readonly property. My VBA macro assigned the blockname as the file name without any added code on my part.

    One thing I probably need to change with my code is that for each line of data it reads from excel it calls my Insertblock routine which goes through the entire transaction..blocktable creation etc.. each time.



    Quote Originally Posted by Kerry Brown View Post
    Open the DXF file in a text editor ..navigate to the nominated line ( 1824 in the example)
    You'll find that a block probably does not have a name .. ie ""

    I'm surprised that the runtime does not spit the dummy at you.
    Without seeing your code we're guessing.
    Perhaps you need to set come exception handling that has a neaningful statement in the catch segment.

    Have you tried to debug the code and stepping through the operations.

    Can you identify from the DXF file the blockRecord that is causing the error ?

Page 1 of 2 12 LastLast

Similar Threads

  1. add value issue
    By prose in forum AutoLISP
    Replies: 4
    Last Post: 2011-03-31, 07:12 PM
  2. WU3 Issue
    By azmz3 in forum Revit Architecture - General
    Replies: 13
    Last Post: 2009-01-25, 12:59 AM
  3. SP1 Issue
    By Clyne Curtis in forum AutoCAD Land Desktop - General
    Replies: 2
    Last Post: 2007-09-04, 10:56 PM
  4. Titleblock - issue date and type of issue placed in issue column
    By jdrexler in forum CAD Management - General
    Replies: 4
    Last Post: 2006-04-10, 05:01 PM
  5. ADT 3.3 to R14 issue
    By dgriessmann.86073 in forum ACA General
    Replies: 1
    Last Post: 2005-04-19, 09:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •