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:

Importing SLDPRT into MCX-5


Recommended Posts

  • 7 months later...

Hello all.

 

I've upgraded to X6 and installed this script. Almost everything works great, except that it saves the file as a .MCX-5 file.

 

What would it take to get this updated to save as a MCX-6 file? Or allow for a custom extension to be saved in the registry?

 

Thanks,

 

Matt.

Link to comment
Share on other sites

Hello all.

 

I've upgraded to X6 and installed this script. Almost everything works great, except that it saves the file as a .MCX-5 file.

 

What would it take to get this updated to save as a MCX-6 file? Or allow for a custom extension to be saved in the registry?

 

Thanks,

 

Matt.

I've got some experience coding, I have done some work in access and VB.

 

Roger would this be the portion to change.

                
if (result)
               {                      
                   filename = Path.ChangeExtension(filename, ".MCX-5");<------------- change to ".MCX-6"                                      
                   // Tell Mastercam to save it as...
                   if (Mastercam.IO.FileManager.SaveAs(filename))

Link to comment
Share on other sites

The new MergeSLDPRT2MCX for X6 is available in the ZIP attached to this posting.

Please see the PDF in the MergeSLDPRT2MCX-6.ZIP for details on what this AddOn does.

 

Greyman,

I believe that the code snippet in the earlier posts is a bit out of date, but...

Yes, that would be one place in the code where MCX-5 needs to be changed to MCX-6.

There are a about 4-5 more occurrences that you'd need to upstate -

a few for the SaveAs dialog tile and filter and in a couple comments.

MergeSLDPRT2MCX-6.zip

Link to comment
Share on other sites
  • 3 weeks later...
  • 3 weeks later...

Hi Roger.

 

I'm still getting the same error with this. I'm not entirely sure it's the chook but I'm not sure how to fix it.

 

When I run the application from the toolbar, which is a "Mastercam X" logo now and not a "Solidworks" Logo, it gives me a .NET Library Error - Function not found in Assembly chooks/mergesldprt2mcx.dll.

 

I tried running it from the settings menu - Run User Application and get an Open Error - Unknown file type.

 

Any thoughts on how to fix this?

 

Thanks,

 

Matt.

Link to comment
Share on other sites

Matt,

 

Sorry - Haven't a clue.

 

I re-downloaded the ZIP from the post above and ...

Extracted all of the files into the Program Files\mcamx6\Chooks folder.

Started X6-MU2 (The MU would not make any difference here).

Setting-Customize - Category Files.

Selected the SW icon and dragged it to a toolbar

And it runs just fine.

Link to comment
Share on other sites

I deleted the files I had, I deleted the registry entries under X6 for the Merge sldprt chook, rebooted my computer, added the merge sldprt chook to the directory in programs files\mcamx6\chooks, opened up mcamx6 and it showed under settings-customize-file menu as a mcamx "X" logo. If I drag that to the tool bar and run it I get the same error I described above.

 

Matt.

Link to comment
Share on other sites

I just replaced it with the original x5 version of mergesldprt2mcx, which worked when I first installed Mcamx6 except for saving it as an MCX5 file, and that doesn't work either.

 

I'm at a loss and don't know what else to try. I'm open to any suggestions. I don't believe this is an issue with your script.

 

Matt.

Link to comment
Share on other sites

When I first installed X6 I used the X5 version of this chook and it worked. When you updated the chook for X6 replaced the X5 one with the new one and it didn't work. I tried going back to the X5 version of the chook and it doesn't work anymore either. Do I need to try removing Mastercam and reinstalling?

 

Matt.

Link to comment
Share on other sites
  • 10 years later...
On 8/20/2012 at 8:22 AM, Roger Martin from CNC Software said:

Matt,

 

Try removing Mastercam and re-installing...

 

Rarely the solution despite what you may read.

 

email me (sdk <at> mastercam <dot> com) with an address that allows for sending Zipped attachments.

I'll shoot you a DLL (or two) to try.

Hey Roger, sorry to resurrect a decade old post but I'm hoping you are still able to answer a question.

This C-hook has been working great for the last 2 versions of Mastercam I've been on (2019 and 2022). It has always renamed level 1 from "part" to the name of the sldprt file we are merging.

Since updating however, it just renames it to one of the features in the Solidworks feature tree such as "Chamfer #3" or "M4 x 0.7".

Any input as to why this might happen? I'm not sure if this is related to the c-hook or if it's due to a change in the way our feature trees are displayed.

Link to comment
Share on other sites
1 hour ago, Christie said:

Hey Roger, sorry to resurrect a decade old post but I'm hoping you are still able to answer a question.

This C-hook has been working great for the last 2 versions of Mastercam I've been on (2019 and 2022). It has always renamed level 1 from "part" to the name of the sldprt file we are merging.

Since updating however, it just renames it to one of the features in the Solidworks feature tree such as "Chamfer #3" or "M4 x 0.7".

Any input as to why this might happen? I'm not sure if this is related to the c-hook or if it's due to a change in the way our feature trees are displayed.

Hi Christie,

Fyi, Roger retired,

if you need to enforce the level naming after import, you could iterate through the list of imported levels and rename them to the desired name using this function 

DllImpExp bool set_levname (
    int lvl_no,
    TCHAR *new_level_name);
 

you can always reach out to the sdk team <sdk>at<mastercam>dot<com>

 

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