×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Variable Name

Variable Name

Variable Name

(OP)
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.

RE: Variable Name

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

Eric

RE: Variable Name

(OP)
Both really....

Thee Ox...thanks you.....and has left the building.

RE: Variable Name

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

RE: Variable Name

(OP)
Thanks to all for yer help!!

Yer Pal,
Thee......

Thee Ox...thanks you.....and has left the building.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources