Wg List

From Macros Wiki
Jump to: navigation, search
!    get WG list, add a WG and select it
a1$ = "This macro will get a list of all WGs,"
a2$ = "create a new WG and select it."
message "%a1$\n%a2$"
check part_open, "You must have a part open to run this macro"
inum = number_of_wgs
if inum<1 then stop "No WG found"
if inum>20 then inum = 20  ! just display data for the first 20
a$ = "Number of WGs = %inum\n"
for i=1 to inum
n = next_wg_number
get_wg_name n, wg$

a$ = a$ + "\n" + format$(n, "###0") + " " + wg$
next i
a$ = a$ + "\n\nAdd a new one ?"
yesno a$, iyesno
if iyesno=0 then stop "Finished"
new_wg "Macro WG"
iwg = WgNumber
set_wg iwg
a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'"
stop "Finished\n"+a$