Sign in to follow this  
machineimpossible

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Not having much success with the brksps function in the post. But now I realize that if a manual entry is the very first operation in the tree, it will post in the header section, so I'll just put what would be in my Machine Group comments there. 

  • Like 2

Share this post


Link to post
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. 

Share this post


Link to post
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 2

Share this post


Link to post
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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 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