PartsList doesn't change as the rule.

PartsList doesn't change as the rule.

Anonymous
Not applicable
1,174 Views
10 Replies
Message 1 of 11

PartsList doesn't change as the rule.

Anonymous
Not applicable

Hi, everybody.

 

I'm facing the following problem:

 

My Part has some custom iProperties. Two of them are "=<Sheet Metal Length>" and "=<Sheet Metal Width>"

Also I have a rule that contains this SyntaxEditor Code Snippet:

 

iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Length>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Width>"

If iProperties.Value("Custom", "Comp.(mm)") >= iProperties.Value("Custom", "Larg.(mm)") Then
iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Length>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Width>"
Else
iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Width>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Length>"
End If

Finally I have a PartsList with those values "Comp.(mm)" and "Larg.(mm)" in which I "always" want the bigger value in the column "Comp.(mm)" and the smaller value in the column "Larg.(mm)".

Well, when I run the rule it proceeds fine in the custom iProperties, but it doesn't proceeds in the PartsList columns, I mean, the values don't match.

The PartsList is keeping only the first part of the rule: 

iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Length>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Width>"

And ignores the second part of the rule: 

If iProperties.Value("Custom", "Comp.(mm)") >= iProperties.Value("Custom", "Larg.(mm)") Then
iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Length>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Width>"
Else
iProperties.Value("Custom", "Comp.(mm)") = "=<Sheet Metal Width>"
iProperties.Value("Custom", "Larg.(mm)") = "=<Sheet Metal Length>"
End If

 ¿¿¿Would I have some snipet to make the rule run completely in the PartsList too???

0 Likes
Accepted solutions (1)
1,175 Views
10 Replies
Replies (10)
Message 2 of 11

solson
Advocate
Advocate

I was able to get your code to run consistantly, with the desired results.  A couple things to try/check:

 

  • Check to see the format of the Custom iProperties (Number vs. Text)
  • You may want to add a line to update the document, either the Update or Update when done snippet
  • You may want to set an Event Trigger for the rule to run when an iProperty is changed.  I had an issue where I had to manually run the rule to get the results.  By setting the rule to run when an iProperty changes should be suffecient to trigger the rule when the values change.

Steve Olson
Manager, Training Services
https://knowledge.autodesk.com/profile/O37DF451BDD2485B
https://www.youtube.com/channel/UCgQTCawsuRFJVSHRXIwLdtg
0 Likes
Message 3 of 11

Anonymous
Not applicable

 

  • Check to see the format of the Custom iProperties (Number vs. Text)  fx =<Sheet Metal Length>    fx =<Sheet Metal Width> and so on.
  • You may want to add a line to update the document, either the Update or Update when done snippet I've Update it and it doesn't work out anymore
  • You may want to set an Event Trigger for the rule to run when an iProperty is changed.  I had an issue where I had to manually run the rule to get the results.  By setting the rule to run when an iProperty changes should be suffecient to trigger the rule when the values change. The problem is not in the iProperties while it is in the iPart file (ipt), but when I place the iPart on the Assembly and change the Part Number at the table of the iPart; its iProperties don't enterely change, they keep "some" iProperties from the former Part Number or Member.
  • Should I put some kind of custom iProperties that I don't know that might force the changes when I place the iPart on the Assembly?
0 Likes
Message 4 of 11

Anonymous
Not applicable
  • Excuse me, please. I made a mistake before
  • The fx =<Sheet Metal Length>  and  fx =<Sheet Metal Width> are working out alright. The issues are those ones below:
  • Check to see the format of the Custom iProperties (Number vs. Text)  Except  fx =<Sheet Metal Length>  and  fx =<Sheet Metal Width> when I make some formula in the rule that contains other custom iProperties, the rule works out only in the ipt file, but it doesn't work out on the iam file.
  • You may want to add a line to update the document, either the Update or Update when done snippet I've Update it and it doesn't work out anymore
  • You may want to set an Event Trigger for the rule to run when an iProperty is changed.  I had an issue where I had to manually run the rule to get the results.  By setting the rule to run when an iProperty changes should be suffecient to trigger the rule when the values change. The problem is not in the iProperties while it is in the iPart file (ipt), but when I place the iPart on the Assembly and change the Part Number at the table of the iPart; its iProperties don't enterely change, they keep "some" iProperties from the former Part Number or Member.
  • Should I put some kind of custom iProperties that I don't know that might force the changes when I place the iPart on the Assembly?
