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 |
||
| 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$" | |- | ||
|a1$ = "This macro will get a list of all CSs," | |||
check part_open, "You must have a part open to run this macro" | |- | ||
|a2$ = "create a new CS and select it." | |||
get_cs_list | |- | ||
| | |||
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_list | ||
:get_cs_spindle n, ispin | |- | ||
| | |||
:a$ = a$ + "\n" + format$(n, "###0") + " " + cs$ | |- | ||
:a$ = a$ + " : spindle "+format$(ispin,"0") | |inum = number_of_css | ||
next i | |- | ||
|if inum<1 then stop "No CS found" | |||
a$ = a$ + "\n\nAdd a new one ?" | |- | ||
| | |||
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 | |- | ||
|a$ = "Number of CSs = %inum\n" | |||
set_cs ics | |- | ||
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$ | |||
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$ |