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:

Recommended Posts

Rek'd would be the hacker of choice to make the routine you desire - but as our albertan friend has stated, you will get a better result if you post your question in English - Otherwise Ksoufi is the only other resource for this kind of stuff that may speak french as well.

 

Launguage is the key to the world and I am at a disdvantage as I only speak one...

 

[ 04-22-2003, 04:54 PM: Message edited by: Andrew McRae ]

Link to comment
Share on other sites

quote:

je sais mais tu vas voir il plusieur personne qui parle très bien le francais sur le forum


Nous avons besoin de plus smile.gifvbscript.htm a toutes les fonctions disponibles pour Mastercam. Il semble possible avec le C-Hook API mais le VBS ne contient pas toutes les fonctions des C-Hooks...maintenant.

 

VBS, pouvez-vous nous aider? Er, I mean...VBS, can you help us?

Link to comment
Share on other sites

ok I try

 

my question is, if possible to create vbscrip for

 

file get/all level on/all unblank/zoom all/save in same name

 

open all file in folder( one by one ), all level on, all unblank, zoom all and save in the same name

 

i know if possible with autocad I wonder if it is possible with macam9.1

 

thank's ans excuse my english and my fench smile.gif

Link to comment
Share on other sites

Hi,

 

Not sure if this is what you are after but...

 


'///////////////// My Constants /////////////////

Const DEF_LEVELS = 255

 

' -- Start Script

Call Main()

 

 

' ////////////////////

' Sub Declaration

' ////////////////////

Sub Main()

 

On Error Resume Next

 

Dim FSO

Dim fsoFolder

Dim fsoFiles

Dim fsoFile

Dim i

Dim intCount

 

 

Set FSO = CreateObject("Scripting.FileSystemObject")

 

' **********************************************************************

' -- Ideally you would invoke a windows browse for folder

' -- dialog and have the user select a folder.

' -- See the example Batch Import DXF Files.vbs on how to do this.

' **********************************************************************

Set fsoFolder = FSO.GetFolder("C:Mcam9Data")

 

' -- Get all files in this folder

Set fsoFiles = fsoFolder.Files

 

' -- Iterate all files in this folder

For Each fsoFile In fsoFiles

' -- MC drawing?

If Right(LCase(fsoFile.Name), 3) = "mc9" Then

' -- Clear screen

NewMC False

' -- Open this drawing

If OpenMC(fsoFile.Path) Then

' -- Keep a running total

intCount = intCount + 1

' -- Iterate all levels

For i = 1 To DEF_LEVELS

' -- Clear the level name

SetLevelName i, vbNullString

Next

 

' -- Zoom all

RepaintScreen True

 

' -- Save the file

SaveMC False

End If

End If

Next

 

' -- Clear screen

NewMC False

 

' -- Show some feedback

If intCount = 0 Then

ShowString "No drawings found in selected folder"

Else

ShowString intCount & " files processed"

End If

 

If Err Then

ShowString "An error has occured with a description of " & Err.description

End If

 

 

' -- Clean up

Set fsoFile = Nothing

Set fsoFiles = Nothing

Set fsoFolder = Nothing

Set FSO = Nothing

 

End Sub

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