ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
CCCharles Culp22/01/2007
I am creating a spring macro that uses the SW2006 feature ofvariable rate helix to create compression springs.  So far itworks great, it can create ground and closed springs, just closed,open springs, and I can get it to set all the custom properties soit just drops into a drawing template...

My problem is that I'm trying to get it to work for multipleworking heights, by having derived configurations for each of theheights.  All of our automated BOM's work by having the partnumber as the configuration name.  Thus, I want to create newderived configurations, and have these derived configurationshave the "Link to Parent" option for the Bill of Materialsettings.

The code I have now is:

Dim Part As Object
Dim SelMgr As Object
Dim partnum As Variant
Dim ConfigName As String

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager

partnum = "BaseConfigName"     ' notthe real code, but bear with me...
ConfigName = "DerivedConfigName"    ' notthe real code, but bear with me...
boolstatus = Part.Extension.SelectByID2(partnum,"CONFIGURATIONS", 0, 0, 0, False, 0, Nothing, 0)
ConfigMgr.AddConfiguration ConfigName, "", "",0, partnum, "no description"


The API help says to have the Options (the 0 in the above line) setto the information in swConfigurationOptions2_e, thus:
swConfigOption_LinkToParent = True

But how do I add that option above; or am I doing it correctly atall?