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: 

Update Model States Via Spreadsheet

1 REPLY 1
SOLVED
Reply
Message 1 of 2
ndillner343SKL
236 Views, 1 Reply

Update Model States Via Spreadsheet

Hello - 

I'm use to updating iParts using the following code. But model states work differently. Therefore, I'm running into issues with it and I'm not familiar enough with model states to know how to fix it. My main question is how to access the excel spreadsheet of model states to update them? I would greatly appreciate any sort of help with this. Thank you!

 

Sub Main()
	oDef = ThisApplication.ActiveEditDocument.ComponentDefinition
	
	Dim oFactory As iPartFactory
	oFactory = oDef.iPartFactory
	
	Dim oWorkSheet
	oWorkSheet = oFactory.ExcelWorkSheet
	
	Dim oWB
	oWB = oWorkSheet.Parent
	
	Dim oCells
	oCells = oWorkSheet.Cells

	oWB.Save
	oWB.Close
End Sub

 

1 REPLY 1
Message 2 of 2
dalton98
in reply to: ndillner343SKL

This might be it?

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oCompDef As AssemblyComponentDefinition
oCompDef = oDoc.ComponentDefinition


oWorkSheet = oCompDef.ModelStates.ExcelWorkSheet

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report