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:

Multi line comments from Machine Group Comment


Recommended Posts

I'm working from the MPmaster.pst (2020) and I want the Machine Group comments from the input box in Mastercam to output a new comment for each end of line from the box in mastercam. For example, inside Mastercam, in the box I have:

Customer

Part

Description

Offset

Notes

 

but right now, it outputs everything on one line:

(Customer, Part, Description, Offset, Notes)

 

Is there an easy way to change this?

Link to comment
Share on other sites
1 hour ago, machineimpossible said:

I'm working from the MPmaster.pst (2020) and I want the Machine Group comments from the input box in Mastercam to output a new comment for each end of line from the box in mastercam. For example, inside Mastercam, in the box I have:

Customer

Part

Description

Offset

Notes

 

but right now, it outputs everything on one line:

(Customer, Part, Description, Offset, Notes)

 

Is there an easy way to change this?

You could use a special ASCII character as the "break point", and use the "break string" function to break the lines at the character. Look at the string manipulation functions in the MP Post Guide.

Link to comment
Share on other sites

You will notice, that by having the 'comment$' command variable inside 'pheader$', that the Operation Comment for your 2nd Operation (following Manual Entry), will get 'dumped' with that Manual Entry info.

This is due to the way comments are "internally buffered". When 'comment$' is read, all the strings stored in the comment buffer are fed line-by-line, through 'pcomment$'. (Technically, we then process them in the user-defined Post Block 'pcomment2'.)

I have covered the process of adding a flag variable to track "header processing". While you are inside the Header, you detect and save any 1008 comments, for later output. (Inside 'psof$'.) Then, in 'psof$', you set the flag variable so that 1008 comments process like normal. 

Link to comment
Share on other sites

Just came across in this topic, so...

Use semicolon ";" or "enter/EOB" in group comments as "separator"

pGroupComment
		sav_spc = spaces$
		spaces$ = zero
		sTL_Name = groupinfo(19111)
		sTL_String = sTL_Name
		#
		#"Input:", *sTL_Name, e$
		#
		while zero <> strstr(";", sTL_Name) | zero <> strstr(no2asc(13), sTL_Name),
		[
			if zero <> strstr(";", sTL_Name), sTL_HolderName = brksps((strstr(";", sTL_Name)), sTL_Name)
			else, sTL_HolderName = brksps((strstr(no2asc(13), sTL_Name)), sTL_Name)
			sTL_String = sTL_Name
			sTL_Name = sTL_HolderName
			
			#Remove semicolon
			if strstr(";", sTL_Name) = one,
			[
				sTL_Name = brksps(two, sTL_HolderName)
				sTL_HolderName = sTL_Name
			]
			
			#Remove EOB
			if strstr(no2asc(13), sTL_Name) = one,
			[
				sTL_Name = brksps(three, sTL_HolderName)
				sTL_HolderName = sTL_Name
			]
			
			#Output current line from Group comment
			sopen_prn, sTL_String, sclose_prn, e$
		]
		#Output last line
		if strlen(sTL_Name) <> zero, sopen_prn, sTL_Name, sclose_prn, e$
		spaces$ = sav_spc

 

Or check my Note2Post stuff: https://www.youtube.com/watch?v=SBOgD3HoV60

  • Like 1
Link to comment
Share on other sites

Thank you. I will look into this more in the future. What I find strange is that using Manual entry "as comment" already works as I like, starting a new comment in the code for each end of line in the input box. But I can't seem to find in the .pst why it is treating the group comment box differently than the manual entry box

Link to comment
Share on other sites
7 minutes ago, machineimpossible said:

Thank you. I will look into this more in the future. What I find strange is that using Manual entry "as comment" already works as I like, starting a new comment in the code for each end of line in the input box. But I can't seem to find in the .pst why it is treating the group comment box differently than the manual entry box

Manual entry and group comment are different animals. If you OK with Manual Entry as first OP, go for it.

It might will be mixed up if your first (technically second in the OP list) machining operation has a comment, then it might will be mixed with first Manual Entry OP...

Link to comment
Share on other sites
  • 5 months later...
On 5/26/2020 at 5:46 AM, Peter - NCS Ltd. said:

Just came across in this topic, so...

Use semicolon ";" or "enter/EOB" in group comments as "separator"


pGroupComment
		sav_spc = spaces$
		spaces$ = zero
		sTL_Name = groupinfo(19111)
		sTL_String = sTL_Name
		#
		#"Input:", *sTL_Name, e$
		#
		while zero <> strstr(";", sTL_Name) | zero <> strstr(no2asc(13), sTL_Name),
		[
			if zero <> strstr(";", sTL_Name), sTL_HolderName = brksps((strstr(";", sTL_Name)), sTL_Name)
			else, sTL_HolderName = brksps((strstr(no2asc(13), sTL_Name)), sTL_Name)
			sTL_String = sTL_Name
			sTL_Name = sTL_HolderName
			
			#Remove semicolon
			if strstr(";", sTL_Name) = one,
			[
				sTL_Name = brksps(two, sTL_HolderName)
				sTL_HolderName = sTL_Name
			]
			
			#Remove EOB
			if strstr(no2asc(13), sTL_Name) = one,
			[
				sTL_Name = brksps(three, sTL_HolderName)
				sTL_HolderName = sTL_Name
			]
			
			#Output current line from Group comment
			sopen_prn, sTL_String, sclose_prn, e$
		]
		#Output last line
		if strlen(sTL_Name) <> zero, sopen_prn, sTL_Name, sclose_prn, e$
		spaces$ = sav_spc

 

Or check my Note2Post stuff: https://www.youtube.com/watch?v=SBOgD3HoV60

I'm trying to use this, but am not sure where to put it, and where to put the call for it.

Thanks

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