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:

How to write VBS to scan the excel data and create a spline inside the mastercamX2


pohyg
 Share

Recommended Posts

Hello all,

I am doing a cam profile which base on data given by a excel file format.

For my intention i hope can write a VBS to read

all data for the excel file and convert it to a spline inside mastercam.

Because i can't find spline command inside mastercam VBS help and how to use the mastercam command "create_spline_points" in VBS to scan all the excel file data and output to a spline entity .

Note: Mastercam X2 open file can read ASCll (.TXT) and convert it to a spline but it need to do few step from excel file to done the job.

Thank you

Best Regards

Pohyg

Link to comment
Share on other sites

Pohyg,

 

I don't believe that there is a way using VB Script to create a spline in Mastercam (x2).

 

"Mastercam X2 open file can read ASCll (.TXT) and convert it to a spline but it need to do few step from excel file to done the job."

 

Questions:

1> What steps are needed, other than creating the CSV file from the data in your Excel sheet?

2> Is this point data for CAM profiles?

Link to comment
Share on other sites

1> Yes Roger Martin I need to write some formula to calculate the x and y value for the point .If I can scan the data for excel sheet and write the formula inside VBS to generate the point . Because the cam data on the excel sheet was base on every 0.1 degree angle and given a radius , so i need to use Tan?= o/j or

COS ? = h/j or sin?= o/h to output the X, y value for the points to create the spline.

2> Is possible use the mastercam command in VBS to scan and use the formular to output the spline entity

Thank you

Link to comment
Share on other sites

Hello Roger Martin,

Yes you are right data in excel sheet are polar angle and distance .

 

but I hope can write a VBS to calculate all the point and general out all the points inside the mastercam

and convert it to a spline.

Can I use the mastercam command for example the at the VBS to draw the Spline.

currently I was using Mcam X2 MR1 SP1 and

this is my interest to learn how to write the VBS for the CAM profile

and to go one step forward to explore the function of VBS in mastercam.

 

I had E-mail the example excel data to you

 

please let me know went you are received .

 

Thank you

Best regards

Pohyg

Link to comment
Share on other sites

Reger Martin,

 

Thank you for VBS I will send my VBS to you that I was modify from the MC9 example and I was Some question , how to set the below value at my VBS .

 

SetLevelVisibleByNumber(10) ' poh addin ??

Bool False ' poh addin ??

 

Note: Below was mastercam VBS Help example

 

// set the named level visible by entering its name

 

Bool SetLevelVisibleByName (

 

String (Input: name of level)

 

Bool (Input: True = show/ False = hide)

 

)

Thank you

 

pohyg

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