Closed DeepankarGupta13 closed 2 years ago
this is what i got in dxf file
Hi,
Please try this:
// And for the image to show up it should be in same location as the dxf file.
const img = dxf.addImage(".\\door.jpg", 'door.jpg', point3d(20, 20, 0), 10, 10, 1, 0);
// Or use an absolute path so it will show up regardless of dxf location.
const img = dxf.addImage("C:/path/to/image/door.jpg", 'door.jpg', point3d(20, 20, 0), 10, 10, 1, 0);
You can take a look in the example code in docs
regards
sir, it's still not working same issue as above press enter to continue tried absolute path, move the file inside the src folder.
Can I ask how you visualize your dxf file
like this
Ok you are using AutoCAD. I can't reproduce can I have a look at your code if possible or an example producing the same result so I can investegate
these are the steps to attach image in autocad dxf
Note that I am also a AutoCAD user so I now how to use it. I jsut asked to know which softawre you are using. Autocad is the most good software at reading dxf files.
I asked about your code using my lib so I can investegate why you got that error
sorry, I misunderstood your previous msg.
the below is the dxf code i got after running the code https://docs.google.com/document/d/1fRXgNIQCfvl7kEYbahYuAJmAOhoUxlzoZaPWQQ1DeHE/edit?usp=sharing
and my code is this https://github.com/DeepankarGupta13/ThreeJS_Test/blob/dxfWriter/src/script.js
i am using vuejs
Did you push the changes I cant see where you are using addImage()
srry i shared wrong link i changed now this is the new link https://github.com/DeepankarGupta13/ThreeJS_Test/blob/dxfWriter/src/script.js
IMAGEDEF 5 1A 330 1D 102 {ACAD_REACTORS 330 1D 330 1C 102 } 100 AcDbRasterImageDef 1 C:/Users/deepa/OneDrive/Desktop/threejsPrac/ThreeJS_Test/src/test.png 10 1792 20 1280 11 1 21 1 280 1 281 0 0 IMAGEDEF_REACTOR 5 1C 330 0 100 AcDbRasterImageDefReactor 90 2 330 1B 0
this code was getting repeated in the dxf file i removed and it worked.
And why is repeated like that is it my lib doing that 🤔
i guess so, because i am calling the addImage() function only once.
I found the issue, these lines shouldn't be there 🤦♂️.
Also I am using AutoCAD 2013 is not complaining about this it opens the dxf with no errors.
I was adding those object twice so they getting serialized twice.
thanks sir.
i tried this
const imgDef = dxf.addImage("door.jpg", 'door.jpg', point3d(20, 20, 0), 10, 10, 1, 0);
the file gets download without any error but the file is not opening it says press enter to continue and after that nothing happens.
i consoled the imgDef i got this
pls help.