Inventor Customization

Reply
New Member
2 Posts
0 Kudos
Registered: ‎01-11-2013
Post 1 of 3

New Part Units

123 Views, 2 Replies
01-11-2013 08:37 AM

First day programing VB.net API for inventor, So Yes this a Noob Question

I using code similar to add a new part to an instance of Inventor, and it works OK. The problem is it is using the Metric Template instead of Imperial Template. I have check and confirmed my application preferences and they reflect "inches". Inve is the Variable name for my Inventor.Application. Thank You in advance


    Set Part = Inve.Documents.Add(kPartDocumentObject)

New Member
2 Posts
0 Kudos
Registered: ‎01-11-2013
Post 2 of 3

Re: New Part Units

01-11-2013 08:48 AM in reply to: ped.watt

I have found a Solution by changing the code to:

Part = Inve.Documents.Add(kPartDocumentObject, "C:\Users\Public\Documents\Autodesk\Inventor 2013\Templates\Standard.ipt")

But is there  cleaner way of doing it?

ADN Support Specialist
649 Posts
103 Kudos
Registered: ‎03-26-2007
Post 3 of 3

Re: New Part Units

01-16-2013 10:29 AM in reply to: ped.watt

Hi,

 

You can use the Application.FileManager.GetTemplateFile to get the default template. 

Like in this blog post:

http://modthemachine.typepad.com/my_weblog/2013/01/c-help-examples-for-sheet-metal.html

 

Cheers,



Adam Nagy
Developer Technical Services
Autodesk Developer Network
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!