Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone
I'm looking for ways to know if a part that is inside an assembly exists in a drawing view using its name and if it does, highlight it. So far I've only found ways to get to the part from the view but not the other way around.
Does anyone know how to achieve this?
So far I can make sure the part exists in the assembly, but I need to highlight all the drawing curves that represent that part inside the view. My code looks like this:
Sub Main() Dim s As String = "A200"
Dim oView As DrawingView = oSheet.DrawingViews.Item(2) Dim oAssy As AssemblyDocument = oView.DrawingCurves.Item(1).Parent.ReferencedDocumentDescriptor.ReferencedDocument Dim oCDef As AssemblyComponentDefinition = oAssy.ComponentDefinition Dim oOcc As ComponentOccurrence For Each oOcc In oCDef.Occurrences If Left(oOcc.Name, oOcc.Name.Length - 2) = s Then 'Delete the ":1",":2",etc. Exit For 'Now I know it exists in the assembly End If Next oOcc End Sub
Solved! Go to Solution.