First, regarding the performance difference you see between automation and the internal DxDesigner functions, I'll tell you what I think it is, though I'm not certain. What I think is that we do not have access to the same information as viewdraw.exe has in memory. We can get it, but we have to go through the sheets and objects on them first, request data from them, process it, then if we are to make a change, we send it back by way of the COM intermediary. Viewdraw.exe holds all the data all the time, and can write to the database or read from it directly without needing to query sheets and symbols and properties. Again, I don't know this to be a fact, but suspect it's something of that sort. No other way it could be so fast in comparison with our COM transactions.
Second, about the common properties issue you're seeing. I'm curious if you're using DxDatabook. If so, have you tried the verification windows in DxDatabook to verify component properties match what's in the database? Also, if you are using Databook, it's just as easy (and much faster) to query the DxDatabook database directly, load what you need into memory, then compare the components to that. The entire database can be read into datatables in memory in a couple of seconds, then all that information can be accessed very quickly until the application is shut down and the data in memory erased.
If you are not using DxDatabook, I'm unclear how your parts are getting unwanted properties. If you can fill in more detail about your environment's architecture and how it is that these parts came to have bad data attached to them, it would be helpful to point you in the right direction. If it's a systemic problem then I would look to a different architectural approach to your environment.
thank you for answering my post.
First I agree with you that accessing DxDesigner via COM interface is quite slower than directly in memory. But do you know if there is any information on how to improve script speed?
- If I forget to close the properties window although I use 'application.visible=false' I can see the script updating this window for each property while looping all component properties in the design. This decreases the script speed. Can I hide the properties window via script or do I have to do this manually?
- Are there any other window related functions than
Application.SilentMode = True
Application.Visible = False
to supress GUI output during the script execution and speed up the script?
- To collect all hierarchical sheets in the design I use
For Each objComp In Application.DesignComponents("", sTopBlock, "-1", "STD", True)
sPath = objComp.GetName(0)
sSchematic = objComp.SymbolBlock.GetName(2)
new_dictPaths.Add sPath, sSchematic
to store all schematics in a dictionary and traverse all sheets by using
For Each sSheet In Application.SchematicSheetDocuments().GetAvailableSheets(sSchematic)
Application.PushPath sTopBlock, sPath, sSheet
Gathering the schematics takes quite long (about 2 minutes). Is there a faster method to get this information or are there any ways to speed up this code?
- Is there any way to run the 'Find And Replace Text' DxDesigner function from my script? This function runs very fast and has an built-in option to find non-common properties.
Second you are absolutely right. We are using DxDatabook.
The problem we encountered is a new added database column in SQL which one of my collegues forget to add to the "Property Definition Editor" of our central library. So DxDatabook appended the new property as an non-common property to our components without any warnings.
As we recognized the failure we added the missing property to the library property definitions. But we couldn't find a way to correct the non-common properties with DxDesigner Verification. If I now run Verification it appends a second property with the same name as the corrupted but no non-common property flag (see below "Temperature Coefficient"). The non-common property remains untouched :-(
So the DxDatabook Verification doesn't seem to work for this issue and I have to solve this either manually or with VB script.
1 of 1 people found this helpful
Dennis, please get in touch with me offline. I have a tool I call DxDatabook Utilities. It has a number of functions to address similar problems. I'll share with you.
It was some ago that I made the tool, so I don't remember everything it does or if it directly solves this issue. The basic objective was to reconcile differences between parts and their properties in a schematic and the properties in DxDatabook for those parts.
If nothing else it may give you some ideas of how to approach the issue a few different ways. Send me an email at email@example.com and I'll get it to you.
Regarding your specific questions above:
1. I could not find a way to close the Properties window with automation. You may be able to do it with UI Automation tools, or the simple way, pop up a message asking the user to do it in return for a faster execution.
2. Are there any other window related functions . . . What you see in the help for the application object is what you get. Nothing else I know of.
To collect all hierarchical sheets in the design I use . . .. Is there a faster method to get this information or are there any ways to speed up this code?
Not that I know of. That's how I do it.
Is there any way to run the 'Find And Replace Text' DxDesigner function from my script?
Not that I know of.
What I do is something like what I described which I believe ViewDraw does - collect everything you need at once, store it in memory, then do the work as needed. That saves the step of going through sheets and parts every time you want to get something before doing the work on it. You can virtualize every object in the design using your own classes, dictionaries, lists, arraylists, and so forth. An example of this behavior can be seen in my 'Find parts and Pins tool. There's a video of it working here.
2 of 2 people found this helpful
Just one update on this. In VX.2.1 we have added the capability to update non-common properties automatically, Idea D6337 (Update non-common properties - D6337 ).
Once you add the non-common property to the property definition file - running Tools - Update other objects - Properties will correct the existing properties in the design.