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:

Adding windows login name to post??


RandleXX
 Share

Recommended Posts

I would like to add a login name to the post so I can tell who actually posted the code.

 

Is this easily possible?

 

I have set up a user entered question (fq) in the post , but most the time the user just leaves this blank, so I would like to make it so the users login name (from windows) would be in the post.

 

Any ideas?

 

Thanks,

Randle

Link to comment
Share on other sites

There is nothing in the MP language that will give you that type of information.

 

You could write a utility that queried the login ID, wrote it out to a TXT file and then in your post open the TXT file as a buffer and read it in.

 

Just a thought.

 

I'll definitely add a enhancement request for MP to see if there is something that we can do behind the scenes and store it off in a predefined variable.

Link to comment
Share on other sites

set your post up with the exitpost command if a valid name/id is not entered. Give each programmer a unique id number and attach that number to their name, then when they enter their id you see their name and no id entered just exits and they can't post code. Its a hard handed approach but as long as they dont share their id number it will get what you want.

Link to comment
Share on other sites

Here is the variable for sim#

 

code:

sim_no$  

So you could make a string like the month string but use names:

 

code:

# Select month

smon00 ""

smon01 "JAN"

smon02 "FEB"

smon03 "MAR"

smon04 "APR"

smon05 "MAY"

smon06 "JUN"

smon07 "JUL"

smon08 "AUG"

smon09 "SEP"

smon10 "OCT"

smon11 "NOV"

smon12 "DEC"

smonth

 

fstrsel smon00 month$ smonth 13 -1

Change it to something like so:

code:

  

sname00 "UNKNOWN SIM"

sname01 "MIKE"

sname02 "MIKE"

sname03 "MIKE"

sname04 "MIKE"

sname05 "MIKE"

snamesim

 

fstrsel sname00 namesim snamesim 6 -1


This example is using 6 names.

 

Ok now what well you have to make a look up method to take the sim# and then compare it to then make that become a way to set the number for the string variable to then go back to:

 

code:

psname_sim

if sim_no$ = 374584, snamesim = 1

if sim_no$ = 534543, snamesim = 2

if sim_no$ = 233423, snamesim = 3

is sim_no$ < 233423, snamesim = 0


So you will have to write the logic to cover anything above or below you highest and lowest sim number to equal zero to then output UNKNOWN SIM when posted.

 

Then in the header section lime mine you just use the psname_sim.

 

Like so:

code:

pheader_upr

#"%", e

#!spaces$

spaces$ = 0

#*progno$, " (", sprogname$,")", e$

#spaces$ = prv_spaces$

#pbld, n$, *smetric, e

"(PROGRAM NAME - ", sprogname$, ")", e$

"(CUSTOMER - ", prdbcustp, ")", e$ # Added RDB

"(PART NUMBER - ", smachgrp_name, ")", e$ # ADDED Roger Martin

"(MODEL # - ", smachgrp_name, ".CATPART)", e$ # Added RDB

"(PROGRAMMER - )", psname_sim, e$ # Added RDB

"(DATE - ", *smonth,"-",day$,"-",*year2,")", e$ #Date output as month,day,year - Ex. Feb. 12 2005

"(TIME - ",ptime,")", e$ #12 hour time output 3:52 PM

"(PROGRAM REV - ", psrev, ")", e$

spaces$ = 1

then when you output code it would like so:

code:

(PROGRAM NAME - E1025100)

(CUSTOMER - BOEING)

(PART NUMBER - 17P1C2054-5 REV C)

(MODEL # - 17P1C2054-5 REV C.CATPART)

(PROGRAMMER - MIKE)

(DATE - OCT-05-2009)

(TIME - 4:54 PM)

{edit)

Also if you wanted to get fancy you could put the sim number in the Programmer name just by adding sim_no$ to the line like so:

 

code:

"(PROGRAMMER   - )", *psname_sim, *sim_no$, e$ # Added RDB  

Also you will have to define some variable here, but like I said it should be enough to point you in the right direction or just ask when you get stuck and one of the smart guys on here can help you out.

 

HTH

Link to comment
Share on other sites

Here is something I found on the net to get a user name on a computer:

quote:

Windows instructions

 

1. Open a Windows Command Prompt. To open the prompt go to the Start menu > Accessories > Command Prompt

2. In the Command Prompt, type “set username” and press Enter

3. Your computer login name will be displayed after the "username=" tag.

If you made a little VB script you could then call the VB script from the post. Then maybe you could exchange information from the VB script back to the post. Just a thought.

 

Here is a link to that method using VB:

 

Linky:

 

HTH

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