05-02-2021
02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-02-2021
02:52 AM
Hi,
TRLD: How can i open a part that was ceated in an assembly bebore saving it?
when i create a new part in an assembly with the create button, the file is not created untill i save the part for the first time, so using " oDoc = thisapplication.Documents.open(file path) " won't work since no path exists.
Using the right click button, i can open the part and edit it. how can i open it using VBA/VB.net code?
Thanks
Solved! Go to Solution.
05-03-2021
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-03-2021
07:15 AM
To make document visible, you just add a view of it. Similar to:
Dim doc As PartDocument
Set doc = ThisApplication.Documents(ThisApplication.Documents.Count)
Call doc.Views.Add
Thank you,

Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.
05-03-2021
11:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-03-2021
11:01 PM
Thank you!
I think you misunderstood what i wanted to do but your comment helped a lot.
this is what i needed (VBA):
Set oDoc = ThisApplication.ActiveDocument
Set sSet = oDoc.SelectSet
Set oDoc2 = sSet.Item(1).Definition.Document
oDoc2.Views.Add