Wg List: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
New page: ! get WG list, add a WG and select it<br> <br> a1$ = "This macro will get a list of all WGs,"<br> a2$ = "create a new WG and select it."<br> <br> message "%a1$\n%a2$"<br> <br> check part_...
 
ConnerO (talk | contribs)
No edit summary
Line 1: Line 1:
 
{|
! get WG list, add a WG and select it<br>
|! get WG list, add a WG and select it
|-
|&nbsp;
|-
|a1$ = "This macro will get a list of all WGs,"
|-
|a2$ = "create a new WG and select it."
|-
|&nbsp;
|-
|message "%a1$\n%a2$"
|-
|&nbsp;
|-
|check part_open, "You must have a part open to run this macro"
|-
|&nbsp;
|-
|get_wg_list
|-
|&nbsp;
|-
|inum = number_of_wgs
|-
|if inum<1 then stop "No WG found"
|-
|&nbsp;
|-
|if inum>20 then inum = 20  ! just display data for the first 20
|-
|&nbsp;
|-
|a$ = "Number of WGs = %inum\n"
|-
|&nbsp;
|-
|for i=1 to inum
|}
:n = next_wg_number
:get_wg_name n, wg$
<br>
<br>
a1$ = "This macro will get a list of all WGs,"<br>
:a$ = a$ + "\n" + format$(n, "###0") + " " + wg$
a2$ = "create a new WG and select it."<br>
{|
<br>
|next i
message "%a1$\n%a2$"<br>
|-
<br>
|&nbsp;
check part_open, "You must have a part open to run this macro"<br>
|-
<br>
|a$ = a$ + "\n\nAdd a new one ?"
get_wg_list<br>
|-
<br>
|&nbsp;
inum = number_of_wgs<br>
|-
if inum<1 then stop "No WG found"<br>
|yesno a$, iyesno
<br>
|-
if inum>20 then inum = 20  ! just display data for the first 20<br>
|if iyesno=0 then stop "Finished"
<br>
|-
a$ = "Number of WGs = %inum\n"<br>
|&nbsp;
<br>
|-
for i=1 to inum<br>
|new_wg "Macro WG"
:n = next_wg_number<br>
|-
:get_wg_name n, wg$<br>
|iwg = WgNumber
<br>
|-
:a$ = a$ + "\n" + format$(n, "###0") + " " + wg$<br>
|&nbsp;
next i<br>
|-
<br>
|set_wg iwg
a$ = a$ + "\n\nAdd a new one ?"<br>
|-
<br>
|update_wg_window
yesno a$, iyesno<br>
|-
if iyesno=0 then stop "Finished"<br>
|&nbsp;
<br>
|-
new_wg "Macro WG"<br>
|a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'"
iwg = WgNumber<br>
|-
<br>
|&nbsp;
set_wg iwg<br>
|-
update_wg_window<br>
|stop "Finished\n"+a$
<br>
|}
a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'"<br>
<br>
stop "Finished\n"+a$<br>

Revision as of 15:57, 29 July 2010

! 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"
 
get_wg_list
 
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
update_wg_window
 
a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'"
 
stop "Finished\n"+a$