BUG: undo/redo import does not import changed DXF file

I’m dealing with some dynamically generated DXF files and ran across this problem. If a file changes on disk and you undo/redo the import, the changed file isn’t imported. The previous file’s content – no longer on the drive – is loaded.

Rhino 5.0.2 (5A865), OS X 10.10.5 (14F27)

Import DXF file
Change DXF file
Undo Import (CMD-Z)
Redo Import (SHIFT-CMD-Z)

Hi Jet - Rhino holds the contents of the imported file in the undo stack, it does not re-rerun the import command. I think it is behaving as designed…


I would say that a Redo on an Import should redo the file import, not pop the previous data off a stack. If I want to re-import a file there’s a dialog/selection step to choose the same file. Is there a way we can re-import a file without going through that dialog process?

I can see why the behavior you described would work for your specific situation, but Pascal is correct. The command is doing what it was designed to do.

Experience has shown that Rhino doing what it’s designed to isn’t always the best thing for the customer base.

Could you describe for the rest of us why the designed behavior is the most appropriate?

I’m pretty sure it was a performance decision.
The idea was.
1 - You do something
2 - You change your mind
3 - You change your mind about changing your mind

Since we don’t track full history like a solids modeler does, I’m not sure it’s even possible without a major rewrite. I don’t think this has ever been requested before.

From what I read it would seem that you are not changing the geometry that comes into rhino (else undo would undo the changes). I’m not a block person and I cannot try right now but couldn’t you insert the file as a linked block that can be updated when the file changes?

I think that John describes a basic design path for undo/redo in the UI. What I’m looking for might be a different definition of “redo,” maybe defined as “repeat previous command”.

I do a complex action
I undo the action, so restore the previous state
I redo the complex action and do not restore the results from the first time I did the complex action

Imagine querying a database – you do a search, undo the search, then do a new search. If the database has changed you’ll want the results of the new search, not the information returned in response to the first search.

A couple possibilities come to mind…
One would involve using SaveIncremental before the import, and if you change your mind, opening the file in the saved state prior to the action. This would be in Windows. In Mac Rhino you could revert to an earlier version of the file.

Another would be to Undo and then Purge the block definition from the file so a new Insert would import it again.

Either of these would be time consuming but they would give the desired results I think.

I came up with something not too complicated, I need to learn how to turn this in to a script/button

select-all, delete
start the import by typing "IMP"
have the import window sorted by “Date Added” so the file I want is on top
type the first letter of the filename then hit return

While you are at it, you might want to look at: http://developer.rhino3d.com/guides/rhinopython/get_started_with_rhinopython/

Automating your task is a great way to get into Python on Rhino for Mac. Your particular task is really well defined so I think it is a great candidate for a custom script and there should be plenty of documentation to get you where you need to go. A lot of what you will need doesn’t depend necessarily on Rhino. You would probably need to look up how to retrieve a list of files in a directory as a sorted list (ascending or descending) by date. From this list you choose the file modified most recently. A couple of things, like remembering the last used directory and or file could probably also be implemented in the script.

One of the reasons I went with Rhino on the Mac is the switch to Python. I’ve been writing software and doing UI work for years and have been extremely frustrated with the limitations in commercial software when it comes to scripting actions and making macros. Now we just need a REXX option for Rhino and I’m set for life!