Community
Fusion Manufacture
Talk shop with the Fusion (formerly Fusion 360) Manufacture Community. Share tool strategies, tips, get advice and solve problems together with the best minds in the industry.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Post Processor - CAD file name as a comment including file name extensions

6 REPLIES 6
Reply
Message 1 of 7
constantin3x
235 Views, 6 Replies

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.

constantin3x_0-1680535638136.png

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?

 

 

 

6 REPLIES 6
Message 2 of 7
seth.madore
in reply to: constantin3x

I don't think this is possible..


Seth Madore
Customer Advocacy Manager - Manufacturing
Message 3 of 7
constantin3x
in reply to: seth.madore

Fair enough, thank you for the reply Seth

Message 4 of 7
DarthBane55
in reply to: constantin3x

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.

Message 5 of 7
DarthBane55
in reply to: DarthBane55

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.

Message 6 of 7
constantin3x
in reply to: DarthBane55

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.

constantin3x_0-1680645342567.png

Trying your code returns POSTED FROM=222-091-pcb-base v19 which was the last Fusion file version, not the imported model one's. 

Message 7 of 7
DarthBane55
in reply to: constantin3x

Gotcha, sorry, probably like Seth said, or at least I don't know myself how to do it.  I misunderstood the initial request.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report