Cs List: Difference between revisions
From Macros Wiki
Jump to navigationJump to search
New page: ! get CS list, add a CS and select it<br> <br> a1$ = "This macro will get a list of all CSs,"<br> a2$ = "create a new CS and select it."<br> <br> message "%a1$\n%a2$"<br> <br> check part_o... |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
! get CS list, add a CS and select it | {| | ||
|! get CS list, add a CS and select it | |||
a1$ = "This macro will get a list of all CSs," | |- | ||
a2$ = "create a new CS and select it." | | | ||
|- | |||
message "%a1$\n%a2$" | | | ||
|- | |||
check part_open, "You must have a part open to run this macro" | |a1$ = "This macro will get a list of all CSs," | ||
|- | |||
get_cs_list | |a2$ = "create a new CS and select it." | ||
|- | |||
inum = number_of_css | | | ||
if inum<1 then stop "No CS found" | |- | ||
|message "%a1$\n%a2$" | |||
if inum>20 then inum = 20 ! just display data for the first 20 | |- | ||
| | |||
a$ = "Number of CSs = %inum\n" | |- | ||
|check part_open, "You must have a part open to run this macro" | |||
for i=1 to inum | |- | ||
:n = next_cs_number | | | ||
:get_cs_name n, cs$ | |- | ||
:get_cs_spindle n, ispin | |get_cs_list | ||
|- | |||
:a$ = a$ + "\n" + format$(n, "###0") + " " + cs$ | | | ||
:a$ = a$ + " : spindle "+format$(ispin,"0") | |- | ||
next i | |inum = number_of_css | ||
|- | |||
a$ = a$ + "\n\nAdd a new one ?" | |if inum<1 then stop "No CS found" | ||
|- | |||
yesno a$, iyesno | | | ||
if iyesno=0 then stop "Finished" | |- | ||
|if inum>20 then inum = 20|| ! just display data for the first 20 | |||
new_cs 3P, "Macro CS", 0, 0, 0, 1, 0, 0, 0, 1, 1 | |- | ||
ics = CsNumber | | | ||
|- | |||
set_cs ics | |a$ = "Number of CSs = %inum\n" | ||
update_cs_window | |- | ||
| | |||
a$ = "Created new CS, number " + format$(ics, "###0") + " = 'Macro CS'" | |- | ||
|for i=1 to inum | |||
stop "Finished\n"+a$ | |} | ||
:n = next_cs_number | |||
:get_cs_name n, cs$ | |||
:get_cs_spindle n, ispin | |||
:a$ = a$ + "\n" + format$(n, "###0") + " " + cs$ | |||
:a$ = a$ + " : spindle "+format$(ispin,"0") | |||
{| | |||
|next i | |||
|- | |||
| | |||
|- | |||
|a$ = a$ + "\n\nAdd a new one ?" | |||
|- | |||
| | |||
|- | |||
|yesno a$, iyesno | |||
|- | |||
|if iyesno=0 then stop "Finished" | |||
|- | |||
| | |||
|- | |||
|new_cs 3P, "Macro CS", 0, 0, 0, 1, 0, 0, 0, 1, 1 | |||
|- | |||
|ics = CsNumber | |||
|- | |||
| | |||
|- | |||
|set_cs ics | |||
|- | |||
|update_cs_window | |||
|- | |||
| | |||
|- | |||
|a$ = "Created new CS, number " + format$(ics, "###0") + " = 'Macro CS'" | |||
|- | |||
| | |||
|- | |||
|stop "Finished\n"+a$ | |||
Latest revision as of 14:47, 29 July 2010
| ! get CS list, add a CS and select it | |
| a1$ = "This macro will get a list of all CSs," | |
| a2$ = "create a new CS and select it." | |
| message "%a1$\n%a2$" | |
| check part_open, "You must have a part open to run this macro" | |
| get_cs_list | |
| inum = number_of_css | |
| if inum<1 then stop "No CS found" | |
| if inum>20 then inum = 20 | ! just display data for the first 20 |
| a$ = "Number of CSs = %inum\n" | |
| for i=1 to inum |
- n = next_cs_number
- get_cs_name n, cs$
- get_cs_spindle n, ispin
- a$ = a$ + "\n" + format$(n, "###0") + " " + cs$
- a$ = a$ + " : spindle "+format$(ispin,"0")
| next i |
| a$ = a$ + "\n\nAdd a new one ?" |
| yesno a$, iyesno |
| if iyesno=0 then stop "Finished" |
| new_cs 3P, "Macro CS", 0, 0, 0, 1, 0, 0, 0, 1, 1 |
| ics = CsNumber |
| set_cs ics |
| update_cs_window |
| a$ = "Created new CS, number " + format$(ics, "###0") + " = 'Macro CS'" |
| stop "Finished\n"+a$ |