Drawing Sheet Change Template Macro

Hi everyone,
i am trying to write a macro that replace the template of our drawings.
I have is that most of the macros use the “Defautl” as one of the inputs for “SetupSheet5” function and for some wierd reason most of our drawing use different views to get the custom properties amd they are tied to different configurations of a part.
Is there any command that I can use to get the value for this input for the following function?

swDrawDoc.SetupSheet5(swSheet.GetName(),
                                                        (int)vSheetProperties[0],
                                                        (int)swDwgTemplates_e.swDwgTemplateCustom,
                                                        vSheetProperties[2],
                                                        vSheetProperties[3],
                                                        Convert.ToBoolean(vSheetProperties[4]),
                                                        swSheet.GetTemplateName(),
                                                        vSheetProperties[5],
                                                        vSheetProperties[6],
                                                        "Default", //change this
                                                        true);

1

1 Like

i solved.

swSheet.CustomPropertyView

swDrawDoc.SetupSheet5(swSheet.GetName(),
                                                        (int)vSheetProperties[0],
                                                        (int)swDwgTemplates_e.swDwgTemplateCustom,
                                                        vSheetProperties[2],
                                                        vSheetProperties[3],
                                                        Convert.ToBoolean(vSheetProperties[4]),
                                                        swSheet.GetTemplateName(),
                                                        vSheetProperties[5],
                                                        vSheetProperties[6],
                                                        swSheet.CustomPropertyView, 
                                                        true);
1 Like

Great work! Thanks for posting the answer!

1 Like

I don’t know what else you used, but this example on Codestack may also be helpful for your purposes.

1 Like

We say i learned late this
i shared same answer