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.
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.
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
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!