
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everybody!
I'm having a small problem with this code, something that must work on sheet-metal parts.
My plugin must check if the current document is a Sheet-metal part, if not, it tries to open a new Sheet-metal document using the right template.
if (m_AddIn.m_Application.ActiveDocumentType == DocumentTypeEnum.kPartDocumentObject) { m_curDoc = m_AddIn.m_Application.ActiveDocument as PartDocument; if (m_curDoc != null) if (m_curDoc.SubType != "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}")
m_curDoc = null; }
if (m_curDoc == null) // either kNoDocument or not a sheet-metal part { // find a sheet-metal template String szTemplateFile = m_AddIn.m_Application.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject, SystemOfMeasureEnum.kDefaultSystemOfMeasure, DraftingStandardEnum.kDefault_DraftingStandard, "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"); // open new sheet-metal document m_curDoc = m_AddIn.m_Application.Documents.Add(DocumentTypeEnum.kPartDocumentObject, szTemplateFile, true) as PartDocument; }
That code worked well for many years, with different versions of Inventor, but always without localization. This year I installed Inventor 2017 and also the Italian language pack, and this code now don't work anymore, since GetTemplateFile() now return null.
I did a clean install in a new machine and I can confirm the problem arises ONLY AFTER installing the language pack.
My best guess is that the GUID for the Sheet-metal template have somewhat changed, but if I manually open a new sheet-metal part document before launching the plug-in, the SubType is still the same (I tried different versions, both metric and english units).
I tried to search that GUID in registry but is nowhere to be found, so really I don't know how Inventor associate that GUID with the right template.
Does anyone know how templates are associated with that GUID?
May I use something else instead of that GUID to get the right Sheet-metal template?
Is there another way to create a sheet-metal part without using the template GUID?
Anyone had same problem after installing a language pack?
Thank you!
Solved! Go to Solution.