Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

excel setup sheet possibilities


Roger Peterson
 Share

Recommended Posts

Good day, has anyone done this? I am looking at either using the vbs functionality to spit data into an existing excel file or creating a cdl file with a post to import into an existing excel file. Any input on either method would be appreciated. I did do a search on this and found some info but I was hoping that in v9.1 with vbs it would be much easier.

 

 

thanks again for the help,

Link to comment
Share on other sites

Right now you can't do it directly to excell because vbs can't get all the tool data, (from what I've seen, anyway).

 

What I'm doing for now is creating a specially formatted setup sheet from a .set file, then importing that data to an access database via vb inside access.

 

Once the functions are put into vbs for MC to extract all the tool data, part data, images etc, it will be much more doable the way you describe.

 

If you're familiar with recent releases of Gibbs, you will have seen a very nice implimentation of exporting data to excell.

 

'Rekd teh On Error Format C:

Link to comment
Share on other sites

quote:

You can always count on 'rekd for a Gibbs compliment

To be honest, I can't stand it. It's got a few things it does nicely, but that's it. Gimme MC over GibbsCANT any day and twice on Sundays. I just got bonked a couple times by trashing certain machines/programs, so I'm a bit shy. biggrin.gif

 

I do owe it, (Gibbs) a bit of respect, though, because without it, I would prolly still be on a machine all day, instead of running between the computer and the machines with a broom up my arse. :BUMA: eek.gif

 

'Rekd teh splinters!

 

[ 05-27-2003, 05:40 PM: Message edited by: Rekd ]

Link to comment
Share on other sites

Pardon me for speaking when not spoken to biggrin.gif but ...

 

Here's my list:

~~~FILE~~~

+File Properties / Descriptor

+Image (preview)

~~~OPS~~~

+Operastion Group Name

+Operation Name

Program Number

+WCS

+Tool Number

+Length Offset No.

+Dia. Offset No.

+Tool Description

Diameter

Corner Radius

MFR. Tool Code

Shoulder Length

Flute Length

 

+ Highly desireable

 

[ 05-28-2003, 10:03 AM: Message edited by: CAMmando ]

Link to comment
Share on other sites

Mick, basically anything that is in mill.set. I realize we probably wouldn't be able to access run times and min and max depth values, then again maybe we could. Maybe even have a standard excel setup sheet that could be modified by the end user.

 

 

Thanks again everyone for the help,

Link to comment
Share on other sites

quote:

Heck of a road eh?

Heck of a trip, too. One of my more interesting liberty ports was Lisbon, back in '86 or so. We were there during an election of some sort, so there were many tiny cars with e-fookin'-normous speakers mounted on 'em (think 'Blues Brothers') dashing about broadcasting long, excited protugeese phrases at ear-bleed volume. Interesting, if somewhat incomprehenseable.

 

Once the cars had gone past, the rest of Lisbon was kinda cool, too. Lots of interesting little shops, lots of interesting people, and lots of interesting things to look at. Of all the palces I went, Lisbon and Tunis are the top two I'd like to visit again. Edinburgh - to see Castle Rock again, would be up there on the list, too.

 

But Lisbon was cool.

Link to comment
Share on other sites

Even if it does, that dosn't mean that MasterCAM has to switch to something else. They could use Autodesk's dogged clinging to lisp while the world moved on as insparation.

 

Rename it MasterScript (followed by Visual MasterScript, of course) and call it's similarity to VBScript a feature of the language.

Link to comment
Share on other sites

Hey LISP is a good programming language. I've been using it for years!

 

I do admit VB is a better way to go, but it's MS getting their hands into everything. With AutoCAD VB kinda sucks in it, I can create a LISP routine faster and easier then a VB script. Dialogue boxs are easy though I think.

 

We should all use Pascal or Cobalt...

Link to comment
Share on other sites

Mick, sorry for the delay in replying. I took my first official parenting day off yesterday.

 

In order to produce good setup sheets via VBS straight from Mastercam, (without going through an intermediate file like I'm doing now), we would need access to;

 

[*]File data, including thumbnail images

[*]Post data, (mostly there already)

[*]Job Setup Data, more is better, at least origin, size, etc..

[*]Tool Data

[*]Tool Number

[*]Tool Dia

[*]Flutes

[*]Flute Length

[*]Shank Dia

[*]Shank Length

[*]CRC

[*]TLO

[*]Material

[*]NoseRadius

[*]HolderData

[*]Comments

[*]Depth

[*]Chuck/Manufacturer Data

[*]File Properties (the descriptor)

[*]WFO data

[*]Operation Data

[*]Type

[*]OpComment

[*]GroupComment

[*]NC Destination

[*]WFO Number

[*]Program Number

[*]Cycle Time

I'm sure I've missed some stuff. Basically, it's all the data we can get with a standard .set file.

 

I realize it will take time to implement everything. This is obviously a big issue. I know as well as you that this is going to change the way Mastercammers create setup sheets forever. I can't wait to see what some people come up with... biggrin.gif Hell, I can't wait to see what CNC comes up with.. (/me reflects back to the release of mill2.set, just months after my version was posted here biggrin.gif )

 

You've made lots of people very happy with this release, which seems to be par for CNC in the past. You guys come up with something to add to Mastercam, you add it, you listen, then you make it better. Great Job, and please keep it up.

 

'Rekd teh Today is Thursday, but it's really Wednesday because Tuesday was Monday

 

[ 05-29-2003, 11:07 AM: Message edited by: Rekd ]

Link to comment
Share on other sites

Roger,

 

you can create and acces an excelsheet from a .set or a .pst file with wscript.

Put this code in a .pst or .set file and make a post run.

 

code:

bug1:2

bug2:0

bug3:0

bug4:0

fastmode:0

whatno : yes

strtool_v7 : 2

tooltable:yes

 

fs 1 1^0 n

fs 2 1.3 nt

 

fmt 2 t

fmt 2 tldia

fmt 2 tcr

 

sbufname1 tools_xls.vbs

fbuf 1 1 80 0

result:0

str1 "wscript.exe"

str2 "tools_xls.vbs"

wc1:1

line:0

row:1

col:1

 

srow

scol

sdia

srad

szmin

szmax

stnr

sline

srow_col

 

s0 'Dim xs'

s01 'Set xs=CreateObject("Excel.Application")'

s02 "xs.visible=true"

s03 "Set newBook = xs.Workbooks.Add"

s04 "With newbook.activesheet"

s05 '.cells(1,1).value="WZ-Nr."'

s06 '.cells(1,2).value="WZ-Name"'

s07 '.cells(1,3).value="WZ-Durchmesser"'

s08 '.cells(1,4).value="WZ-Eckradius"'

s09 '.range("A1:G1").Select'

s10 "xs.selection.font.bold=true"

s11 '.Columns("A:G").Select'

s12 "xs.selection.HorizontalAlignment = -4108"

s13 '.Columns("A:G").EntireColumn.AutoFit'

s14 '.range("A2").Select'

s15 "End With"

s16 ".cells("

s17 ').value="'

s18 '"'

s19 ","

svbs

fstrsel s0 line svbs

 

pheader

while line<15,[

result = updstr (svbs)

svbs = wbuf(1, wc1)

line=line+1

]

 

peof

s15 = wbuf(1, wc1)

result = fclose(1)

result = launch(str1, str2)

 

ptooltbl

if t>0,[

row=row+1

stnr = no2str(t)

sdia = no2str(tldia)

srad = no2str(tcr)

col=1

srow=no2str(row)

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + stnr + s18

sline = wbuf(1, wc1)

col=2

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + strtool + s18

sline = wbuf(1, wc1)

col=3

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + sdia + s18

sline = wbuf(1, wc1)

col=4

scol=no2str(col)

srow_col=srow + s19 + scol

sline = s16 + srow_col + s17 + srad + s18

sline = wbuf(1, wc1)

]

 

1501. Insert parameter information in the ascii NCI? n

1502. Write operation information to binary file (.ops)? y

1999. ? 9


This is just to show you how it works.

 

regards

Link to comment
Share on other sites

To create and evaluate a real MessageBox in MP, you can do this.

 

code:

sbufname1 msgbox.vbs

fbuf 1 1 80 0

result:0

str1 "wscript.exe"

str2 "wscript.quit r"

 

# vbOKOnly 0

# vbOKCancel 1

# vbAbortRetryIgnore 2

# vbYesNoCancel 3

# vbYesNo 4

# vbRetryCancel 5

# vbCritical 16

# vbQuestion 32

# vbExclamation 48

# vbInformation 64

# vbDefaultButton1 0

# vbDefaultButton2 256

# vbDefaultButton3 512

# vbDefaultButton4 768

# vbApplicationModal 0

# vbSystemModal 4096

 

vbOK :1

vbCancel :2

vbAbort :3

vbRetry :4

vbIgnore :5

vbYes :6

vbNo :7

 

smsg0 'r = msgbox ("MessageBox from MP", vbYesNoCancel + vbQuestion, "Postprozessor")'

 

 

pmsg

smsg0 = wbuf(1, 1)

str2 = wbuf(1, 2)

result = fclose(1)

result = launch(str1, sbufname1)

 

pheader

pmsg

if result=vbYes, "you pressed yes"

if result=vbNo, "you pressed No"

if result=vbCancel, "you pressed Cancel"

 

1999. ? 9

cheers.gif

Link to comment
Share on other sites

Gismo, I have been playing with this a bit and have had some success'. I am not real farmiliar with vb just very basic stuff. One thing I have been trying to do is modify the code to open an existing excel spread sheet instead of creating a new one. Is this possible? Would you be willing to share some more info? Thanks in advance if so and if not I understand.

Link to comment
Share on other sites

Hi Roger, try the following Post.

Make sure you have an existing c:t.xls file.

code:

sbufname1 sheetnames.vbs

fbuf 1 1 80 0

result:0

str1 "wscript.exe"

msg:0

wc1:1

smsg0 'set wb = getobject("c:t.xls")'

smsg1 'for each ws in wb.worksheets'

smsg2 'msgbox ws.name'

smsg3 'next'

smsg

fstrsel smsg0 msg smsg

 

pmsg

while msg<4,[

result = updstr (smsg)

smsg = wbuf(1, wc1)

msg=msg+1

]

result = fclose(1)

result = launch(str1, sbufname1)

 

pheader

result=1

msg=0

pmsg

 

1999. ? 9


cheers.gif

Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...