Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
^_^clovis^_^
723 Views, 2 Replies

from vba to vb.net

Hello guys,

I've written this small function and I'd like to transpose it to vb.net.

'm planning to move all my functions to vb.net and want to use this one as a first howto.

A link to a howto would also be great! Where could I find some howto?

 

Thanks

 

 

Public Sub WP_Off()
'Visible Work Plan in parts OFF
    Dim invDoc As Document
    Set invDoc = ThisApplication.ActiveDocument
    
    If invDoc.DocumentType = kPartDocumentObject Then
 
        Dim pcd As PartComponentDefinition
        Set pcd = invDoc.ComponentDefinition
    
        Dim wpls As WorkPlanes
        Set wpls = pcd.WorkPlanes
        
        Dim owas As WorkAxes
        Set owas = pcd.WorkAxes
        
        Dim owpos As WorkPoints
        Set owpos = pcd.WorkPoints
        
        Dim owa As WorkAxis
        Dim owp As WorkPlane
        Dim owpo As WorkPoint
        
        For Each owp In wpls
            If owp.Visible = True Then
               owp.Visible = False
            End If
        Next
        For Each owa In owas
            If owa.Visible = True Then
               owa.Visible = False
            End If
        Next
        For Each owpo In owpos
            If owpo.Visible = True Then
               owpo.Visible = False
            End If
        Next
        
        
        Else: Exit Sub
    End If

End Sub