Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
8 posts
|
This post was updated on Apr 05, 2016; 5:59pm.
Hi all,
I am working to use libdxfrw library. I have gone through files involving writing of a line to DXF file. I created an instance of DRW_Line and set the values of the base point and second point of the line. DRW_Line line; line.basePoint.x = 10; line.basePoint.y = 20; line.secPoint.x = 30; line.secPoint.y = 30; qDebug() << line.basePoint.x; dxf->writeLine(&line); However, I could not achieve it. I have also referred the "testcp" the example given at SourceForge but it did not work either. The first thing I want to achieve is to write a line to DXF file. Please help me achieving this.
Mandeep Singh
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
489 posts
|
Mandeep,
here is an example https://github.com/rvt/dxfrwtest (we spoke on the LibreCAD IRC channel). modify CMakeLists.txt because I quickly hacked it together. For your sample you gave me, I would advice against trying to modify existing code when you are traying to understand something. It's usually better to start from 0 and learn from their then modifying existing code, change a lib and hope for the best... |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
8 posts
|
Thanks ries, I got this working. Thank you for the advice. :)
Mandeep Singh
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
In reply to this post by R. van Twisk
Various virtual functions have been included in 'ExampleWriter.h'. For an instance, virtual void addLType(const DRW_LType &data) override { } Why do one need to include the functions that are not even considered to be used in a project? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
489 posts
|
Mandeep,
As you can see here : https://github.com/LibreCAD/LibreCAD/blob/master/libraries/libdxfrw/src/drw_interface.h DRW_Interface is an abstract class. I this was was a design decision from Rallaz to ensure that when you overwrite DRW_Interface it ensures that the developer realises what methods are available for overriding. Don't forget that making a DXF also requires a special order of operation. You cannot 'just' write a line to DXF and forget about the rest, some specific items in the dxf need to come in a specific order. Using this abstract class ensures this order can be maintained and at the some time you can modify the DXF. There are other ways to accomplish the same, this is just one of the ways. Ries |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2 posts
|
Following the same example, I am trying to set the attributes of entities using variables.
Code for the same can be referred to at: https://github.com/kamalpreetgrewal/textToDrawing/tree/test In the file ExampleWriter.cpp, On calling writeLine function (dxfW.writeLine(&b);) in addLine, it crashes (seg fault). Can you help by pointing out my mistake. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
489 posts
|
What are you trying to accomplish?
I would suggest to start reading the code a bit better then trying thing's out. Also, as the readme of libdxfrw suggest in LibreCAD we do have an examples how to read/write DXF. essentially, you are using the library incorrectly. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
9 posts
|
In reply to this post by mandeep7
On 4 April 2016 at 17:16, mandeep7 [via LibreCAD]
<[hidden email]> wrote: > Hi all, @ mandeep, kamal can you come tomorrow? I want to know the work you are doing. May I involve in it? -- Jasleen Kaur jasleen7956.wordpress.com |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
8 posts
|
In reply to this post by R. van Twisk
Thank you. Now got it working. Please see if I am doing it right. https://gitlab.com/greatdeveloper/BuildD/blob/master/EntityWriter.cpp Couldn't make Polyline work for me. Can you please tell what parameters I am missing for this entity that need to be set.
Mandeep Singh
|
Free forum by Nabble | Edit this page |