Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change IPT iProperty "Material" with a VBA macro

1 REPLY 1
Reply
Message 1 of 2
isocam
1232 Views, 1 Reply

Change IPT iProperty "Material" with a VBA macro

Can anybody help???

 

Does anybody know how to change an "IPT" files iProperty "Material" with a VBA macro?

 

For example,

 

If I have created a part (ipt) file, the iProperties "material" is set to "Default"

 

How can I change the material to say...."GOLD" (Example Only!!!) using a AutoDesk Inventor VBA macro?

 

Many thanks in advance!!!!

 

Darren

1 REPLY 1
Message 2 of 2
Yijiang.Cai
in reply to: isocam

Hi Darren,

 

Please see the code lines below -

Sub test()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument

oPartDoc.ComponentDefinition.Material = oPartDoc.Materials("Gold")

oPartDoc.Update2
End Sub

 

Hope it helpful for you!

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com

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

Post to forums  

Autodesk Design & Make Report