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:

Full PathName of MasterCam drawing


Recommended Posts

Im trying to get the full path/filename of the mastercam drawing in my post.

'smcname' seems to return the drawing name only, without the path

 

I tried dumping all params with:

"pparameter", ~prmcode$, ~sparameter$, e$

and it didnt show up.

 

The NCI shows it right at the beginning, first two lines.

 

I defined a string var up top:

sLongName : ""

in the pcomment2 section, I added :

if gcode$ = 1050, sLongName =(sparameter$, 9)

 

nothing. Tried:

if gcode$ = 1050, sLongName = scomm$

still empty.

 

Anybody wanna help ?

Link to comment
Share on other sites

There are some General rules for pulling parameters. First, you need to pull the parameters in pparameter$ or pwrttparam$.

 

There you need to use the prmcode that matches with the output value you are looking for:

 

if prmcode$ = XXXXXX, slongname = ucase(sparameter$) <-- used for when a parameter holds a single string

or

if prmcode$ = XXXXXX, slongname = rpar(sparameter$,Y) <-- used for when a parameter holds Y values seperated by single spaces

 

Hopefully this should give you enough information to do what you need. There is likely examples of the parameter pulls in the post already

 

HTH

Link to comment
Share on other sites

spathnc$ = ucase(spathnc$)

smcname$ = ucase(smcname$)

 

 

I have that in my pheader postblock,

then this...

 

 

scomm_str, "MCX FILE - ", smcpath$, smcname$, smcext$, scomm_end, e$

 

:edit:

I believe (not positive) the "$" at the end of the variable means it is a predefined variable and does not need to be initialized, formatted, pulled via pparameter, etc....

  • Like 1
Link to comment
Share on other sites

spathnc$ = ucase(spathnc$)

smcname$ = ucase(smcname$)

 

 

I have that in my pheader postblock,

then this...

 

 

scomm_str, "MCX FILE - ", smcpath$, smcname$, smcext$, scomm_end, e$

 

:edit:

I believe (not positive) the "$" at the end of the variable means it is a predefined variable and does not need to be initialized, formatted, pulled via pparameter, etc....

 

That did the trick! Thank you!

Link to comment
Share on other sites

Isnt rpar used to convert strings to numbers?

 

Glad you got it working.

 

Here is info on rpar from the V9 post ref guide.

 

rpar

Formula Type Special MP function

Description Extracts the numeric variables from a space-delimited string variable.

The first argument is a string variable with space-delimited values.

The second argument is the number of elements to be read from the

string.

The string is converted and the result array is filled in order, starting

with the numeric variable position of the result numeric variable name.

Form function argument, argument

First Argument string variable

Second Argument numeric variable, value (scalar)

Return Type numeric variable (array)

Formula Code Ex. real_var1 : 0 #User-defined numeric variables

real_var2 : 0

real_var3 : 0

real_var4 : 0

real_var5 : 0

string1 “1.1 2.2 3.3 4.4 5.5”

pblock # A postblock

real_var1 = rpar(string1, 5)

In this example, real_ var1 = 1.1, real_var2 = 2.2, real_var3 = 3.3,

real_var4 = 4.4 and real_var5 = 5.5.

Boolean Code Ex. Not allowed as a Boolean statement

Notes This routine can be used to convert a string variable with a single

number in it to a numeric variable. Set the number of elements to read

to 1.

See Volume 2, Parameter Information for more information.

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