Include Workplanes in idw,

Include Workplanes in idw,

Alexrose1942
Advocate Advocate
291 Views
2 Replies
Message 1 of 3

Include Workplanes in idw,

Alexrose1942
Advocate
Advocate

Hello

when creating an assembly i create Custom work planes that represent the "Ground" or other theoretical levels. i normally show them using the "include" feature on the idw, I manually search my workplane name on the browser.

 

I'm trying to automate it in a way that ilogic searches for any specific string like the word "Ground" and will automatically include it on any view possible. I understand some views cannot include them. the program should skip to the next view. is this feature accessible through ilogic?

 

Thanks

Inventor_2024-07-28_13-33-57.png

0 Likes
Accepted solutions (1)
292 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @Alexrose1942 . Please try this code. You need to write down your keywords in line 3 (example: {"Ground", "abc", "qwert"}).

Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, DrawingDocument)
If oDDoc Is Nothing Then Exit Sub
Dim sList() As String = {"Ground"}
For Each oSheet As Sheet In oDDoc.Sheets
	For Each oView As DrawingView In oSheet.DrawingViews 
		Dim oRefDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument
		For Each oPlane As WorkPlane In oRefDoc.ComponentDefinition.WorkPlanes
			For i As Integer = 0 To sList.Length - 1
				If Not oPlane.Name.Contains(sList(i)) Then Continue For
				Try : oView.SetIncludeStatus(oPlane, True) : Catch : End Try
			Next i
		Next
	Next
Next

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 3

Alexrose1942
Advocate
Advocate

@Andrii_Humeniukimpressive! Thank you so much!!!

0 Likes