U225X PUBLIC-SAFE CONVERSATION NOTE RECORD: CHAT-0345 TOPIC: SolidWorks Material Macro IMPORTED: 2026.06.16 This note was generated from a matching conversation in the supplied ChatGPT export. EXTRACTED REQUEST: Can we write a macro in solid works that jumps into anywhere from the this top level assembly and makes sure the Material is set to RNS_MATERIAL, STAINLESS, "STAINLESS, 304" Like shown in the screen shot? RECOVERED CONVERSATION EXCERPTS USER MESSAGES: 1. Can we write a macro in solid works that jumps into anywhere from the this top level assembly and makes sure the Material is set to RNS_MATERIAL, STAINLESS, "STAINLESS, 304" Like shown in the screen shot? 2. i want it to overwrite it too I am not seeing my custom RNS_MATERIALS .sldmat anywhere I tihnk i created it in this screen ASSISTANT RESPONSES: 1. Yes. In fact, that's a fairly straightforward SolidWorks API macro. The macro can: 1. Start from the active top-level assembly. 2. Traverse every component recursively: - Parts - Subassemblies - Parts inside subassemblies - Parts inside nested subassemblies 3. Open each part silently if needed. 4. Check the assigned material. 5. If the material is not: [code excerpt omitted] then assign it. 6. Save the part. 7. Continue until the entire assembly tree is complete. 8. Produce a report at the end showing: - Parts changed - Parts skipped - Errors A few things I need to know before writing it: 1. Material Database Location When you right-click the material and choose Edit Material, what is the full path shown under… 2. Yes — use this version. It will overwrite every part it finds from the top assembly down, including subassemblies. Use this material setting: [code excerpt omitted] Paste this into a new SolidWorks VBA macro: [code excerpt omitted] One thing: your library name in the left tree is RNS_MATERIALS, not RNS_MATERIAL. The macro needs to match that exactly. EXTRACTED KNOWLEDGE / HOW-TO - Start from the active top-level assembly. - Traverse every component recursively: - Parts - Subassemblies - Parts inside subassemblies - Parts inside nested subassemblies - Open each part silently if needed. - Check the assigned material. CONVERSATION SHAPE: 2 user turns / 2 assistant turns ATTACHMENTS DETECTED: 17 Raw transcripts, private details, exact locations, account information, employer/customer-confidential material, and restricted software references are not published in this note. PROPERTY OF U225X / PUBLIC-SAFE IMPORT