Help with macro: extract render mesh

Hi There,

I have an intense nurbs model I need to export drawings from.

I am wanting to make a macro which does the following, but don’t know the syntax.

1- select all surfaces and polysurfaces a the selected layer,
2- extractrendermesh
3- delete the existing selection of nurbs geometry
4- select the meshes on that layer
5- join

Then I will do this layer by layer
Or this could be added into the script to run through all the layers.

If I have 500 layers, I will have 500 meshes, not 50,000 nurbs geometries.

-Jeremy

You won’t be able to do this with a macro, you will need a script.

1 Like

Thanks for the information. I wasn’t sure what would be required for this.

Cheers,
Jeremy

Here is a hack of a start… Don’t run it on any critical file until you decide it’s working 100%. Let me know if/where it fails. It will only delete the originals if they have some kind of mesh - preference for render mesh but will accept any other mesh. It does not consider any mesh or block objects on the layers, only surfaces or polysurfaces.

Edit: slight revision -
ReplaceLayerObjsWMesh.py (1.4 KB)

1 Like

identify layer be clicking one object → this macro will do the trick:
open _macroEditor
run it the first time from the macroeditor, then repeat with pressing space

_selNone
-_sellayer _pick _pause _enter
_extractRenderMesh
_delete
_sellast
_join
_selNone
1 Like