Create comment linked to configurations file data

Create comment linked to configurations file data

LearnItAlready
Explorer Explorer
498 Views
3 Replies
Message 1 of 4

Create comment linked to configurations file data

LearnItAlready
Explorer
Explorer

I hoping to accomplish the following:

I’m trying to do is create a comment at the beginning of an NC file that refers to a specific configuration “Component Name,” “Part Number,” and “Description.” Each will have its own line of code as a comment.

 

The standard format for writing a comment that I can find is this:

/**
Output a comment.
*/
function writeComment(text) {
writeln(formatComment(text));
}
 
What is the code that links to specific configuration aspects like “Component Name,” “Part Number,” and “Description"?

I would appreciate your help very much. Thank you amazing community!
0 Likes
Accepted solutions (2)
499 Views
3 Replies
Replies (3)
Message 2 of 4

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

You can create a manual NC comment which would invoke the function writeComment() while post processing

boopathisivakumar_0-1733926934275.png

 


Boopathi Sivakumar
Senior Technology Consultant

Message 3 of 4

LearnItAlready
Explorer
Explorer

Thank you for your quick reply. I don't think I explained myself well enough the first time. 

 

I would like to output the Part Number into my NC file. Is there a way to do that?

 

Thanks!

0 Likes
Message 4 of 4

Jorge_Jaramillo
Collaborator
Collaborator
Accepted solution

Hi,

 

The model information (components, bodies, etc) are not shared to the post-processors, and that is why their properties are not available there.

 

I think there are three ways to send information to the post-procesor:

1) With Manual NC 's commands like @boopathi.sivakumar  suggested before

2) With a custom post-property (yellow highlighted in the image below)

3) Using the "notes" parameter (red highlighted in the image below)

 

Jorge_Jaramillo_0-1733956492793.png

 

In any case you might need either set its value manually or develop a script that copies the component properties you need to it.

Then in the post-processor you need a custom modification to look for the property/parameter and to write it to the post-file with the writeComment() function.

 

Regards,

Jorge Jaramillo