New Part document

Anonymous

New Part document

Anonymous
Not applicable
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?
0 Likes
Reply
624 Views
6 Replies
Replies (6)

Anonymous
Not applicable
No suggestions from Autodesk??
0 Likes

Rene-J
Collaborator
Collaborator
Try This

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

René J
0 Likes

Anonymous
Not applicable
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-
0 Likes

Anonymous
Not applicable
Thanks sanjay,
0 Likes

smilinger
Advisor
Advisor
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.
0 Likes

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