Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

invalid or incomplete DXF input - drawing discarded

7 REPLIES 7
Reply
Message 1 of 8
rajeshpatnaik2001
3192 Views, 7 Replies

invalid or incomplete DXF input - drawing discarded

Hello

While opening a dxf file, i find the message

 Syntax error or premature end of file on line 943.
Invalid or incomplete DXF input -- drawing discarded.

 

I have a approx. 10000 dxf files. Is it possible to know which files are invalid without opening them?

Thanks.

Rajesh

7 REPLIES 7
Message 2 of 8

Hi,

 

>> Is it possible to know which files are invalid without opening them?

As long as you don't have any DXF evaluating engine ==> no

 

>> Syntax error or premature end of file on line 943

Show us the file or at least the lines from the DXF from 900 to 1000 (with marking which line is the 943rd). But the complete DXF would be better as we then also see the header information.

 

If we know the source of the problem and you want to scan the other files just for this specific problem it might be possible by opening the file and scanning through it for that situation.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 8

Thanks for your quick response.

I am not interested to fix the invalid dxf files. I just want to make list of dxf files which are invalid. All dxf files might be invalid due to different reasons.

In this particular dxf file, the 943rd line was blank. When i removed this blank line, this dxf was fixed.

 

Thanks

 

Rajesh

Message 4 of 8
stevor
in reply to: rajeshpatnaik2001

You could make a program, in any language, to open and read lines, and note the ones with a blank line.

 

S
Message 5 of 8
pendean
in reply to: rajeshpatnaik2001

Is the assumption the error is always a blank line in the DXF? No other fault exists?

 

Are you looking for an AutoCAD solution (reason you are posting here), something you run inside AutoCAD to go through a list of DXF files and tag ones with blank lines?

Message 6 of 8
Alfred.NESWADBA
in reply to: stevor

Hi,

 

>> read lines, and note the ones with a blank line

Be careful with empty attributes (or equivalent text-objects)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 8
rajeshpatnaik2001
in reply to: pendean

>>You could make a program, in any language, to open and read lines, and note the ones with a blank line.

The dxfs might be invalid due to different reasons. Also as Alfred pointed out blank line may not be always source of the error.

>>Are you looking for an AutoCAD solution (reason you are posting here), something you run inside AutoCAD to go through a list of DXF files and tag ones with blank lines?

 

Actually I am writing a lisp program to dxfin (or insert) the dxfs in a master drawing at specified coordinates. Ones the dxf is inserted, the lisp will do some other editing on it before inserting the next dxf file. The problem is when the lisp starts to process an invalid dxf, it stops without inserting the subsequent dxf files.

If it is possible to know the dxf files which are invalid, then i can remove them from the folder before runing the lisp.
Otherwise is it possible to write something in the lisp so that the lisp will run skipping the invalid dxf file?

Now the *error* function comes to my mind. Can I re-run the lisp inside the *error* function? I will have to test this possibility.

 

Thanks

 

Message 8 of 8
Anonymous
in reply to: rajeshpatnaik2001

Hi

 

maybe you can try solve the problem with vl-catch-all-...

 

(if (vl-catch-all-error-p (setq res (vl-catch-all-apply (function your_dxf_insert_function) (list your_parametr1 ...))))
  ;;BAD result you can add some actions here
  nil
  ;;OK result  you can add some actions here
  res
) ;_ if

 Best Regards

 

Stanek

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost