Importing STP and Exporting OBJ Issue

unhandled

(Edlawes) #1

Hi All,

First post here.

Wondering if anyone can help with importing .stp files into Rhino, then exporting them to OBJ format?

I’m working with CAD models in .stp format which have been produced in different software (Inventor and Solidworks I think) and I want to convert them to OBJ for use in C4D.

Everything seems to work OK but there seems be an issue with blocks/instancing.

When I import the OBJ files into C4D they’re missing some components, I presume these are instanced components and they’re not being exported as geometry?

The models look correct in Rhino so hopefully I can get them to export properly.

I’ve tried exploding the blocks in the hope that would make the instances show up in the export but no luck.

Can anyone help? (I’m a Rhino beginner sorry).

Cheers


(Pascal Golay) #2

Hello - can you post an example step file or send to tech@mcneel.com, or, zipped, via www.rhino3d.com/upload to my (Pascal) attention? The last two are confidential, this forum is public.

-Pascal


(Edlawes) #3

Hi Pascal, thanks for the reply.

Unfortunately I can’t send any of the files as they’re owned by clients (I had to sign an NDA).

I’m trying out Rhino as the mesh exports really well, I can get a nice hi-res mesh without any smoothing issues or bugs.

I just need to work out how the nested blocks function so I can export them properly.

Are there any general tips or tutorials I could use?

Sorry I can’t send any files.


(Pascal Golay) #4

Hello - ExplodeBlock may be what you’re looking for - try that before your export.

If the file is very complex and you need some control you can try this tool - it may get the nested blocks to a state that makes sense for exporting - drag and drop the attached rhp file onto Rhino and then use the
ExplodeBlocksToLayers command that it provides to explode things to separate layers - see the command line option for how it handles layers.
ExplodeBlocksToLayers.rhp (14.5 KB)

-Pascal


(Edlawes) #5

Thanks Pascal,

I’ve been experimenting with Explode Block, it seems to work within Rhino but doesn’t get all of the components to export to an OBJ.

I also found the explode to layers script earlier today but couldn’t tell if I was using it properly.

I may try and find an open source .stp file that exhibits the same behaviour and send that to you.


(Pascal Golay) #6

Hello - so what is your process - ExplodeBlock, then select the results and export to obj and some things go missing? Yeah, if you can some up with a file that shows the problem, please send it along.

-Pascal


(Edlawes) #7

I’ve got the Explode Blocks to Layers script to work now.

It starts to explode the layers and I see them filling up the right-hand layer window.

After a while however I get an error message saying…

Source: Microsoft VBScript runtime error
Error: Out of memory: ‘Rhino.lsLayer’
Line: 307
Char: 1
Code:

Any ideas?


(Pascal Golay) #8

Hello - try the plug-in posted above rather than the rvb script - it should be much more up-to-date. You’ll probably have to unblock the plug-in (in its Proerties) before dragging and dropping onto Rhino.

-Pascal


(Edlawes) #9

Thanks.

The plugin in works, I can run it straight after importing the .stp file.

It takes some time to unpack everything but it doesn’t create any extra layers, the objects are all in the same basic layer.

When I look in the Block Manager all of the objects are gone from there.

And when I try and export the obj file the same components are missing.

Odd.


(Pascal Golay) #10

Hello - use the command line option to change how layers are handled and yes, it destroys the block definitions, makes everything into ‘normal’ geometry.

-Pascal


(Edlawes) #11

It works!

I’m not familiar with the command line but worked out how to change the layer settings so all of the geometry appeared in the layer window.

I need to fine tune the obj export settings but finally I have all of the geometry.

Thanks so much for taking the time to help and replying so promptly.