2 Replies Latest reply on May 1, 2014 4:07 AM by roberto gennari

    IModeler CopyWizardHole Method

    roberto gennari


      has anyone had experience with:


      IModeler CopyWizardHole Method


      Dim instance As IModeler

      Dim SourceHole As System.Object

      Dim DestinationHole As System.Object

      Dim RebuildOwner As System.Boolean

      Dim value As System.Integer


      value = instance.CopyWizardHole(SourceHole, DestinationHole, RebuildOwner)


      what is it called this Api?


      Thanks to all



        • Re: IModeler CopyWizardHole Method
          Artem Taturevych

          Hello Roberto,


          This method copies all properties (except of location points) from one hole wizard feature to another one and also renames the destination feature according to new profile. Here is an example which copies all attributes from first selected hole wizard feature to second selected hole wizard feature. I'm not sure why this method appears under the IModeler interface IFeatureManager is more appropriate I think, but anyways.


          Dim swApp As SldWorks.SldWorks

          Dim swModel As SldWorks.ModelDoc2

          Dim swSelMgr As SldWorks.SelectionMgr

          Dim swModeler As SldWorks.Modeler


          Sub main()


              Set swApp = Application.SldWorks


              Set swModel = swApp.ActiveDoc


              Set swSelMgr = swModel.SelectionManager


              Set swModeler = swApp.GetModeler


              Dim swSourceHole As SldWorks.Feature

              Dim swDestHole As SldWorks.Feature


              Set swSourceHole = swSelMgr.GetSelectedObject6(1, -1)

              Set swDestHole = swSelMgr.GetSelectedObject6(2, -1)


              swModeler.CopyWizardHole swSourceHole, swDestHole, True


          End Sub



          Regards, Artem Taturevych | Snr. Developer | IC3D ANZ


          IC3DSteel – New Steel Solution for SolidWorks

          translationXpert – SolidWorks files language translator

          LinkedIn - SolidWorks API Group