Wg List: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
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_... |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{| | |||
! get WG list, add a WG and select it< | |! 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$ | |||
<br> | <br> | ||
: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 | |||
|- | |||
:a$ = a$ + "\n" + format$(n, "###0") + " " + wg$ | | | ||
next i | |- | ||
|set_wg iwg | |||
a$ = a$ + "\n\nAdd a new one ?" | |- | ||
|update_wg_window | |||
yesno a$, iyesno | |- | ||
if iyesno=0 then stop "Finished" | | | ||
|- | |||
new_wg "Macro WG" | |a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'" | ||
iwg = WgNumber | |- | ||
| | |||
set_wg iwg | |- | ||
update_wg_window | |stop "Finished\n"+a$ | ||
|} | |||
a$ = "Created new WG, number " + format$(iwg, "###0") + " = 'Macro WG'" | |||
stop "Finished\n"+a$ | |||
Latest 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$ |