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:

John T.

Verified Members
  • Posts

    189
  • Joined

  • Last visited

John T.'s Achievements

Newbie

Newbie (1/14)

32

Reputation

  1. I'm not sure if I'm understanding the various LineSpacingRule commands for use with VBA in word 2007 to get a doc sheet made up. The issue is that I'm not getting proper line spacing. It seems to be defaulting to the double spacing default of word 2007. Here's some snippets: In my defintions-note thatI'm not sure what the value really is supposed to be. Const wdLineSpace1pt5=1 Const wdlineSpaceSingle=0 Const wdLineSpaceExactly=0 Here is a part of someting that gets printed out in word: .ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 20,70, 222.3, 65).Select 'first box left side .Selection.ShapeRange.TextFrame.TextRange.Select 'First box header info goes this section .Selection.ParagraphFormat.LineSpacingRule=wdLineSpaceSingle .Selection.Collapse .Selection.ShapeRange.Line.Visible = msoFalse .Selection.Font.Bold=True .Selection.TypeText "Company: "&vbTab 'Company Name .Selection.Font.Bold=False .Selection.TypeText companyname&vbNewLine .Selection.Font.Bold=True .Selection.TypeText "Description: "&vbTab 'Description .Selection.Font.Bold=False .Selection.TypeText Description &vbNewLine .Selection.Font.Bold=True .Selection.TypeText "PI Num: "&vbTab 'PI number .Selection.Font.Bold=False .Selection.TypeText Program &vbNewLine .Selection.Font.Bold=True .Selection.Font.Bold=True .Selection.TypeText "Material: "&vbTab 'Material type IF in Job setup .Selection.Font.Bold=False .Selection.TypeText material &vbNewLine I guess my biggest problem is I don't know how the constants are defined, or if I'm using the .Selection.ParagraphFormat.LineSpacingRule=wdLineSpaceSingle In the proper place. Any ideas?
  2. Well, lets say I'm writing a VB script, and need to get a list of tools used in the MCX program. The max number of tools we use is 20, but can be any number up to 20. So I do a loop to get the tool number, name, diameter, length and so on. However, if I'm using only 5 tools, I need to know what the response is if say, tool 5 isn't used (skipped) and tool 6 is the 5th tool. So if the loop finds tool 5 is empty, what get returned when I call GetToolDiameter, GetToolNumber, and so on? That way I can write a little sub routine so that those fields are blank on a doc sheet printout.
  3. If I use a command like "GetToolNumber()" and that tool isn't used or empty? Will it be "NULL" or "FALSE" or something similar? Will it vary depending if the variable will be a number or text? Thanks!
  4. Using X3 here. I have a part all programmed, several tools, etc. I merge another MCX file into to check layout of some mounting holes, saved it, loaded something else, then loaded the orignal program back in. What a mess! Now the toolpath groups have become machine groups, with their own properties group, and they're all "generic mill". The toolpath groups need to have a whole new "tool name". Each toolpath group would need to be posted by itself instead of the program as a whole. Has anyone encountered this before? is it fixable?
  5. A bit of background first: We're rearranging our VBS doc sheets so that it doesn't look at the operations to get the tool count. We're just getting the tools, 1-20 and putting them on the doc sheet. Problem is, I can't seem to find a way to detect unused tools (i.e. program uses tools 1-6, and tools 7-20 aren't in the program) so that they can't print garbage on the doc sheet. [code For idx=1 to 20 arrToolComment(idx) = GetToolComment(idx) arrToolDiameter(idx) = GetToolDiameter(idx) arrToolFluteLength(idx) = GetToolFluteLength(idx) arrToolLength(idx) = GetToolLength(idx) If GetToolDiameter(idx)=0 Or GetToolDiameter(idx)=" " Then arrToolComment(idx)=" " & arrToolDiameter(idx)=" " & arrToolFluteLength(idx)=" " & arrToolLength(idx)=" " [/code] The last line is kind of what I'm trying to use to find the unused (blank) tools. As it is, its saying "T10 (for example) FALSE 0 0 0". Any ideas?
  6. Hi all, One of our MC computers got up dated hardware. Using win XP, but they loaded Word 2007 instead of the "old" Word 2003. When using our VB script doc program, it doesn't do the single line or one and a half line spacing with W2007 like it did with 2003. When we need to use 1 and half spacing, we using the following command: .Selection.ParagraphFormat.LineSpacingRule=DEF_SPACING_ONEANDAHALF We didn't do anything for for single line spacing, that was default. Everything defaults to 2 line spacing like its a HTML file or something. Is there something different I need to do for the one and two line spacing? Or has it become somehow obsolete for W2007? Thanks, John
  7. We had our computers upgraded to the MU1 version last thursday (I was gone). Now our VB script doc sheet won't put the graphic (screenshot) in the document anymore. Its setup to use the "DoMetafile" command, writing to the C: drive temp directory, but it just won't work now. I've already written Mick a note asking to send it to him, but I'm wondering if anyone has any ideas?
  8. This is addressed to Mick as he recently helped me with an issue on a doc sheet VB script program I had, but feel free to contribute. Mick, if you will recall, you helped me with our VBS doc sheet program, it was messing up the tool listing when we had a transform toolpath. Now another issue has cropped up. Its only recently come to my attention though. It seems that when a program goes back to an earlier tool, it messes up the tool listing by putting in lines like "T0 Tool N/A 0 0 0" (tool number, tool name, diameter, flute length, and overall length). I believe that there just needs to be some kind of subroutine that checks for previous tool numbers and skips over ones that are already used. Does this sound correct? I can always send you the program again, and possibly a program that causes it. Thanks, John
  9. I'll try to get that to you tonight then, Thanks!
  10. I made a doc sheet from VB script a few years ago (with much help from folks here on the forum). Ever since X or X2, we've been getting a line on the resulting doc sheet that says T0(tool number) N/A (tool description) 0 (diameter) 0(flute length) 0 (overall length). It only happens when there is a transform toolpaths in the tool path list. I don't know if the doc sheet in question is still in the FTP, but I can upload it again if people would like, but hopefully someone will know what the problem might be without looking at it?? TIA, John
  11. OK Roger, Thanks. On the machine definition, is SetActiveMachine in the VB script docs that come with MC? I went through them several times, and I don't remember seeing them. I'd look again but I'm at home without my docs.
  12. When running the following script: code: check="False" Do 'get machine type machine=AskString ("Machine Type","") If machine="Fadal" Then SetPostName=("C:MCAMX2millpostsfadal.pst") check="True" Exit Do If machine="Makino" Then SetPostName=("C:MCAMX2millpostsmakino.pst") check="True" Exit Do If machine="Leadwell" Then SetPostName=("C:MCAMX2millpostsleadwell.pst") check="True" Exit Do Loop While check="false" I get the error message "type mismatch SetPostName" whenever I use the first machine listed, Fadal in this case. When I disabled the fadal related lines and typed in Makino, I got the same message, so something is happing to the first occurence of the name. On another note, any way to set the machine definition from VB script?
  13. Yes, Thanks! thats the kind of info I'm looking for. I just needed to see how its used. I may have more questions in the future, but I'll have to try it and see how it goes
  14. Geez, never mind. I found the reference in the MC script printout I already had...

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...