Extracting structure information

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Newbee
Posts: 4
Joined: Fri Jun 26, 2020 1:18 pm

Extracting structure information

Postby Newbee » Fri Jun 26, 2020 1:23 pm

Are there APIs to extract structure, geometry information from freecad supported files including Step?
openBrain
Posts: 4213
Joined: Fri Nov 09, 2018 5:38 pm

Re: Extracting structure information

Postby openBrain » Fri Jun 26, 2020 4:24 pm

Welcome

Yes there are.
Depends which information, which programming language, ...
Newbee
Posts: 4
Joined: Fri Jun 26, 2020 1:18 pm

Re: Extracting structure information

Postby Newbee » Fri Jun 26, 2020 10:30 pm

What languages are supported? If I have a step file from Sw or CATIA, can I reconstruct the model without any information loss?
openBrain
Posts: 4213
Joined: Fri Nov 09, 2018 5:38 pm

Re: Extracting structure information

Postby openBrain » Fri Jun 26, 2020 10:40 pm

:? Not really clear.
STEP format is just a representation of the shapes. So basically all information about how the object was built is lost as soon as it is exported.
But FreeCAD will correctly open the STEP file.
Newbee
Posts: 4
Joined: Fri Jun 26, 2020 1:18 pm

Re: Extracting structure information

Postby Newbee » Mon Jun 29, 2020 9:35 pm

Sorry for being clear.

This is what I would like to do.

1. Create a model in FreeCAD and use a database to capture the details in the form of data as opposed to files. Are there APIs that I can use to extract information from a freecad file and then create a structural representation of the same in the database. If so can you please point me to some good resources/documents?

2. Given that the final 3d model might be huge, is there a way to layout the model initially as 2d drawings and then can the tool consolidate and generate the 3d model on demand?

3. In terms of comparing this to other commercial tools like Solidworks for example, what is the larges 3d model that could be created - question might be novice but just want to get an idea
johnwang
Posts: 348
Joined: Sun Jan 27, 2019 12:41 am

Re: Extracting structure information

Postby johnwang » Tue Jun 30, 2020 5:53 am

Database is still a file.
Last edited by johnwang on Tue Jun 30, 2020 12:21 pm, edited 1 time in total.
Newbee
Posts: 4
Joined: Fri Jun 26, 2020 1:18 pm

Re: Extracting structure information

Postby Newbee » Tue Jun 30, 2020 12:18 pm

Hi,
Thanks for responding. Not sure how it answers my questions. Can you please provide a brief response to my question so that I can look and understand the link you sent?
openBrain
Posts: 4213
Joined: Fri Nov 09, 2018 5:38 pm

Re: Extracting structure information

Postby openBrain » Wed Jul 01, 2020 12:31 pm

Newbee wrote:
Mon Jun 29, 2020 9:35 pm
1. Create a model in FreeCAD and use a database to capture the details in the form of data as opposed to files. Are there APIs that I can use to extract information from a freecad file and then create a structural representation of the same in the database. If so can you please point me to some good resources/documents?
:shock: So now, where does the "STEP" of your OP go ??? Which database ? MySQL ? PostgreSQL ? NoSQL ?
FreeCAD has a complete API where you can get all information for every object.
You can have a look at Macro TreeToAscii that browses both the model structure and object properties.
2. Given that the final 3d model might be huge, is there a way to layout the model initially as 2d drawings and then can the tool consolidate and generate the 3d model on demand?
Depends. Without more details, hard to tell.

You should provide an example with the starting point and what you expect from that.