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:

vb.net2013&mastercam x5


Recommended Posts

What you are asking for is possible .
X5 was when the ability to get data “directly” back from an add-in (C-Hook or NET-Hook) that was run from within a PST became available.

Is not the Date and Time data already available in the MP Post language?
Here is from the std. MPFAN.PST from X7, showing different output styles ->

sopen_prn, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
#sopen_prn, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
#sopen_prn, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
#sopen_prn, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
#sopen_prn, "TIME - ", ptime sclose_prn, e$  #12 hour time output 3:52 PM


 

Link to comment
Share on other sites
15 hours ago, Roger Martin from CNC Software said:

What you are asking for is possible .
X5 was when the ability to get data “directly” back from an add-in (C-Hook or NET-Hook) that was run from within a PST became available.

Is not the Date and Time data already available in the MP Post language?
Here is from the std. MPFAN.PST from X7, showing different output styles ->

sopen_prn, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
#sopen_prn, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
#sopen_prn, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
#sopen_prn, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
#sopen_prn, "TIME - ", ptime sclose_prn, e$  #12 hour time output 3:52 PM


 

I know in pst has this parameter,but i want use vb.net to get this value,.

i think know vb.net method  to do .

thanks.

Link to comment
Share on other sites
On 2017/8/8 at 3:30 AM, Roger Martin from CNC Software said:

What you are asking for is possible .
X5 was when the ability to get data “directly” back from an add-in (C-Hook or NET-Hook) that was run from within a PST became available.

Is not the Date and Time data already available in the MP Post language?
Here is from the std. MPFAN.PST from X7, showing different output styles ->

sopen_prn, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
#sopen_prn, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
#sopen_prn, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
#sopen_prn, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
#sopen_prn, "TIME - ", ptime sclose_prn, e$  #12 hour time output 3:52 PM


 

i want to know how to use vb.net devlopment dll link post for sample,that how can do it ?

Link to comment
Share on other sites
On ‎2017‎年‎8‎月‎13‎日 at 9:12 PM, Mick George said:

If you just want to add the current time and date you can do that in the post, you don't need a NET-Hook to do that as Roger mentioned above.

i need template for this method, i want get computer logname return to mastercam x5 post,thanks

Link to comment
Share on other sites
On 2017/8/13 at 9:12 PM, Mick George said:

If you just want to add the current time and date you can do that in the post, you don't need a NET-Hook to do that as Roger mentioned above.

I don't know where the problem is, and if you can provide a similar method or code, thank you very much.

in vb.net source code

        Public Overrides Function Run(ByVal param As Integer) As MCamReturn
            Dim username As String
            Dim strComputerName As String


            username = Environment.GetEnvironmentVariable("USERNAME")
            strComputerName = Environment.GetEnvironmentVariable("COMPUTERNAME")

            'DialogManager.OK(username + vbCrLf + strComputerName, "Logname")

            PostingManager.PostProcessorArguments = Val(username)

            Return MCamReturn.NoErrors
        End Function

in mpfan.pst source code

sparams : ""                  # Will be the command parameter line passed to the DLL

strDll : "C:\Program Files (x86)\mcamx5\chooks\Logname.dll"
#-----------------------------------------------------------------------------
# Below code added your post same location
#-----------------------------------------------------------------------------       
pheader$         #Call before start of file
     
      result = dll(strDll,sparams)
      *sparams,e$

error info

无标题.png

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