#1
|
|||
|
|||
Me10 v.11 bulk unshare macros
hello
i'm a new user in the forum (i apologize for the future english errors, i'm from italy ) for the past year i've been working as a drawer on the 2d cad Me 10 version 11. in most situation we have had trouble with the shared parts, so i've worked on a bulk unshare macro wich, as the name suggest, takes all the parts and unshare them. my problem is that we work on drawings wich contains something like 100k parts and more, so the macro can take up to one hour to get the job done. i think the problem is that i run a loop on the output of the LISTS_PART command which is a table composed of a series of row and one column of string. can someone help me? i'm looking for a way to loop fast throughout all the part. thank you |
#2
|
|||
|
|||
Re: Me10 v.11 bulk unshare macros
Hello Emiliano,
You could try the following, but how quick this is at 100K parts, I don't know: DEFINE UNSHARE_ALL local redox_row pb_ltab_update let redox_row (2) while (redox_row <= (ltab_rows "PBT_LTAB")) trap_error UNSHARE_PART (read_ltab "PBT_LTAB" redox_row 2) if (check_error) end end_if let redox_row (redox_row+1) end_while END_DEFINE Regards, Eugene Last edited by Eugene; 11-18-2014 at 04:42 AM. |
#3
|
|||
|
|||
Re: Me10 v.11 bulk unshare macros
thank you, and sorry for the long time taken to answer i'll try it asap.
|
#4
|
|||
|
|||
Re: Me10 v.11 bulk unshare macros
i took inspiration from your command and wrote this
DEFINE Scondividi_avanzato local redox_row {numero di righe nella tabella delle parti} local num_part local num_shared {contatore delle parti condivise nella tabella delle parti} local num_shared_tot local name_shared {stringa con l'identificatore di parte condivisa} local hierarchy local true_hierarchy local count local king local i local carattere local ceck local to_unceck local be_russian DISPLAY ("VERSIONE MODIFICATA") let redox_row (2) let num_shared (0) let num_shared_tot (0) let hierarchy (0) let count (0) let ceck (1) let name_shared ("A") let num_part (0) EDIT_PART TOP pb_ltab_update create_ltab 'shared_part_tab' let num_part (ltab_rows "PBT_LTAB") while (redox_row <= (ltab_rows "PBT_LTAB")) trap_error let name_shared (read_ltab "PBT_LTAB" redox_row 3) let count (LEN name_shared) if (LEN name_shared) > 1 let be_russian 1 let num_shared_tot (num_shared_tot+1) write_ltab 'shared_part_tab' num_shared_tot 1 redox_row write_ltab 'shared_part_tab' num_shared_tot 2 (read_ltab "PBT_LTAB" redox_row 3) let i (1) let count (LEN name_shared) let true_hierarchy (0) let carattere ("#") while (i <= count) let king (substr name_shared i 1) if (king = carattere) let true_hierarchy(true_hierarchy+1) end_if let i (i+1) write_ltab 'shared_part_tab' num_shared_tot 3 true_hierarchy end_while end_if let name_shared ("A") let redox_row (redox_row+1) end_while DISPLAY ("totale parti trovate "+ str(num_part) + "numero condivise trovate " + str(num_shared_tot) + "numero condivise in tabella "+ str (num_shared)) sort_ltab 'shared_part_tab' column 3 let num_shared (ltab_rows 'shared_part_tab') let to_unceck (0) while (ceck <= num_shared) pb_ltab_update trap_error let to_unceck (read_ltab 'shared_part_tab' ceck 1) UNSHARE_PART (read_ltab "PBT_LTAB" to_unceck 2) let ceck(ceck+1) end_while delete_ltab 'shared_part_tab' DISPLAY ("Fine") END_DEFINE |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|