aspose-free-consulting / projects

The starting point for Aspose free consulting projects
5 stars 5 forks source link

I want to create/build a java application ()spring boot) to extraxt a room, bathroom and other type of room demenion from a dxf file #428

Open vishu1478 opened 1 month ago

vishu1478 commented 1 month ago

Please check if it satisfies the following requirements:

If your requirement is actually a bug in our APIs or a feature request for our APIs then please use our forum to report it and get quick help: https://forum.aspose.com/

If all the above requirements are satisfied then please move on:

< describe your free consulting project requirements briefly> I want to create/build a java application ()spring boot) to extraxt a room, bathroom and other type of room demenion from a dxf file

< which platform you're working on -- operating system, development environment etc.> java, windows

[dxf file.zip](https://github.com/user-attachments/files/16500778/dxf.file.zip)
OleksiiGor commented 1 month ago

@vishu1478, Hello. Could you please share the exact results (numerical or text) you need to obtain from these files. Please consider also posting this question in our public official Aspose.CAD forum which is the main place to get support.

vishu1478 commented 1 month ago

hi @OleksiiGor , Thanks for your response.

Requirements. I have dxf file, which i attached previuously. but now I am not able to attach. can I get you mail or any link where i can place this dxf file.

The required is I want create a sample project to learn how to extract different value from a dxf file which created from autocad.

This file consists information like different kinds of rooms(bathrooms, bedrooms ), kitvhen window, different floors. Si want to extract counts of each entity and dimensions of each entity like how many floors, bedroom, windows are there and what is their dimension like length, width and height. feel free to reach me out on my mail- agrawal.vishwajeet5@gmail.com Regards, Vishwajeet

OleksiiGor commented 1 month ago

@vishu1478, I can see your files, but it is better to upload them in our official Aspose.CAD forum as per my link above.

You can iterate over Entities collection of the DXF file to search for the desired objects, analyze their values and/or relations to other objects. Here is the brief example how to print values of MTEXT entities in the file.

final CadImage cadImage = (CadImage)Image.load(inputFile);

for (CadEntityBase baseEntity : cadImage.getEntities())
{
    // analysis of properties of each object
    if (baseEntity.getTypeName() == CadEntityTypeName.MTEXT)
    {
        CadMText mtext = (CadMText)baseEntity;
        System.out.println(mtext.getText());
    }
}

Please also note that the quantity of Entities is limited (100 only) without any license applied. You can request the temporary evaluation license here: https://purchase.aspose.com/temporary-license/. You can set it via:

License license = new License();
license.setLicense(fileWithLicense);
vishu1478 commented 1 month ago

Hi @OleksiiGor ,

thanks for the code snippet, but I am tryitng with similar approach but I am facing which version of aspose-cad shall I use, and what should be import statement, because I am not able to import these Java class.

I am not able to attach dxf file but some code snippets I have added. here

https://github.com/aspose-free-consulting/projects/issues/431

OleksiiGor commented 1 month ago

@vishu1478, Hello. Please find sample code with required imports in the attached zip. It was created using the latest 24.4 version of Aspose.CAD for Java which is available here: https://releases.aspose.com/cad/java/ example.zip

vishu1478 commented 1 month ago

Hi @OleksiiGor ,

can I get sample program to get all the floors, windows bathroom and their diemsion. from above code I am only able to read rooms

OleksiiGor commented 4 weeks ago

@vishu1478, I'm afraid you need to analyze the content of the drawing on your own, because you need to map items from Entities collection with your own information/meaning/understanding of "room", "floor", "window" definitions. There are no such definitions in the file, there is list of lines, texts, polylines, blocks, etc. Is the "room" object always (from your understanding) labeled with the MTEXT entity with text "ROOM"? If so, just calculate the quantity of MTEXT entities with this text in Entities collection and you will have the quantity of rooms. Is each "floor" object labeled with MTEXT entity containing "FLOOR"? Dimensions are stored inside TEXT, MTEXT or DIMENSION entities, etc. Probably, you will need to analyze another properties about positions of MTEXT (e.g., getInsertionPoint(), https://reference.aspose.com/cad/java/com.aspose.cad.fileformats.cad.cadobjects/CadMText), TEXT (getFirstAlignment(), https://reference.aspose.com/cad/java/com.aspose.cad.fileformats.cad.cadobjects/CadText), DIMENSIONS (getDefinitionPoint(), https://reference.aspose.com/cad/java/com.aspose.cad.fileformats.cad.cadobjects/CadDimensionBase), etc.

vishu1478 commented 4 weeks ago

Hi @OleksiiGor , Thanks for this insight, is there any tutorial /video toturial to study this library completely.

OleksiiGor commented 4 weeks ago

@vishu1478, We have Documentation page, API reference page and here is our official free support forum page.