get a part from its file name

get a part from its file name

TONELLAL
Collaborator Collaborator
2,243 Views
4 Replies
Message 1 of 5

get a part from its file name

TONELLAL
Collaborator
Collaborator

Hello,

I have a list of Inventor parts (path + filename), on which I need to get properties.

I know manipulate the part document once I have it, but how can I create it ?

For example :

dim myfilename as string

dim oPart as partdocument

 

filename = "c:\project\mypart.ipt"  'I know this file exist

'Looking for something like :

set oPart = filename

 

Alain

0 Likes
Accepted solutions (1)
2,244 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor
Accepted solution

Using the API, you can find this information easily.

 

http://help.autodesk.com/view/INVNTOR/2018/ENU/?guid=GUID-AA811AF0-2494-4574-8C43-4C22E608252F

 

oPartDoc = ThisApplication.Documents.Open(filename, boolvis)

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 3 of 5

bradeneuropeArthur
Mentor
Mentor

From inside inventor you should use inventor with Inventor.documents.openwithoptions(,,)

 Dim oDoc As Inventor.Document
Dim AppInventor as Inventor.application
AppInventor= getobject(,"Inventor.application")
Dim oNVM As Inventor.NameValueMap oNVM = AppInventor.TransientObjects.CreateNameValueMap AppInventor.SilentOperation = False AppInventor.Visible = True AppInventor.WindowState = Inventor.WindowsSizeEnum.kNormalWindow oDoc = AppInventor.Documents.OpenWithOptions(FrmStartInventorExportUpdateTool.LvProgressLog.SelectedItems.Item(0).Text, oNVM, True)

From outside inventor you should use apprenticeserver with  Inventor.documents.openwithoptions(,,)

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 4 of 5

TONELLAL
Collaborator
Collaborator

Thanks !

I work from Inventor, on an already open iam, so I used first solution.

0 Likes
Message 5 of 5

bradeneuropeArthur
Mentor
Mentor

Than please:

 

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes