CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-06-2014, 08:05 AM
Emiliano Emiliano is offline
Registered User
 
Join Date: Nov 2014
Location: Piacenza, Italy (IT)
Posts: 4
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
Reply With Quote
  #2  
Old 11-17-2014, 04:40 AM
Eugene Eugene is offline
Registered User
 
Join Date: Nov 2014
Location: Arnhem, The Netherlands (NL)
Posts: 1
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.
Reply With Quote
  #3  
Old 01-30-2015, 06:14 AM
Emiliano Emiliano is offline
Registered User
 
Join Date: Nov 2014
Location: Piacenza, Italy (IT)
Posts: 4
Re: Me10 v.11 bulk unshare macros

thank you, and sorry for the long time taken to answer i'll try it asap.
Reply With Quote
  #4  
Old 03-23-2015, 02:48 AM
Emiliano Emiliano is offline
Registered User
 
Join Date: Nov 2014
Location: Piacenza, Italy (IT)
Posts: 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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:48 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.