- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Post Processor - CAD file name as a comment including file name extensions
So in the HSM Post Forum I found how to add the CAD file as a comment, however that does not fully accomplish what I needed as I would like to see the extensions of the file I used as well. I am using Creo files that end in .prt.VersionNumber, as in .prt.1 for version 1 or prt.15 for version 15.
I can see on the side window that it sees the extension names, I am hoping I can include this on the NC file as well.
This is the code I found and works fine but for the importing the CAD file name but it does not include any extensions.
//file name
var documentPath = getGlobalParameter("document-path");
writeComment(documentPath);
Does anyone know if its possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I don't think this is possible..

Seth Madore
Customer Advocacy Manager - Manufacturing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not sure if it is 100% what you are after, but I output this:
(POSTED FROM FILE=10048-M1-M2.MC1.IAM) (which is an Inventor file).
I get that output with this code:
var inventorFileName = FileSystem.getFilename(getGlobalParameter("document-path"));
writeComment("POSTED FROM FILE=" + inventorFileName);
Similar to your code, but it gets it from FileSystem... This also works in Fusion, I use it there too, just change the variable name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I just tried it in Fusion, and it works.
My file was called 6392-M2.35V, and it was version 8 in fusion, the comment output was this:
(POSTED FROM=6392-M2.35V V8)
I think this is what you were after.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Not quite, I tried your code however it returns the same thing, that is the file name and the Fusion version number.
Probably because as soon as you upload a third part model, i.e. STEP or .PRT it creates its own file and associates that?
Instead of the actual file name I am looking for the filename which the solid model was imported from. so for example, on the left view panel, when you expand the version list, the very first version shows from which file this was imported from.
Trying your code returns POSTED FROM=222-091-pcb-base v19 which was the last Fusion file version, not the imported model one's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Gotcha, sorry, probably like Seth said, or at least I don't know myself how to do it. I misunderstood the initial request.
Fusion