Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Name 1

Status
Not open for further replies.

THEEOX

Bioengineer
Apr 27, 2007
19
Hi all.
Is there anyway to find the variable names for SW features?

Im looking for the Variable Name for the 'Part Number Column' in the Configuration Toolbox?

Thanks again.

what a day.....


Thee Ox...thanks you.....and has left the building.
 
Replies continue below

Recommended for you

Are you looking to specify this in a design table or manipulate it through the API?

Eric
 
Both really....

Thee Ox...thanks you.....and has left the building.
 
The easiest way to get it in a design table is to create two configurations with different values and then create the design table and let it auto generate the columns. Once you have done that you can open up the design table and find the column name.

One way to find out how to do it with the API is to manually do it while recording a macro and look at the code that is generated. Basically two things need to be done to the configuration: the part number source needs to be set to the alternative name, and the alternative name needs to be set. The following subroutines do this for the current configuration.

Code:
Sub setBoMPartNumberSource(document As SldWorks.ModelDoc2)
    Dim cfg As SldWorks.Configuration
    Set cfg = document.ConfigurationManager.ActiveConfiguration
    cfg.BOMPartNoSource = swBOMPartNumber_UserSpecified
End Sub

Code:
Sub setAlternativeName(document As SldWorks.ModelDoc2, alternativeName As String)
    Dim cfg As SldWorks.Configuration
    Set cfg = document.ConfigurationManager.ActiveConfiguration
    
    cfg.AlternateName = alternativeName
End Sub

I have had some problems with the part number source not always taking, but have not bothered to track it down. This should get you started though.

Eric
 
Thanks to all for yer help!!

Yer Pal,
Thee......

Thee Ox...thanks you.....and has left the building.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor