Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Exapnding the "Source" property 1

Status
Not open for further replies.

Csaba Solyom

Mechanical
Sep 22, 2016
14
Hello,

I would like to know if there is any way to expand the drop-down list in the "Source" property field. Per default it only has Made and Bought, which are already helpful, but I'd like to add a couple more for sorting purposes.

Thanks,
 
Replies continue below

Recommended for you

@Csaba Solyom
No. You would have to use "Define other properties..." to create your own. Then click on the f(x) icon at the bottom of your CATIA screen to change your own parameter from single value to multiple values. Then go back to the properties and right-click in the parameter input field and select "Add Multiple Values...". If you need step by step instructions let me know and I can post more screen grabs.

9-29-2016_2-30-41_PM_smt7ai.jpg


Drew Mumaw
 
Thanks, I'll try this when I get back to the office, and see if I can record a macro for it.
 
Csaba,
I have a similar macro that adds a drop down property to my catpart.
something like this should work for you:

Language="VBSCRIPT"
Sub CATMain()
Set partDocument1 = CATIA.ActiveDocument
Set product1 = partDocument1.GetItem("Part1")

Set parameters1 = product1.UserRefProperties
Set strParam1 = parameters1.CreateString("Source2", "")
Dim arrayOfVariantOfBSTR1(2)
arrayOfVariantOfBSTR1(0) = "A"
arrayOfVariantOfBSTR1(1) = "B"
arrayOfVariantOfBSTR1(2) = "C"
strParam1.SetEnumerateValues arrayOfVariantOfBSTR1

Set product1 = product1.ReferenceProduct

End Sub

Change "Source2" to whatever you want your property to be named.
Change "A" "B" "C" to your drop down choices.
Add additional choices if needed (modify (#) if choices are added or removed).
 
@rickyt

Thank you, that is the exact macro I was looking for, works perfectly.

Edit: is there any way to mark this thread as SOLVED?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor