This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Part Class Structure Relationship to Part Characteristics

jsnosal - Friday, June 29, 2012 3:10 PM:

I’m trying to create a relationship to the part class structure and part characteristics. When I select a Component>Resistor, I want to see Resistance, Power and Variable Resistance characteristics all show up under the characteristics tab automatically. Instead of having to open up the characteristics tab.
Do I need to be focusing on grid events, methods or relationships?
I eventually want to make these characteristics required for each part that is created. This is to make sure that no engineer forgets to add a specific characteristic to a resistor.
Thank you for your help


Brian - Monday, July 2, 2012 1:24 AM:

Hi Jsonal,

The Part Family (under Design on the TOC) is an Item type that begins to do what you want. Lookup Just Ask Innovator help under Quality Planning and read the Part Family information.

It isn't exactly what you want since your parts have to already exist to add them to a Part Family. However, it shouldn't be too difficult to add an "onAfterAdd" method to Part to create a relationship to a Part Family from the part save. You probably need to work on matching Part and Part Family classifications or have the user select a Part Family when creating the part.

Hope this helps,

Brian.



jsnosal - Monday, July 2, 2012 2:51 PM:

Brian,
 Thank you for your help. I’m new to writing code and I’m reading through the programmers guide right now. Below is what I currently have. I’m sure I will be changing around by the end of the day. I have a better understanding of the AML layout then I do of C#. Do you have any suggestions or see any major issues with my current code? I have added the method to the Item Type>Part>Server Method>OnAfterAdd.
Thank you for your help
Josh
 
Innovator inn = this.getInnovator();
Item item = this.newItem("Part", "get");
Item results = item.apply();
string thisType = this.getType();
string thisName = this.getProperty("classification","component/resistors");
 
string aml = String.Format(CultureInfo.InvariantCulture,
"<AML>" +
"<item type='part' action='edit' where='[part].classification='component/resistors''>" +
     "<relationships>" +
           "<item type='part characteristic' action='add'>" +
                "<related_id type='characteristic'>" +
                     "<item type='characteristic' action='get'>" +
                          "<keyed_name>resistance</keyed_name>" +
                     "</item>" +
                "</related_id>" +
           "</item>" +
      "</relationships>" +
      "<relationships>" +
           "<item type='part characteristic' action='add'>" +
                "<related_id type='characteristic'>" +
                     "<item type='characteristic' action='get'>" +
                           "<keyed_name>variable res</keyed_name>" +
                   "</item>" +
                "</related_id>" +
           "</item>" +
     "</relationships>" +
     "<relationships>" +
         "<item type='part characteristic' action='add'>" +
                "<related_id type='characteristic'>" +
                           "<Item type='characteristic' action='get'>" +
                                "<keyed_name>tolerance</keyed_name>" +
                           "</item>" +
                "</related_id>" +
           "</item>" +
     "</relationships>" +
     "<relationships>" +
           "<Item type='part characteristic' action='add'>" +
                "<related_id type='characteristic'>" +
                     "<item type='characteristic' action='get'>" +
                           "<keyed_name>Power (Watts)</keyed_name>" +
                     "</item>" +
                "</related_id>" +
           "</item>" +
      "</relationships>" +
"</item>" +
"</AML>",
this.getAttribute("id"));
 
return this.apply();



Brian - Wednesday, July 4, 2012 7:14 AM:

Hi josh,

The 2nd and 3rd lines in your code aren't actually doing anything useful.

You are telling Innovator to retrieve "Part" items but not telling it what ID or other criteria. So it will return everything. Then you don't use the results anywhere. This may just be the code snippet.

The code looks more or less correct.

I have to ask if you actually want to be using Characteristics for this.

What you seem to be doing is "classification specific properties" for the Part item.

If you add properties to the Part item and then in the "classification" column for the property you select the "component/resistors" classification you can selectively add these properties to forms or have them display as "parameters" in a tab for the item.

This requires no code and is easier to maintain.

The characteristics are typically used for inspection/measurement type items used in Process Planners and FEMA.

Cheers,

Brian.



jsnosal - Monday, July 9, 2012 10:32 AM:

Brian,
Thank you for your help.
I tried in the past to have the classification add different fields to the form. The instructions for this are a little out dated in the ARAS help manual. I'm not able to find the property to tie it to the form. I'm looking in unused properties, but I'm not seeing the selection for the resistor field that I created in the Item Type>Part.
The help section that I'm looking at is called Classification Specific Properties.
Resource with key="'class_spec_field.Part_Resistors'" is not found
Is this where I should be looking or are you talking about another option?
Thanks for your help