0 Likes
Message 5 of 11

solson
Advocate
Advocate

I am not sure what you mean when you say that it does not work on the assembly.

 

I saw, and responded to one of your other posts, about BOM values not updating when an iPart Member is changed.  If this is an iPart, you will need to add these Custom iProperty values to the iPart Table.  If you do not do this, the Custom iProperties will get there values from the Active Row of the iPart file.  By adding it to the table, you are identifing that each row will need its own value for those Custom iProperites.

 


Steve Olson
Manager, Training Services
https://knowledge.autodesk.com/profile/O37DF451BDD2485B
https://www.youtube.com/channel/UCgQTCawsuRFJVSHRXIwLdtg
0 Likes
Message 6 of 11

Anonymous
Not applicable
Accepted solution

My friend, you can't imagine how much you've helped me by this answer.

We've 'killed two birds with one stone'.

I really had two issues:

  • Updating the iProperties on the Assembly when changing the iPart Member and;
  • Get an expression that could recognized those iProperties making the rule work out.

Well, I simply did not considered that, by the fact I didn't fill the iPart table with the Custom iProperties, (since I had made, on the rule, some expressions by creating those iProperties and setting formulas with them), obviously (not so to me) the member exchange would not be able to recognize an iProperty or a Parameter that does not exist in the Table, though they were created in my rule.

When I filled the Table with the Custom iProperties the Assembly worked out. My task now is filling every file that contains an iPart Table with those iProperties; so I hope everything's gonna be alright.

Great help!

I thank God for this too.

0 Likes
Message 7 of 11

solson
Advocate
Advocate

If you activate a member and run the rule, it should correct the active member.  So if you repeat the process for each member, it should minimize the difficultly of trying to fill out the table manually.

 

 


Steve Olson
Manager, Training Services
https://knowledge.autodesk.com/profile/O37DF451BDD2485B
https://www.youtube.com/channel/UCgQTCawsuRFJVSHRXIwLdtg
0 Likes
Message 8 of 11

Anonymous
Not applicable

What would be better to activate a member without filling out the table? iPart.ChangeRow??

Should I fill out manually some mult-value list on a user parameter to make possible this member activation?

0 Likes
Message 9 of 11

solson
Advocate
Advocate

What I mean by activate is that you go into the iPart (parent part), expand the Table node of the tree and double click on a member of the table.  That will "Activate" that member.  If you run the rule while the member is active, it should update the Custom Properties for that Row of the table.  It is verly likely that you will see a message about the row values not matching and asking to change them.  Then just activate the next member and run the rule.  This should work without issue.

 

If you feel that this resolves the issue, please mark the post that solved the issue.

 

Here is a Screencast that shows the workflow.

 

Steve Olson
Manager, Training Services
https://knowledge.autodesk.com/profile/O37DF451BDD2485B
https://www.youtube.com/channel/UCgQTCawsuRFJVSHRXIwLdtg
0 Likes
Message 10 of 11

Anonymous
Not applicable

Ok! I comprehend this works out, but I must have those data on the Table, if not when I place the iPart on the assembly and change the member its iProperty won't change because it won't recognize the rule of the iPart on the iam file (I've created a rule that changes those data that are not on the table)

0 Likes
Message 11 of 11

adam.nagy
Autodesk Support
Autodesk Support

I wrote a blog post which I hope clarifies some things concerning iParts: http://adndevblog.typepad.com/manufacturing/2016/01/customize-iassembly-ipart-member-creation.html 



Adam Nagy
Autodesk Platform Services
0 Likes