Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm running into some issues trying the set the value on a custom iProperty within components of an assembly. I have a separate set of code that opens each component within the assembly. The code below is then ran within each component. It works within the model you run it within. But for the sub-components it adds the custom iProperty but does not give it a value. Even if I type the value directly into line 13 it still does not get applied to the lower level components.
Dim oDoc As Document = ThisApplication.ActiveDocument InputVar = SharedVariable("Inputs") Dim propertyName As String = "PL_Code" oCustomPropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties") Try oProp = oCustomPropertySet.Item(propertyName) Catch ' Assume error means not found so create it oCustomPropertySet.Add("", propertyName) End Try Dim oPropSet As [Property] = oCustomPropertySet.Item(propertyName) If oPropSet.Value() = "" Then Call PropPL_Code(oPropSet, InputVar)
Private Sub PropPL_Code(oPropSet, InputVar) If InputVar = False Or Poduct_Code = "" Then iLogicVb.RunExternalRule("ProductLine Pick List Copy") Poduct_Code = SharedVariable("Product_Code") If String.IsNullOrEmpty(Poduct_Code) Then MsgBox("PL_CODE not found. Exiting.", vbCritical, "") Exit Sub End If End If oPropSet.Value() = Poduct_Code End Sub
Solved! Go to Solution.