Closed ThomUK closed 4 years ago
I believe I have found the problem.
I needed to add a return to the addBlock() method, so that the newly created block is returned, allowing an entity to be added to it:
$dxf = new \DXFighter\DXFighter();
$circle = new Circle([10, 10, 0], 7.5);
$block = $dxf->addBlock('testBlock');
$block->addEntity($circle);
$insert = new Insert('testBlock');
$dxf->addEntity($insert);
I am going to keep making some other changes. I have never done a PR before, but would you be interested in a PR for this and other small improvements that I make?
Hey Thom,
nice that you got it working and I would love to see a PR for this and other small contributions to the project. I've created this Project some years ago for a startup I've worked in but had nothing to do with DXF (besides to small requests here in the project). Therefore I love seeing people using and contributing to the library. So if you have adjustments feel free to open a PR. If you need help in any way feel free to contact me.
Greetings Joe
Hi Joe,
My adjustments are over several commits to my fork, starting from this one... f36d930e686d8fd243110636324dcfaf72a4c6d4
I'm new to this, and my formatter has made lots of other changes in the commit. Is there a good way to overcome that, or shall I make a new branch with the changes but without the changes to the code-style formatting? Sorry, I'm new to this.
Also, what is the best way to run the tests so that I can check / update / add to them?
Sorry for the Qs! Thom
(I'm closing because the original question is answered now)
Hi,
Do you have any examples of how to insert a block into a drawing? The classes seem to be written, but I can't use them to produce a valid dxf file.
I think: Tables section needs a block record. Blocks section needs the block, drawn block entities, and an endblk. Finally the Entities section needs an insert entity to define the position of the block.
Have you got this working, and could you share example code?
Many thanks!