EDITING HELIX by SOLIDWORKS MACRO

Discussion in 'SolidWorks' started by hard stuff, Feb 20, 2008.

  1. hard stuff

    hard stuff Guest

    hi folks,

    i wanted to make threads on a pipe..

    i created a helix and then a profile, which i cut sweeped..

    now, what i want to do is make macro so as to change helix features
    (pitch and height) .. can u help me by guiding me what function etc is
    to be used?

    thanks in advance

    --Pranav
     
    hard stuff, Feb 20, 2008
    #1
  2. hard stuff

    CS Guest

    First record a macro while it is recording simply select your helix
    feature. This will give you a call in the macro for selecting the
    helix.

    Dim swApp as sldworks.sldworks
    Dim part as sldworks.modeldoc2
    dim SelMan as sldworks.selectionmanager

    Sub Main ()

    set swapp = new application.sldworks
    Set part = swapp.activedoc
    Set SelMan = part.selectionmanager

    Dim HelixFeat as feature
    set HelixFeat = SelMan.Getselectedobject6(1,-1)
    Dim hFeatData as HelixFeatureData

    Set hFeatureData = HelixFeat.GetDefinition

    hFeatureData.Height = .1 'Value passed in meters

    end sub


    Ofcourse you will have to do appropriate error checking and such.

    Regards,

    Corey Scheich

    end sub
     
    CS, Feb 26, 2008
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.