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

Good Morning All,

 

I have recently been working on automating some rather repetitive steps that we take between NX and MasterCAM. I have the NX part complete but seem to be having a hard time finding much research material online for Mastercam VB Scripting. In UG I could record a macro in VB and learn and tweak from that but I am having a hard time figuring out a good way do do something similar in Mastercam.

 

I have scavenged through the example VBS files and managed to pick out a little of what I needed but it is minimal.

 

The steps I am needing to take are...

 

1) Draw 2 lines outside of the part.

2) Create a Ruled/Lofted Surface between these two lines.

3) Create Curve at Intersection

      a) Selecting a Parasolid that is already open.

      B) Using the Created Ruled/Lofted Surface as Intersection of Parasolid.

 

Can you please point me to a good resource or example for these steps that I can pick apart a bit?

 

Thanks all!

James

 

Here is what I have so far, it isn't much yet...

Public Const PlaneLevel = 2
Call Main()

Sub Main()
    Call ResetAll
    Call CreateOutline    
    Call RepaintScreen(True)
End Sub

Sub ResetAll()
  Call RepaintScreen(True)
  Call ClearPromptLines
End Sub

Sub CreateOutline
Dim CLine
Dim intRet
Set CLine  = New McLn  

With CLine
 .X1 = -20
 .Y1 = -30
 .Z1 = 0
 .X2 = -20
 .Y2 = 50
 .Z2 = 0
 intRet = CreateLine(CLine, mcCONSTRUCTION_COLOR_CURRENT, PlaneLevel)

 .X1 = 20
 .Y1 = -30
 .Z1 = 0
 .X2 = 20
 .Y2 = 50
 .Z2 = 0
 intRet = CreateLine(CLine, mcCONSTRUCTION_COLOR_CURRENT, PlaneLevel)

End With       	

Set CLine = Nothing
End Sub

post-65344-0-25250100-1444231359_thumb.jpg

post-65344-0-02215500-1444231360_thumb.jpg

post-65344-0-44923500-1444231360_thumb.jpg

post-65344-0-86547100-1444231361_thumb.jpg

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