iLogic rule to match parameters

iLogic rule to match parameters

Anonymous
Not applicable
919 Views
6 Replies
Message 1 of 7

iLogic rule to match parameters

Anonymous
Not applicable

Hello,

 

I'm strugling with this what seems to appear a very simple case..

I have an iPart which is basicaly a box with its Width and Leangth defined in iPart tabe.

Than I inserted that iPart into iAssembly and made another table to do ipart table replace.

I want to write a simple iLogic rule that could grab active Width and Length parameters from ipart and store them as custom user parameters in assembly every time i change iasembly component.

I tried this rule, but it does not work. If first If turns out to be true it works, but if it returns false I get an error saying "Component: The component named "Glass-1476x3576:3" was not found."

 

 

 

If Component.IsActive("Glass-1476x3576:3") = True Then 
Parameter("Width") = Parameter("Glass-1476x3576.ipt", "Width")
Parameter("Length") = Parameter("Glass-1476x3576.ipt", "Length")
 ElseIf Component.IsActive("Glass-1191x3576:3") = True Then 
 Parameter("Width") = Parameter("Glass-1191x3576.ipt", "Width")
 Parameter("Length") = Parameter("Glass-1191x3576.ipt", "Length")
 ElseIf Component.iComponentIsActive("Glass-9761x3576:3") = True Then 
 Parameter("Width") = Parameter("Glass-1191x3576.ipt", "Width") 
 Parameter("Length") = Parameter("Glass-1191x3576.ipt", "Length")
End If

 

 

0 Likes
920 Views
6 Replies
Replies (6)
Message 2 of 7

t_hascj
Autodesk
Autodesk
0 Likes
Message 3 of 7

Thomas_Savage
Advisor
Advisor

Hello @Anonymous

 

Could you attach your files as well please?

 

So it helps gives a better understanding of you your are trying to achieve. 

 

Thanks,

 

Thomas.



Thomas Savage

Design Engineer


0 Likes
Message 4 of 7

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous,

 

I think the issue is that you are calling the file name, and not the occurrence name. But I think there is a better way to approach this.

 

I posted an example at this link yesterday:

https://forums.autodesk.com/t5/inventor-forum/sending-parameters-to-parts-with-ilogic/m-p/7736486#M679745

 

That example runs through the assembly occurrences and then looks through the user parameters and attempts to set any user parameter to be the same value as the assembly parameter of the same name.

 

Using this method you don't need to be concerned with the occurrence names.

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 5 of 7

Anonymous
Not applicable

All I'm trying to do here is to update parameters width and length with those ones from table when ipart instance canhges...

 Been trying answers above whole day today. no luck with any of those...

 

11.PNG22.PNG

 

0 Likes
Message 6 of 7

Curtis_Waguespack
Consultant
Consultant

Hi @Anonymous,

 

Ahh, I overlooked the iPart part of your question earlier.

 

So here's the thing: iparts and iassemblies work a bit different with iLogic.

 

When you use Table Replace in an iassembly to replace a component the replaced component is not in that assembly configuration any longer, and so the IsActive call does not work. IsActive in ilogic checks on visibility and/or suppression, whereas iAssemblies that use Table Replace are not suppressing or turning of the visibility of the replaced component, they are removing them from the assembly configuration. The result is that an IsActive call for will fail when checking for a replaced component.

 

Secondly, when we are working with ilogic and iParts I think the parameter column in the ipart must be set to be a custom parameter column in order to push a value to the ipart table. You'll have to confirm that for certain though. 

 

In any case the iLogic ChangeRow call is used when working with iparts, so you might search this forum and the Inventor Customization forum for "iPart.ChangeRow for examples.

I don't do much with iPart and iLogic because with my work I'm typically just using ilogic to supersede the iPart functionality, so I am able to avoid the mix of iPart and iLogic. I'm not saying that's what you need to do, just that I don't have a strong understanding of working with iLogic and iParts... much past what I've typed here.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

From the built in iLogic snippets here are the ChangeRow syntax examples:

 

iPart.ChangeRow("iComponentName:1", "RowMemberName")
iPart.ChangeRow("iParentFileName:1", "rowName")
iPart.ChangeRow("iComponentName:1", "RowMemberName", customParam1, customParam2)

EESignature

0 Likes
Message 7 of 7

Anonymous
Not applicable

I also found this function to push cell value to parameter:

 = iPart.CurrentRowValue("columnName")

But I could not get it to work as it requires some aditional functions to set curent row and I could not figure out how to make it select a row of active instance...

 

I found a work around tho using measure functions as this option worked for me

 

i = Measure.ExtentsLength
o = Measure.ExtentsHeight
Parameter("Width") = o-2
Parameter("Length") = i-2
0 Likes