1 of 1 people found this helpful
You can directly output all parts in those partitions to HKP file and import back to the new partition in Library manager. It only needs senconds to finish your task
Of course, you also can write the script to do same thing, but it doesn't make sense.
1 of 1 people found this helpful
If you haven't already completed this task...
You can accomplish this with Library Services.
Define your "Import" and "Current" partions.
In the import partion section, click on a line item, hold the shift key and click on another line item. This will select a range of items. Holding the control key will select individual line items.
Change your "Mode" to "Move" and click on the > between the 2 partions. Everything selected will move from the "Import"artion to the "Current" partion.
If you want to move everything, all you have to do is click the >> button between the partion listings.
Here is what I got from Jerry Suiter:
Support for Library Services automation is in our development roadmap but is not planned for 7.9.2. We are working now to determine a target for delivery.
So go the HKP way if you want to automate the process or use the library manager to do it with the GUI
Thanks for all your reply. But the problem is I have a excel table on hand with about 1000 parts in more than 5 partitions that need to be moved to another partition and I don't know these parts in which partitions. So if I use the HKP way or library service I still need to search each part and select it while holding Shift key. This may be faster but still time cost and I may missed some parts. What I want is a batch processing tool that can import the excel table or I can copy and paste the part numbers and then move these parts together at one time by a single click or command. May be in the coming furture Mentor can add a similar utility into Library manager.
It is not what you expected. It something we used to migrate or to insert new parts in the PDB.
These scripts generates PDB partitions out of DxDatabook.
This implementation expects inside DxDatabook: Symbolname, Part Number, Cell Type (from Expedition).
I have a script that I believe does what you want. This is the part of the interface which has this functionality:
What it does is let you either input a single part number to move, or load a list (from a text file, 1 part number per line). You can either specify the "From" partition or check the box that will search the entire library for that part number. You specify the "To" partition and all the parts in your list are moved to that partition.
It works by means of creating hkp files, deleting the old part, and re-importing the hkp into the new partition.
If you think this will do the trick for you, I will send you the script. It also does other things you might not be interested in, but you can ignore them.
patcashman at gmail
I think it is exactly what I want. Please send me the script and I hope it works for me
could I have a copy too?
Thanks and Best Regards
bbpcbdesign at tin.it
How does your script work with HKP? I havn't found any automation documentation on library services. It would be very interesting for me, if this already works. The only way I saw, was to extract every property and object of a part, delete the old part, generate a new part and then add each of the property again.
Could you post your script here or send me a PM?
Here is the source code for the move part to a new partition routine.
A few warnings:
This script writes to the Windows registry. It adds a key that identifies the location of the library you want the script to run on. Do a search in the code for the word regkey and you'll find all the places that do this.
The code was written with Sharp Develop. It's a free IDE that works with vb.net and some other languages. I believe it is fully compatible with VS but I do not know that for certain.
I have never had any training on vb and therefore I don't normally follow some of the conventions I've seen in other people's code. I try to maintain order in the code but I generally do it how it makes the most sense to me. If you find something unorthodox, don't be surprised.
The read_file function returns an arraylist, with each line of the file as an element in the arraylist. As a general rule, I work with arraylists whenever possible, because there is a lot less effort involved in adding and subracting elements from them than normal arrays. I also generally work with tab delimited text files whenever importing or exporting data. They can be created and read very easily by excel so I see it is a natural way to interface with any kind of tabular data.
This entire app is actually part of a larger application with a lot of company-specific stuff in it. I stripped all of that out, but I may have missed something. If you find any stray code that doesn't appear to have a reason for being there, please ignore it.
Feedback is welcome. I hope this helps all of you who need it.
DX_Library_Automation_share.zip 563.6 KB
The script works on the Part Editor, not the Library Services. It does make more sense to do this kind of thing through Library Services, but that's not the way it's set up in the COM at this point. Be sure to Promote Satoru's idea so that Mentor will add more Lib Services functionality to the COM.
Sometime recently we installed the latest version (7.9, update 7 or something, I'm not exactly sure) of the Mentor tools. I discovered yesterday that the move part executables that move HKPs in and out of the Library no longer work. The HKP export works fine, but the import (HKP2PartsDB.exe) does not. So the script I attached to this thread before no longer works.
I also found a small error in the script, but even when that is fixed, the import functionality does not work.
I'll be working on this to try and figure out what is wrong and how to fix it. If anyone else finds anything, please share. I'll post any updates I come up with as soon as they are ready.