Notifications
Clear all
[Closed] undo xrefs.addNewXrefObject
Jul 09, 2007 11:04 pm
Is there a way to undo adding an xref object? here is a cleaned up version of my code:
with undo on
(
File_1 = "C:\\objects\\buildings\\object.max"
Object_1 = "Object_1"
Xref = "Object_p" New_Object = xrefs.addNewXrefobject File_1 Object_1
New_Object.proxyfilename = File_1
New_Object.objectName = Object_1
New_Object.proxyobjectname = Xref
)
The tabing is messed up, but anywho…
Even with using “with undo on”, i’m still unable to undo the creation.
Now if i make an instance of this xref object, i am able to undo that..but i'm not unable to undo the initial creation. Can someone explain why?
Thanks for your time.
2 Replies
Jul 09, 2007 11:04 pm
It appears that this function is not undoable… Creating an instance (or copy) of the imported object might actually be the best solution (read: hack) to this. Pseudo code:
1. with undo [B]off[/B] [i]import xref object[/i]
2. with undo [B]on[/B] [i]create copy of imported object[/i]
3. with undo [B]off[/B] [i]remove imported object[/i]
Since only step 2 would be recorded into the undo stack, undoing this action would appear to undo the import. While in fact only the copy action is undone.
Hope this makes any sense
Martijn