Page 1 of 1

DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 7:29 pm
by terrytmp
I just saved my recent changes and went to reload them and I find that some blocks have disappeared from the drawing. They still appear in the block list, and I can insert the blocks back into their intended positions and save the work again, but the same result when loading the DXF, they have disappeared and warnings on the command line about references to invalid blocks (though one of the disappeared blocks is not mentioned). There is also reference to a spline with less than 4 control points. Not sure what that means, unless it has something to do with blocks I have rotated?

Code: Select all

$ qcad 
Debug:    RDxfPlugin::init 
Debug:    RExamplePlugin::init 
Debug:    TransactionListenerPlugin::init 
Debug:    TIMER:  41 ms -  "loading add-ons" 
Debug:    TIMER:  461 ms -  "initializing add-ons" 
Debug:    TransactionListenerPlugin::postInit 
Warning:  RDxfImporter::import:  block reference references invalid block:  "door-gusset-mid" 
Warning:  RDxfImporter::import:  block reference references invalid block:  "door-gusset-mid" 
Warning:  RDxfImporter::import:  block reference references invalid block:  "door-h-strut-mid" 
Debug:    RSpline::isValid: spline not valid: less than  4  control points 
Debug:    got transaction 
Debug:    got transaction 
Debug:    got transaction 
Is it possible to edit the DXF by hand to recover the 'invalid' blocks (or some other automatic GUI driven method)? I was hoping re-saving the work under a new name would at least remove the problems. Let me know if any more information can be provided.

I am using QCAD 3.4.5 on Arch Linux installed via Arch's package manager 'pacman'.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 7:59 pm
by terrytmp
I've tried to isolate the cause of the 'RSpline::isValid: spline not valid: less than 4 control points' message. See attachment.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 9:32 pm
by Husky
Hi terrytmp,

this is more an information than a solution:

Have you seen this:
viewtopic.php?f=33&t=2725&p=9248&hilit= ... lock#p9248

and this: :wink:
http://www.ribbonsoft.com/bugtracker/in ... ask_id=998

... I assume that we just have to wait for the next release!

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 9:39 pm
by andrew
Thanks Husky. I think this is more likely a dxflib issue (note that terrytmp is using the free community edition, not QCAD Pro).

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 9:52 pm
by Husky
andrew wrote:... note that terrytmp is using the free community edition, not QCAD Pro.
Oops - I didn't realize that. :oops:
Thanks Andrew!

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sat Jan 18, 2014 10:36 pm
by terrytmp
I just tried recursive blocks and its completely different behaviour. Three blocks in my design are deemed invalid by QCAD but they remain in the block list. I tried removing everything except the offending blocks but the problem must have been caused by something I'd removed as I was then able to use the 'invalid' blocks (but as everything else from the drawing was gone not very useful).

However the contents of the blocks was able to be copied into new blocks and used that way, and with the old blocks deleted.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sun Jan 19, 2014 12:25 am
by terrytmp
Ok, here's what I'm doing which seems to be causing problems:

Creating a part, a block, call it 'door'. It's a frame for a door built of wood, two tall lengths, and three short lengths (top, middle, bottom). I create one block for the two tall lengths, and another for the three short lengths. Arrange within block 'door'. Turns out height all wrong. Edit the tall length block, changing y/length values as appropriate in property editor. Save. Reload. Invalid blocks.

Obviously doing this within a larger project. Not only adjusting door, outer frame too, (forgive lack of construction/architectural terms here), as well as wall panel heights. Most if not all altered blocks are invalidated now, as well as others not touched.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sun Jan 19, 2014 10:03 am
by andrew
Thanks for the details terrytmp. Do you have an example drawing demonstrating the problem (i.e. saved before the problem occurred) with brief instructions on how to reproduce the problem (e.g. change length of line at the right in block "block01", etc.)? Thanks.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Sun Jan 19, 2014 10:57 pm
by terrytmp
Hi Andrew, I will PM you a couple of files. Thanks.

Re: DXF not loading correctly: invalid blocks/spline

Posted: Thu Jan 23, 2014 5:16 pm
by terrytmp
Hi,

Were the files I sent you no good? I unfortunately did not have the data saved as a seperate file just before the corruption happened, and I don't have enough time to to experiment with trial-and-error trying to find a minimal version of the file which is just enough to cause the problems. I sent them to you anyway with the hope you might have a DXF file tool which could be used to debug them. Are they presenting the same problems I am having, for you on your machine? Is the pro version of QCAD better able to handle them?

I also wondered if maybe I was being a bit over-enthusiastic with turning things into blocks? (Not that that should be to blame for the file problems).

Any thoughts?

Re: DXF not loading correctly: invalid blocks/spline

Posted: Fri Jan 24, 2014 12:07 pm
by andrew

Re: DXF not loading correctly: invalid blocks/spline

Posted: Mon Jan 27, 2014 4:12 pm
by andrew
This should be fixed in the current master branch (effectively fixing nested blocks).