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: 

write parameters in ipt from iam using iLogic

1 REPLY 1
Reply
Message 1 of 2
Anonymous
244 Views, 1 Reply

write parameters in ipt from iam using iLogic

Is it possible to write parameters to an ipt file from an assembly when the ipt doesn't exist in the assembly

Perhaps by defining the ipt file path and then its specific parameter I want to write to?

1 REPLY 1
Message 2 of 2
Owner2229
in reply to: Anonymous

Hi, you'll have to open the part if you want to write in it, but you can open it as "hiden", so:

 

Dim FName As String = "C:\MyFolder\Mypart.ipt"
Dim MyPara As String = "MyParameter"
Dim oValue As String = "MyNewValue"
Dim oDoc As Inventor.Document = ThisApplication.Documents.Open(FName, False) Dim oParams As Inventor.Parameters = oDoc.ComponentDefinition.Parameters Dim oPara As Inventor.Parameter = oParams.Item(MyPara) oPara.Expression = oValue
oDoc.Update
oDoc.Save
oDoc.Close(True)

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods

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

Post to forums  

Autodesk Design & Make Report