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: 

VBA: Access PartDocume​nt object of iPart Factory, given iPart Member.

1 REPLY 1
SOLVED
Reply
Message 1 of 2
CragMonkey
1196 Views, 1 Reply

VBA: Access PartDocume​nt object of iPart Factory, given iPart Member.

How do I access the PartDocument object belonging to the iPart Factory that generated a given iPart Member?

 

Is there a way to access the file name of the factory that generated an iPart Member?

Dim oModelMember As PartDocument
Dim oModelFactory As PartDocument

Set oModelMember = ThisApplication.Documents.Open("C:\Temp\Handholds\142 - HH Style 13\142-32-1995 HANDHOLD, STYLE 13R.ipt", False)
Set oModelFactory = ThisApplication.Documents.Open("C:\Temp\Handholds\142 - HH Style 13.ipt", False)

 

I want to be able to open oModelFactory given oModelMember. I will be iterating through over a hundred different oModelMembers, so doing this manually would be tedious.

 

Any ideas? 

 

 

1 REPLY 1
Message 2 of 2
JohanLarsson
in reply to: CragMonkey

I have not used iParts much and dont know if this is what you want to do:

 

Public Sub PartTest()
    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument
    MsgBox (oPartDoc.ReferencedDocumentDescriptors(1).FullDocumentName)
End Sub

 

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12

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

Post to forums  

Autodesk Design & Make Report