Eng-Tips is the largest forum for Engineering Professionals on the Internet.

Members share and learn making Eng-Tips Forums the best source of engineering information on the Internet!

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

Configuration Properties

Status
Not open for further replies.

dogarila

Mechanical
Joined
Oct 28, 2001
Messages
594
Location
CA
I would like to write a macro to set the part number displayed in BOM to Configuration name, in configuration properties. I have a feeling that it has something to do with ConfigurationManager::SetConfigurationParams.

I can get and list the Configuration parameters. If the above property is set to a user specified name I can change the value of $PARTNUMBER to "$C" then set the parameters and I get what I want.

But if the property is set to document name I have no $PARTNUMBER to change or assign a value.

Any suggestion in how to handle this question?



 
Here is one :
Assuming that the variable "MD2" is set to your active part or assembly,
Code:
Dim p(0 To 0) As String, V(0 To 0) As String
p(0) = "$PARTNUMBER"
V(0) = "$C"
'Edit default configuration
With Md2
 
  .EditConfiguration3 "Default", "Default", "", "", _ 
     False Or False Or False
 
  .AddOrEditConfiguration "Default", p, V
End With
you can replace "Default" by any existing configuration name, build a loop to update all existing configurations, ....
In this case ".EditConfiguration3" is used to set the options like "Use Alternate Name" and so on. See API help file for more details.
Hope this helps.

Jacques Balzer
 
Hooooops !!!
I did'not read you question up to the end :).

If the property is set to document name you cannot change that value : it is going to be what it just says, the document name.
Sorry for the previous post.
 
Thank you for your support.

The way I did it is:

Code:
Config.AlternateName = " "
Config.UseAlternateNameInBOM = True

So far it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top