How to modify dimension values of a DXF and generate DXF modified

Hello!

I have a DXF file to which I want to modify some dimensions and then generate a DXF file with theses changes (not an image or a PDF).
Is this possible with ASPOSE.CAD for .NET? If it is possible, can you give me an example, please?

I ask this question about the write feautres, because in this link: NuGet Gallery | Aspose.CAD 23.9.0
In the documentation, there is a section like this:

‘’<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Read & Write
CAD: DXF
(Write features is partially supported.)
‘’<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I have questions about “write features is partially supported”. What are the limitations?

I hope you can help me, thank you!

@jguerreroatbertoni

Can you please elaborate the requirement details so that I may assist you further.

Please visit this documentation link for different examples entailing different features supported for DXF files in Aspose.CAD for .NET API.

Hello, @mudassir.fayyaz

I need to load AutoCAD DXF files and make changes in it and save it again as a DXF file.

Now I know that it’s possible:

Then, I made some entities updates. But when I open the modified DXF I can’t see those changes.

This is the code that I am using to modify and save the DXF

        using (var dxfFile = (CadImage) Image.Load(dxfFileStream))
        {
            foreach (var entity in dxfFile.Entities)
            {
                if (entity.TypeName != CadEntityTypeName.DIMENSION) 
                    continue;
                
                var dimension = (CadDimensionBase) entity;

                foreach (var variable in processedVariables)
                {
                    var baseVariable = variable.Variable;
                    foreach (var position in baseVariable.Positions)
                    {
                        if (!Equals(position.X, dimension.MiddleTextLocation.X) ||
                            !Equals(position.Y, dimension.MiddleTextLocation.Y)) continue;

                        dimension.Text = variable.Value.ToString(); //HERE I MODIFY THE ENTITY
                        
                    }

                }
            }

            dxfFile.Save("conic.dxf");

This is the DXF I am using:
EP_EKU_Combino 20 H (FS)_0419_A.zip (365.1 KB)

Thanks for your help!

@jguerreroatbertoni

Please provide the generated DXF on your end along with the expected one so that we may investigate that further on our end and resolve the issue if reproduced.

Hello, @mudassir.fayyaz !

I am sending you the requested files:

expected.zip (118.8 KB)

generated.zip (208.5 KB)

Regards!

@jguerreroatbertoni

The DXF files that you have shared are complex diagrams. Can you please possibly share the snapshot of two DXF files and highlight the difference between actual and expected DXF files.

Hello, @mudassir.fayyaz

I am sending you the requested snapshots:

expected.PNG (127.4 KB)

Generated.PNG (85.9 KB)

Thanks!

@jguerreroatbertoni

I have created an issue with ID CADNET-1208 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

1 Like

Hello!
Any news with this issue?

Thanks!

@jguerreroatbertoni

I regret to share that at present the issue is still unresolved. We request for your patience and will share the good news with you as soon as it will be fixed.

Thanks, @mudassir.fayyaz

Hope it gets resolved soon

Regards!

@jguerreroatbertoni

We will update you as soon as it will be fixed.

Hello!
Any news with this issue?

Thanks!

@jguerreroatbertoni

The associated issue is in progress and we will share the good news with you as soon as the issue will be fixed.

Hello!
Any news with this issue?

Thanks!

@jguerreroatbertoni

I regret to share that at present the issue is unresolved. We request for your patience and will share the feedback with you as soon as the issue will be addressed.

Hello!
@mudassir.fayyaz
Any news with this issue?

Thanks!

@jguerreroatbertoni

The concerned issue has been marked as resolved for upcoming Aspose.CAD for .NET 20.10. We will share the feedback with you as soon as the product will be shared online.