Add silent save to Macro for drawing and it's referenced part file.

 

I want to preface this by saying I have no idea what I'm doing with macros/coding/api. I've only made it this far thanks to code stack and AI chats. However AI seems to be having a hard time with my last request so I'm here to see if someone who knows what they are doing would be willing to help! I have a drawing that references one part file. I have a PDM template that creates a new drawing and new part from these original files. The problem is that when creating new files using the PDM templates it does not create a link between the new part and the new drawing. The new drawing still references the original part file. (There is already an enhancement request to make the new drawing reference the new part) I have the attached macro that replaces the original part with the new part, rebuilds, then sorts the BOM the way I want it to. 

 

What I want is to add a silent save after its done with everything else. I want it to save the drawing and the referenced part file (the part file is not open). 

 

AI was able to add the silent save of the drawing and the part file but both the drawing and the part were immediately marked as modified after the save so when I close the document it still prompts to save the modified files. It gave me several different options, all with the same result. I'm unsure why they are being marked as modified. It's something happening in the background.  

 

Is what I'm asking possible? Anyone willing to help out?