@sreed,
Try below changes in both iLogic code.
Get Reference assembly
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
oSheet = ActiveSheet.Sheet
oViews = oSheet.DrawingViews
If oViews.Count > 0 Then
oView = oViews.Item(1)
oModelName = oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
Dim referDoc As Document
referDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
oAssemblyState = referDoc.PropertySets.Item("Design Tracking Properties").Item("Design Status").Value
If oAssemblyState = 1 Then
oAssemblyState = "WorkInProgress"
Else If oAssemblyState = 2 Then
oAssemblyState = "Pending"
Else If oAssemblyState = 3 Then
oAssemblyState = "Released"
End If
'MessageBox.Show(oAssemblyState, "Assembly State")
Parameter("ModelDesignState") = oAssemblyState
End If
Push Design State
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oViews As DrawingViews
Dim oView As DrawingView
oSheet = ActiveSheet.Sheet
oViews = oSheet.DrawingViews
If oViews.Count > 0 Then
oView = oViews.Item(1)
oModelName = oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
Dim referDoc As Document
referDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
'MessageBox.Show(oModelName, "Assembly Name")
oNewState = Parameter.Value("ModelDesignState")
'MessageBox.Show(oNewState, "Model Design State")
oAssemblyState = Parameter.Value("ModelDesignState")
If oAssemblyState = "WorkInProgress" Then
oAssemblyState = 1
Else If oAssemblyState = "Pending" Then
oAssemblyState = 2
Else If oAssemblyState = "Released" Then
oAssemblyState = 3
End If
referDoc.PropertySets.Item("Design Tracking Properties").Item("Design Status").Value = oAssemblyState
'iProperties.Value(oModelName, "Status", "Design State") = oAssemblyState
End If
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network