Hello all,
I am new in API and only able to record some simple macros. I want to assign same material and configuration spec. for all parts in part properties using macro. Can anyone help me to create a macro to assign configuration specific and material as shown below:
Is it possible to make changes in complete folder with single run of macro?
Thanks in advance
Manjeet Ranjan

Here is one for material Change_Part_Material which can be changed to set config properties also.
Hi Deepak,
Thank you for your effort.
I tried this MACRO but it did not work. Which path should be given here in programm
"Path = "D:\SW\" ' Set you path here. If required browse function can be added"
And also I want to assign the default material only so that I can get weight directly in File ->Properties ->Configuration specific using formula. All these properties should be assigned to the part only.
Procedure for what I want macro:
Select a part (OR folder containing number of parts) then assign default material (Say plain carbon steel). Go to file -properties-summery information-configuration specific. Choose material in property name , text in type, Material in value from drop down menu. Do the same for Weight also. Please refer earlier attached images for more clarification.
-Thanx.
Replace "D:\SW\" with the folder location where parts are placed. It has to changed every time you need to work on parts on different folder location. I'll add up browse location function. Make sure your path in within quotes and \ at the end of folder name (similar to the path I have in the macro)
Currently the macro will add copper as material, then add two config specific properties viz. Material and Weight but only to configuration named "Default".
If you need the macro can be edited to add config properties to active configuration.
Test the macro once again and after that I can incorporate the changes.
Hello Deepak,
Its working fine now. I am Waiting for add config. macro. I more help what is the simple way to do the programming for macros.
Thanx again.
The macro I stated above will add configuration specific properties provided there is Default (configuration name) configuration.
If you need more than this let me know like, browse function to select the folder/file location rather than editing the macro. Then this macro works for Default (configuration name) configuration at the moment. It can be edited to active configuration as required.
To learn API, first you need to learn VBA, .NET or C language. Then there are some good books available to master further.
Try the attached one
Its Awsome !
Hello Deepak,
I have no. of parts in one assembly folder which is having different materials. I have made an excel sheet consisting of file name and their respective materials. Is it possible to connect the excel sheet to this MACRO for selecting materials?
In macro you have made two programms one for browsing and another for config. and I am not able to edit browser programm.
A list can be inbuilt in macro to select material from or can be linked to an external file say text. And don't edit the codes for browse function as then it'll not work.