- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi this is probably a super obvious question but oh well. I just completed the my first Add in tutorial without issue. I'm now trying to build out an Add in to do something a little more complicated such as modifying a part parameter. The issue I'm having is that pretty much all the sample code seems to reference something called ThisApplication. When I try to run any sample code it says ThisApplication was not declared. I would take this to mean that I'm not declaring it somewhere but I'm not sure how to do this. Any help would be incredibly appreciated. Thanks
I'll attach the particular bit of code I'm currently having trouble running.
Public Sub SetParameter()
' Get the Parameters object. Assumes a part or assembly document is active.
Dim oParameters As Parameters
oParameters = ThisApplication.ActiveDocument.ComponentDefinition.Parameters
' Get the parameter named "Length".
Dim oLengthParam As Parameter
oLengthParam = oParameters.Item("Length")
' Change the equation of the parameter.
oLengthParam.Expression = "3.5 in"
' Update the document.
ThisApplication.ActiveDocument.Update
End Sub
Solved! Go to Solution.