Cs List

From Macros Wiki
Revision as of 22:00, 28 July 2010 by ConnerO (talk | contribs) (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...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

! 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$