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

A simple example script....

 

' -- WriteIGES.vbs
'
' -- Writes out the current data to an IGES file.
'
' -- The IGES file will be written to the folder of the current MCX file


' -- Kick off the script --
Call Main


' ///////////////
' Sub Declaration
' ///////////////
Sub Main()

Dim objFSO ' -- File System Object
Dim strFileMCX ' -- The current MCX file (full path)
Dim strFileIGS ' -- The IGES output file (full path)
Dim strOutputPath ' -- The output folder
Dim strOutputFile ' -- The output filename
Dim bResult

' -- Create an instance of a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

strFileMCX = GetCurrentFileName()
'ShowString("strFileMCX -> " + strFileMCX) ' -- DEBUG

strOutputPath = objFSO.GetParentFolderName(strFileMCX) + "\"
' ShowString("strOutputPath -> " + strOutputPath) ' -- DEBUG

strOutputFile = objFSO.GetBaseName(strFileMCX)
'ShowString("strOutputFile -> " + strOutputFile) ' -- DEBUG

' -- Assembly the output IGES file path
strFileIGS = strOutputPath + strOutputFile + ".IGES"

' -- Export the current Mastercam database to a IGES file.
' Note that a "enter comment" prompt will be displayed allowing
' you to supply a comment to be placed in the IGES about to be written.
bResult = WriteIGES(strFileIGS)

If bResult Then
ShowString("IGES written to -> " + vbCrLf + strFileIGS)
Else
ShowString("IGES write -> failed!")
End If

' -- Clean up
Set objFSO = Nothing

End Sub

Link to comment
Share on other sites
but can't you just simply do file > save as... > .iges?

Yes...

 

I can't get it to export thru code

He said he wanted to do it "by code" and tagged his post with VBScript, so that's what I answered. ;)

The script cannot do anything different as File-SaveAs does in regards to the IGES data being written out

it's really just a convenience of not have to click SaveAs and scroll down thru the File Types to find *.IGES ?

 

You could use ScriptLinker to be able to create a Toolbar Icon for the script and with one click you get an IGES file

Link to comment
Share on other sites
  • 2 weeks later...
  • 9 years later...

I've exported "assemblies" from Mastercam as STEP files and imported them into my CAD program and they come in as a single part with multiple bodies and no names. Good chance names are not supported on export. Haven't tried IGES.

There's a saying about IGES... it is really just a misspelling of I guess. Meaning if that is your last resort and the only thing available then it may be better than nothing but not always.

Link to comment
Share on other sites

My first choice would be parasolids X_T or X_B.

Second choice would be STEP

Dead last choice, drug kicking and screaming to the alter, would be IGES 

No matter what you use I don't think X4 is going to import the part names.

The newer releases will do that when importing parasolids X_T or X_ B

Link to comment
Share on other sites
9 minutes ago, gcode said:

My first choice would be parasolids X_T or X_B.

There is a reason for this

Hit File/Help/About  

You'll see this..  Mastercam runs on the Siemens Parasolid kernel .

To me, it's common sense that Parasolid files would yield the best results when importing models.

File-Help-About.jpg

  • Like 1
Link to comment
Share on other sites

We only use parisolid in this shop but were have guys from a sister company that use space in our shop and they only use IGES.  I ask them if they want me to show them parisolid but they do not like change.  They have been using X4 for all these years and are fighting to change to 2022.  thank for the help.  I will tell them.

Link to comment
Share on other sites
On 12/14/2023 at 9:25 AM, gcode said:

My first choice would be parasolids X_T or X_B.

Second choice would be STEP

Dead last choice, drug kicking and screaming to the alter, would be IGES 

No matter what you use I don't think X4 is going to import the part names.

The newer releases will do that when importing parasolids X_T or X_ B

I've always used STEP as first choice but I'll be keeping a lookout for any parasolid files in the future. thanks!

giphy.gif

Link to comment
Share on other sites
8 hours ago, Aaron Eberhard said:

I've always joked that it was " 'I Guess' if you exported as IGES."  :)

For sure it has some unexpected results sometimes,although, there were times also that iges worked out better than step when moving stuff from Catia to mcx although not too often

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