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:

maks

Verified Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Uncategorized

  • AIM
    nil

maks's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi All; Does vbs can change WCS function in automatically? like "RunMastercamCommand" Thanks!
  2. Dear All; i have question in clipbroad function, does the vbs can change picture size after clipbroad? thanks!
  3. Hi All; i have a problem in vbs output to excel file,when i open the excel file and use the print preview function,the graphic box become large and change to orginal size. ' -- Start Script Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() ' -- Add code here... ' -- Start ScriptCall Main() ' //////////////////// ' Sub Declaration ' //////////////////// Dim intLevelNumber Dim strMc Dim strOriginalPath Dim DataPoint Dim Cpoint Dim datax Dim datay Dim dataz '-- Loop all levels, hide all except the one the user wants '/////////// / Dim lv_app Dim lv_excel Dim graphic Dim lv_text Dim Picture Set lv_app = CreateObject("Excel.Application") Set lv_excel = lv_app.workbooks.open ( "C:XYZ.XLS") Dim i Dim j : j = 1 Dim k : k = 16.5 For i = 1 To 100 If i <> intLevelNumber Then Call SetLevelVisibleByNumber(i,True) If IsDrawing() Then SetLevelByNumber(i) strOriginalPath = GetCurrentFileName() 'renname with LevelNumber strMC= Replace(LCase(strOriginalPath), ".mc9", "-" & i & ".mc9") Call RunMastercamCommand("fit") 'look for alive points datapoint = StartDBSearch(mc_alive, mc_pointtype) If (DataPoint = False) Then ShowString "nil" lv_excel.saveas( "C:XYZ.XLS") CloseExcelFile Exit Sub End If Set CPoint = New McPt ' -- Get this point x,y,z If GetPointData(GetEntityEptr, cpoint) Then 'ShowString i 'get point data datax=Round(cpoint.x,3) datay=Round(cpoint.y,3) dataz=Round(cpoint.z,3) lv_excel.sheets(1).cells((j-1)*15+1,1) = datax lv_excel.sheets(1).cells((j-1)*15+1,2) = datay lv_excel.sheets(1).cells((j-1)*15+1,3) = dataz j = j + 1 End If strOriginalPath = GetCurrentFileName() 'renname with LevelNumber graphic= Replace(LCase(strOriginalPath), ".mc9", "-" & i & ".emf") Call RunMastercamCommand("fit") ' save emf file DoMetafile graphic 'Height = 2000: Width = 1000 'Picture = LoadPicture(graphic) ' lv_excel.sheets(1).Shapes.AddPicture(Filename, LinktoFile, SavewithDocument, Left, Top, Width, Height) Set lv_text = lv_excel.sheets(1) lv_text.Shapes.AddPicture graphic, False , True , 0,k, 200, 160 k= k + 247.5 ' save file Call SaveMCAs(strmc,True) Call SetLevelVisibleByNumber (i,False) End If End If Next Call RepaintScreen(True) 'End If ShowString "complete" lv_excel.saveas( "C:XYZ.XLS") lv_excel.Close lv_app.quit Set lv_app = Nothing End Sub 'entity serach Function IsDrawing() Dim Ret Ret = StartDBSearch(mc_alive, -1) IsDrawing = Ret End Function ' //////////////////// ' Function Declaration ' //////////////////// Public Sub ShowAllLevels '-- Loop all levels and show them Dim i For i = 1 To 255 Call SetLevelVisibleByNumber(i,False) Next End Sub thanks Maks
  4. Mick and Bullines thank you very very much for your help; this is great helpful for me. Refer to Bullines; i want to save only selected level to a file. but this is difficult for me,would you give me some ideas. thanks Maks
  5. Hi Mick; this is my frist vb. ' -- Start Script Call Main() ' //////////////////// ' Sub Declaration ' //////////////////// Sub Main() Dim intLevelNumber Dim strMc Dim strOriginalPath ' -- Ask for a level If askValue("Input level number",0,255, intLevelNumber) Then SetLevelByNumber(intLevelNumber) Call SetLevelVisibleByNumber(intLevelNumber,True) Call RunMastercamCommand("fit") 'If Not IsDrawing Then ' ShowString "No drawing" ' Exit Sub 'intLevelNumber=GetEntityLevel strOriginalPath = GetCurrentFileName 'renname with LevelNumber strMC= Replace(LCase(GetCurrentFileName), ".mc9", "-intLevelNumber.mc9") ' save file Call SaveMCAs(strmc,True) Call RepaintScreen (True) 'End If End If End Sub 'entity serach Function IsDrawing() Dim Ret Ret = StartDBSearch(mc_alive, -1) IsDrawing = Ret End Function thanks!
  6. Hi All,i have some problem in editing my vbs. does the vbs can save the current level(main level) during a search,like "savesome /all/level" thanks!

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