Is it possible to import step files through code?

Is it possible to import step files through code?

ballingsimon
Observer Observer
270 Views
1 Reply
Message 1 of 2

Is it possible to import step files through code?

ballingsimon
Observer
Observer

Hi,

 

I am developing a plugin that allows you to import models into your scene.

What I am trying to do now is to get a step file from a database and add this model to the current scene.

 

Is this possible to do without using the import command? I want to hold the file in memory so I dont have to work with local files. As far as I can tell, the import command always needs a file to open. Also it requires user interaction

0 Likes
271 Views
1 Reply
Reply (1)
Message 2 of 2

tatetopggg
Observer
Observer

@ballingsimon wrote:

Hi,

 

I am developing a plugin that allows you to import models into your scene.

What I am trying to do now is to get a step file from a database and add this model to the current scene.

 

Is this possible to do without using the import command? I want to hold the file in memory so I dont have to work with local files. As far as I can tell, the import command always needs a file to open. Also it requires user interaction


Yes, you can import STEP files programmatically without relying on the import command or local files by using a CAD library like Open CASCADE Technology (OCCT). Such libraries allow you to parse STEP file data directly in memory, avoiding the need for user interaction. To achieve this, you can fetch the STEP file from your database as a byte stream or in-memory representation, and then use the library’s APIs to load and convert the data into a 3D model. This model can then be added to your scene programmatically. By using a library with robust STEP file support, you can bypass file system dependencies and streamline the integration process into your application.

0 Likes