Reply

Find PMI by EdgebarName

[ Edited ]

Hi everybody,

 

I would like to hide PMI annotations and dimensions using their Edgebar name, but I can't managed to find something corresponding to the name displayed in the EdgeBar.

 

Is there anyone that can help me ?

 

Thanks Romuald.

      

        Dim RefName As String = "*"
        Dim Status As Boolean = True
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim OccDoc As SolidEdgePart.PartDocument = Nothing
        Dim OccDocFeatures As Object = Nothing
        Dim OccDocFeature As Object = Nothing

        Try
            objApplication = CType(Marshal.GetActiveObject("SolidEdge.Application"), SolidEdgeFramework.Application)
        Catch ex As Exception
            If Not (objApplication Is Nothing) Then
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If
            Return
        End Try

        Try
            OccDoc = objApplication.ActiveDocument
            OccDocFeatures = OccDoc.PMI.Balloons
            For Each OccDocFeature In OccDocFeatures
                If NameIsOk(RefName, OccDocFeature.EdgeBarName) Then
                    OccDocFeature.HidePMI = Status
                End If
            Next

        Catch ex As Exception
            If Not (objApplication Is Nothing) Then
                Marshal.ReleaseComObject(objApplication)
                objApplication = Nothing
            End If
            Return
        End Try

    End Sub

 

 


Romuald BERTIN