Remove the visibility of component from inventor drawing particular sheet, and particular design view using ilogic

Remove the visibility of component from inventor drawing particular sheet, and particular design view using ilogic

ArunS2DHBM
Enthusiast Enthusiast
231 Views
1 Reply
Message 1 of 2

Remove the visibility of component from inventor drawing particular sheet, and particular design view using ilogic

ArunS2DHBM
Enthusiast
Enthusiast

I want to remove the component's visibility from the inventor drawing view (VIEW4) in Sheet 1  using logic. 

0 Likes
232 Views
1 Reply
Reply (1)
Message 2 of 2

vpeuvion
Advocate
Advocate
Sub Main()
	Dim oDoc As DrawingDocument = ThisDoc.Document
	Dim oActiveSheet As Sheet = oDoc.ActiveSheet
	Dim oDrawingView As DrawingView = oActiveSheet.DrawingViews(1)
	oSelectSet = oDoc.SelectSet
	
	For Each selObj In oSelectSet
		Try
			Dim obj As Object
			Dim oView As DrawingView
			If TypeOf(selObj) Is GenericObject Then
				Dim genObj As GenericObject = selObj
				oDoc.ProcessViewSelection(genObj, oView, obj)
				If Not obj Is Nothing Then
					occ = TryCast(obj, ComponentOccurrence)
					If Not occ Is Nothing Then
						Call oDrawingView.SetVisibility(occ, False)
					End If
				End If
			End If
		Catch
		End Try
	Next
End sub

 Hi,

Attached is an iLogic rule that may be able to help you out. It is inspired by a code by Thomas Rodney.

Just select the components and run the rule.

Maybe you can take inspiration from it.

Vincent.

0 Likes