Can you Explain , what is exactly mechanism of change Processor . i am asking because of , nesting of transaction is possible while nested change processor is not works properly ! why?
My advice is not to use it and use transactions instead. Transactions will let you group multiple steps into a single undo, which is all that most people want. The change processor mechanism is quite complex to implement and provides the same capability.
The reason the change processor functionality was added to the API was primarily for internal applications. The main thing that the change processor provides that transactions do not is the ability to create test scripts. These are used internally to test Inventor. How this works is that a registry setting is changed so that a test script will be created. You then use Inventor interactively and it records what you're doing into a transcript. This transcript can later be replayed to get the same result. This is useful for testing because a bunch of transcripts can be run and if they fail it means something has changed in Inventor to cause a regression.
These transcripts are not in a very user-friendly format and are certainly not in a programming language. It's basically a list of the commands that were run and the input. It's also capturing information to reproduce selections. Because of this, it must be run on the same part that the transcript was originally created with, so the geometry it expects is there.
What the change processor provides is a way for your add-in command to write out information to the transcript about what the command did. When the transcript is replayed, your change processor will be called by Inventor and provided this information so it can do the same thing it did when the user used it interactively.
If you just want to group commands into a single undo, which is mostly what 99.99% of use want to do, just use transactions.
The reason for the difference in speed is that the change processor is automatically creating a "global" transaction. You can also do this with standard transactions. Doing this I would expect the performance to be equivalent. You can read more about this in a paper I presented at Autodesk University several years ago. It's as easy to use as standard transactions without all of the complexity of the change processor.
Yes , I am strongly agree with you in the case of loop execution . For example if there is a loop with time complexity order of (n^2) or more than it ,then in this case transaction will gives you same result as Change Processor gives. But in the case of creating geometry , for example suppose we are coloring 500+ cavity or block simultaneously , in this case i experienced that standard transaction took 45 second while Change Processor took only 12 second to color all cavity.
That's why i am saying ! any way whatever you told about change processor it was new for me , that it is created for internal application . Thanks for it.
Can't find what you're looking for? Ask the community or share your knowledge.