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: 

add user path to projet file

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
GeorgK
1208 Views, 13 Replies

add user path to projet file

Hello together,

 

I found an old thread with the same problem but without a solution

 

http://forums.autodesk.com/t5/inventor-customization/add-user-path-to-projet-file-does-not-work-user...

 

Dim m_inventorApp As Inventor.Application = Nothing
m_inventorApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")

Dim oProjectManager As DesignProjectManager
oProjectManager = m_inventorApp.DesignProjectManager

'Dim oProject As DesignProject
Dim strWorkspacePath As String
strWorkspacePath = oProjectManager.ActiveDesignProject.WorkspacePath
MsgBox(strWorkspacePath)
oProjectManager.ActiveDesignProject.FrequentlyUsedPaths.Add("Modelle", strWorkspacePath & "\Modelle")
oProjectManager.ActiveDesignProject.FrequentlyUsedPaths.Add("Zeichnungen", strWorkspacePath & "\Zeichnungen")

How could I add the paths? The folder exists already.

 

Thanks

Georg

13 REPLIES 13
Message 2 of 14

Hi,

 

After lots of trial and error with the project file and configuration of it, i came up with another approach that perfectly works for me.

 

I've created manually a complete project file, with a complete folder structure and saved it somewhere as a template.

 

I .NET i just have to copy and rename the folder and project file and place it in my project directory and activate it.

 

I did not solved the original problem, but i walked around it.

 

For new projects this is (for me) the best start and easy to manage if things changes in my project files over time.

 

For old project i just copy a new project over my old project with the new, correct settings.

 

Far more easier then programming the project file.

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 14

Hello Frederic,

 

To make a textfile with all the options is a workaround. I hope there is a solution from Autodesk for the problem.

 

Cheers

 

Georg

Message 4 of 14
xiaodong_liang
in reply to: GeorgK

Hi,

I can still reproduce this issue (FrequentlyUsedPaths creates the invalid path, path is stroked through) in Inventor 2017. I logged it with our engineer team: TFS-147688.

Sorry for the inconvenience at this moment.
Message 5 of 14
GeorgK
in reply to: xiaodong_liang

Hello Xiaodong,

 

when and for what versions there will be a patch? The error is also in version 2014 to 2017.

 

Georg

Message 6 of 14
adam.nagy
in reply to: GeorgK

Hi Georg,

 

We do not know yet.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 7 of 14
adam.nagy
in reply to: GeorgK

For the time being, you could also use this workaround:

http://adndevblog.typepad.com/manufacturing/2016/11/add-to-frequently-used-subfolders-collection.htm...

 

 



Adam Nagy
Autodesk Platform Services
Message 8 of 14
GeorgK
in reply to: adam.nagy

Hello Adam,

 

thank you for your help. When is a fix for Inventor 2017 ready?

 

Georg

Message 9 of 14
adam.nagy
in reply to: GeorgK

Hi Georg,

 

Sorry for not getting back to you earlier, but there has been no update on the issue.

Since it's a very low priority (it has a workaround and not many people affected by it) it's very unlikely to be fixed for 2017.

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 10 of 14
Crstiano
in reply to: adam.nagy

@adam.nagy 

Using the same logic that you write the example, do you can to write how to add a new AppearanceLibraries and/or MaterialLibraries and activate at ipj. Cause I dont nothing about the XML... thanks

Cristiano Oliveira
Developer Addins | Consultant CAD/PLM | CAD Manager
https://www.ConsultCAD.com/


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 11 of 14
adam.nagy
in reply to: Crstiano

I think that might be possible through the Inventor API, but if not, then the best thing might be to save the project file with another name before adding the paths you need, then add the paths through the UI and save the project file with the actual name. 
Then compare the two project files to see what exactly got added. Next time you could then do the same programmatically using the XML library.



Adam Nagy
Autodesk Platform Services
Message 12 of 14
Crstiano
in reply to: adam.nagy

@adam.nagy  only I to have difficult to save the ipj via VBA after to edit it. Dont found out command or documentation exemplifying the save. Can you help?

Cristiano Oliveira
Developer Addins | Consultant CAD/PLM | CAD Manager
https://www.ConsultCAD.com/


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Message 13 of 14
adam.nagy
in reply to: Crstiano

This is what I meant:
https://modthemachine.typepad.com/my_weblog/2020/02/modify-inventor-project-ipj-directly.html

 

However, what you are trying to do seems possible through the Inventor API as well:
https://forums.autodesk.com/t5/inventor-customization/designprojectmanager-issues-trying-to-add-libr...



Adam Nagy
Autodesk Platform Services
Message 14 of 14
ls-4453
in reply to: GeorgK

This bug is still present in Inventor 2020. The workaround of editing the XML directly doesn't work because it requires all files to be closed, whereas the ProjectPaths.Add method works with files open.

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

Post to forums