Would it be possible to add an option to “Shrink Trim Surfaces” when exporting NURBS geometry to formats such as IGES and STEP? Doing this greatly reduces my exported file size, but I don’t want to lose that information in the native 3dm file.
It might make more sense for you to make a button with a little command macro that runs Shrink first, continues as the IGES export, then runs an Undo for the Shrink.
Another option would be to use Incremental Save in the macro.
This is not a request I’ve heard before, and since it is such a widely used tool, I’m hesitant to suggest major changes that might cause unintended consequences.
That is actually slightly tricky but this might help
! _Select _Pause _ShrinkTrimmedSrf Export _MultiPause _Undo
The only problem being that if all surfaces are already shrunk, then the Undo will go past that to whatever you did previously.
-Pascal
Thanks John/Pascal,
I wasn’t sure about the level of effort, so I thought I’d just through that out there. Currently I just make sure I save the file before my export, then close it afterwards. I’ll likely try to put a script together to run a shrink-export-undo task.
Hi Bennet - see if this does what you need -
ExportShrunk.py (1.5 KB)
@Bennett_Scarborough - cleaned up here to trap bad objects.
To use the Python script use RunPythonScript
, or a macro:
_-RunPythonScript "Full path to py file inside double-quotes"
-Pascal
That seems to work sometimes, but I get an error on some parts.
Message: 00000000-0000-0000-0000-000000000000 does not exist in ObjectTable
Traceback:
line 1065, in coercerhinoobject, “C:\Users\scarboroughb\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 1569, in SelectObject, “C:\Users\scarboroughb\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 1599, in SelectObjects, “C:\Users\scarboroughb\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\object.py”
line 24, in ExportShrunk, “C:\Users\scarboroughb\Downloads\ExportShrunk.py”
line 31, in , “C:\Users\scarboroughb\Downloads\ExportShrunk.py”
Hi Bennett - can you send me a part via PM that does not work right?
Just in case, I added a trap for extrusion objects - it now skips those in the shrinking part - the previous version attempted to treat these as breps and choked. Updated above.
-Pascal
Here is a part that seems to error out one me.
testpart.3dm (608.2 KB)
Hi Bennett - that file has some bad objects and I cannot make a new shrunk version in the script from bad objects - I’ll add a check so these are simply skipped as far as shrinking goes , and the script let you know which ones to check.
Fixed above.
-Pascal
Gotcha. I fixed the bad surfaces and the scripts seems to work fine. Thanks!