This is in reference to ADT and VBA and how events are handled with the Properties dialog. How is everyone working with detecting ObjectModified when it comes to Extended Data (Property Set) editing. The only event that is fired is ObjectModified and no End command. I can populate a collection telling me objects have been modified but I can't do anything to them like edit the Prop Set items since the object is open and locked. Anyone found a work around for this or a wrapper that detects when the properties dialog editing as ended. I have not found anything on ADN and I doubt I will get an answer till the new year. I am going to my Visual Studio tools to see if I can work with the Prop Dialog window. Thanks and Happy New Years. -- Rob Starz Stardsign cad solutions www.stardsign.com ADTcadPacX4 now available for ADT 2004 www.stardsign.com/adtcadpacx.htm
Check the threads in the customization group. I demonstrated a technique of sending a redraw command during the objectmodified event that seems to work. It is still only a workaround.
Doug, I have been looking for 2 hours and I can't find you post. do you have a url to it or can you repost (email) it. I need a quick fix for now while I get the code together to hook into the Properties window messages. Thanks -- Rob Starz Stardsign cad solutions www.stardsign.com ADTcadPacX4 now available for ADT 2004 www.stardsign.com/adtcadpacx.htm
That is what I thought you would write for the redraw. That is not going to work since you can edit more than one object and having the redraw forced while ADT has 4 event calls for 4 objects on each edit. I have the hook for the Properties window and should be able to get the text edits. wish me luck and thanks for the help. -- Rob Starz Stardsign cad solutions www.stardsign.com ADTcadPacX4 now available for ADT 2004 www.stardsign.com/adtcadpacx.htm
Hi Rob, If you look closely, only one redraw will fire, no matter how many objects are modified. You need to maintain a static global (I think) if you change it to VBA. The modified event triggers the redraw (once) and collects the objects into a list to be processed at the commandended event. Let me know what you come up with. I'd like to see it. You're welcome. Regards, Doug
Looks like Rob has a point. Multiple objects can be edited using Properties (or the object properties toolbar controls), and that would cause your code to generate a 'REDRAW' for each one. I'm not sure that would be considered a workaround. I said from the outset that this problem was extremely difficult to solve even in ObjectARX (one theoretical approach is to spawn a worker thread that uses a Windows API called WaitForSingleObject() to get signaled when the active document's thread goes into an idle state). Not in LISP though....
Tony, See my response to Rob. A global is required to make sure that only one "redraw" is fired. Technically the command might also be another silent command like John U. demonstrated a week or two ago. Can VBA be used with that WaitForSingleObject() operation or is that just ObjectARX(C++) ? Have you been able to come up with an acceptable approach with either LISP or VBA? Regards, Doug Happy New Year.
You are already talking over my head and API on ROT and Windows is new for me. Tell me if I am looking in the correct area when I want Hook into the WIndows messaging system and grab a callback from the Properties window. I have can get the Properties window through API and now I am reading up on grabbing the Windows messaging callback. This is my first time using Spy++ and the list of windows messages that gets spit out is enourmous. I am weeding through the options to only return the areas I think I am looking for. Am I on the right track...or way off. Good Idea on the WaitForSingleObject(). I will look into that. I am wondering if less resources would be used with grabbing the Prop window directly. Thanks for the input. -- Rob Starz Stardsign cad solutions www.stardsign.com ADTcadPacX4 now available for ADT 2004 www.stardsign.com/adtcadpacx.htm
My fading memory failed to account for your fix for the multiple objects problem. However, here's one of several hypothetical scenarios that would probably fail: (defun C:FOO () (while (eq 5 (car (setq p (grread t)))) (modify-object-using p) ) ) The string fed to the command line (regardless of what it is, including wacky high-bit ASCII), will just be gobbled up by (GRREAD). But the larger and almost intractable problem is AutoCAD 2004's full UNDO/REDO. Autodesk (including the ADN folks), have for a long time been advising us to resort to the incredibly kludgy commandEnded() nonsense. Now in AutoCAD 2004, it is very clear just how unsound that advice has proven to be, because it breaks full UNDO/REDO.
Rob, I am not sure what you are trying to build, but perhaps you may want to make your own properties form instead of using the ACAD one. Many people, myself included, really do not like the ACAD one. If you are interested in changing values on multiple objects you can always just do that with it, but you have to add code to add those additional features that are not available through arx. In this scenario you now have a form that may contain many properties that you are not even interested in seeing and so it may take up more real estate that you want. Changes made to multiple objects though a user form would still be able to take advantage of the full undo/redo of ACAD. If not, you may want to try and ask in arx for a code snippet, as accessing/modifying the properties form in arx is difficult, but quite common. Dave
A new Prop Dialog is out of the question since the Prop dialog offers so much for ADT objects. I now have the WM_ callbacks and I need to figure out what value is what event. -- Rob Starz Stardsign cad solutions www.stardsign.com ADTcadPacX4 now available for ADT 2004 www.stardsign.com/adtcadpacx.htm
Good luck Rob, I can see your point. It was explained to me by the only OEM carrier of ADT that Autodesk did not allow them to modify or retrieve data in anyway that was not already in their object model. For instance: Stretching an ADT object without using their code or calculating the size of an object by processing the points in space. This tells me that resources that you probably need or could use (in the way of information) would most likely be in limited supply. This is the drawback to a proprietary or custom object. You are really at the mercy of what they want to expose. I think this approach of limiting information for developers to use goes against the grain of encouraging third party development. Perhaps they want to make sure that only they can have the slickest code and/or are afraid of being embarrassed by an outside company finding a better way to use their platform. This is just speculation and hold no real merit. especially because it starts off with what I was told and I do not know how true it really is. Being as their is only one OEM of ADT I cannot call another one and ask them to look at their contract and let me know if the same clause is in it. This does not mean you cannot do it though, unless you have signed some sort of similar agreement. I think you will pull it off, just expect things of this nature to be a newer area with less information available. I wish you the best and good luck! Dave