Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New Part document

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
611 Views, 6 Replies

New Part document

oPartDoc = m_inventorApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject, _
m_inventorApplication.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject, _
SystemOfMeasureEnum.kMetricSystemOfMeasure, DraftingStandardEnum.kISO_DraftingStandard))

This is opening %INSTALLDIR%\Templates\Metric\Standard(DIN).ipt
How to open %INSTALLDIR%\Templates\Metric\Standard(mm).ipt?
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

No suggestions from Autodesk??
Message 3 of 7
Rene-J
in reply to: Anonymous

Try This

Dim opart As PartDocument
Set opart = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileOptions.TemplatesPath & "Metric\Standard (mm).ipt", True)

René J
Message 4 of 7
Anonymous
in reply to: Anonymous

This is indeed an issue. The metric templates folder only contained the
Standard (mm).ipt in the previous releases. The DIN templates were added in
Inventor 2009 and the GetTemplateFile is incorrectly picking these up. I've
logged this issue in the database. Thanks for reporting this.

As a workaround, you can hardcode the template file name as indicated by
René. Also, if you don't care about the DIN templates, you can move those
out of the metric directory and the API method will revert to the older
behavior.

Sanjay-
Message 5 of 7
Anonymous
in reply to: Anonymous

Thanks sanjay,
Message 6 of 7
smilinger
in reply to: Anonymous

Same error in Simplified Chinese version and, more.
In Chinese Version, I can't get the template file for sheet metal part. It returns an empty string for sheet metal. Also I cannot get the weldment assembly template, it returns "standard.iam" for me, which is the general assembly template, in both English and Chinese version.
I have tested this in several machines.
Message 7 of 7
Anonymous
in reply to: Anonymous

Thanks for the additional information. I've added this to the description
of the problem in the change request.
--
Brian Ekins
Autodesk Inventor API

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

Post to forums  

Autodesk Design & Make Report