ilogic rule not running after parameter change as told

ilogic rule not running after parameter change as told

jletcher
Advisor Advisor
1,435 Views
15 Replies
Message 1 of 16

ilogic rule not running after parameter change as told

jletcher
Advisor
Advisor

Can we get a patch to fix this.

 

When I change a parameter the rule is to run to update information. But never does.

 

I made a video so it is easier for you then to read my garbage.

 

 

1,436 Views
15 Replies
Replies (15)
Message 2 of 16

AlexFielder
Advisor
Advisor

Can you share the part file? I'll test it here.

0 Likes
Message 3 of 16

jletcher
Advisor
Advisor

Here you are.

0 Likes
Message 4 of 16

AlexFielder
Advisor
Advisor

I don't think a patch is necessary, just add this at the top of the rule:

 

ThisDoc.document.update()

the problem you had is that the custom iProperties were being driven by the sheet metal extents, which weren't changing without updating the entire document first.

Here's my updated rule:

ThisDoc.Document.Update()
extents_length = SheetMetal.FlatExtentsLength
extents_width = SheetMetal.FlatExtentsWidth
extents_area = SheetMetal.FlatExtentsArea

Parameter("SQ_FT") = Round(SheetMetal.FlatExtentsArea, 3) / 144


iProperties.Value("Custom", "MAT. DESC.") = SheetMetal.GetActiveStyle()

iLogicVb.UpdateWhenDone = True

Let me know if it works.

Mark this as the solution if it does.

 

Cheers,

 

Alex.

Message 5 of 16

Curtis_Waguespack
Consultant
Consultant

@AlexFielder

 

I think there is still a small related issue here, but it has to do with the form updating when the parameter value is updated from the sketch dim..


try this with the attached 2017 file:

  1. Edit the visible Length sketch dim and notice iproperty stays one update behind in the form
  2. Edit the iproperties and notice that the value is correct there
  3. return to the form and click in an input box and notice the iproperty updates

Do you see this behavior as well?

 

One fix/workaround is to add lines to the rule that push the values to the iproperties. So basically change this:

 

 

ThisDoc.Document.Update()

extents_length = SheetMetal.FlatExtentsLength 
extents_width = SheetMetal.FlatExtentsWidth  
extents_area = SheetMetal.FlatExtentsArea  

iLogicVb.UpdateWhenDone = True

to this:

 

ThisDoc.Document.Update()

extents_length = SheetMetal.FlatExtentsLength 
iProperties.Value("Custom", "extents_length") = SheetMetal.FlatExtentsLength 
extents_width = SheetMetal.FlatExtentsWidth  
iProperties.Value("Custom", "extents_width") = SheetMetal.FlatExtentsWidth 
extents_area = SheetMetal.FlatExtentsArea  
iProperties.Value("Custom", "extents_area") = SheetMetal.FlatExtentsArea 

iLogicVb.UpdateWhenDone = True

 

...but it doesn't seem like that should be required to keep the form updated

 

 

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

EESignature

0 Likes
Message 6 of 16

AlexFielder
Advisor
Advisor

@Curtis_Waguespack I do indeed see the same behaviour when running that file inside Inventor 2019 and I agree that overwriting the exported parameters is unnecessary. It's almost like manually updating the dimension isn't causing the correct event to fire.

 

I'll have a look tomorrow with Inventor 2019 running alongside the eventviewer application and see if it is indeed firing correctly.

I'll see if I can compare the results with Inventor 2017/2018 too (unless you have time to do this now?).

 

Message 7 of 16

jletcher
Advisor
Advisor

By doing the new, you suggest doing the export option through ilogic not the check box under Parameters?

 

I tried this way before and had many issues.

 

The client wants fractions and rounded off, when I tried doing the convert to fraction and round to a 32nd in ilogic I had nothing but issues.

 

 I believe I have a thread about it a few months ago. I don't have the time to search for it but I remember we could not get it to work so I went back to this.

 

As for

ThisDoc.Document.Update()

I must have missed it when copying over to 2019 template because it was in old template but still have issues with ilogic running on parameter changes, it all depends on what I change. I just keep forgetting to look and log when and what parameters.

 

Thanks for the replies.

0 Likes
Message 8 of 16

Curtis_Waguespack
Consultant
Consultant

 


@jletcher wrote:

By doing the new, you suggest doing the export option through ilogic not the check box under Parameters?

 

I tried this way before and had many issues.

 

The client wants fractions and rounded off, when I tried doing the convert to fraction and round to a 32nd in ilogic I had nothing but issues.

 


 

Hi @jletcher,

I wasn't really suggesting anything, rather I was just pointing out that if the user modifies the parameter via the sketch dim, that the iproperty in the form does not update. However, the iproperty is actually updated in the file via the export as a custom iproperty checkbox functionality.

 

Using the code to push the value to the iProperty keeps the form in sync,

 

In any case, using the code or the export check box, should both work to get the results you're after. The only issue I've seen with it is when we have the custom iproperty being formatted one way in the export/format options, and another way in the ilogic rule.

 

If you have issues with getting iProperties to round correctly, start a new thread and provide details, and I'm sure someone can help.

 

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

 

 

EESignature

0 Likes
Message 9 of 16

jletcher
Advisor
Advisor

Only have the issues with sheet metal extents and a thread was made with no luck in resolving.

 

But also not needed but do need this to update correct.

 

This issue is known and checked for failure just would like it to be looked at.

 

 

0 Likes
Message 10 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@jletcher,

 

Try below iLogic code to update extents_length parameter.

 

extents_length = SheetMetal.FlatExtentsLength
extents_width = SheetMetal.FlatExtentsWidth
extents_area = SheetMetal.FlatExtentsArea
 
extents_length = d0 

Parameter("SQ_FT") = Round(SheetMetal.FlatExtentsArea, 3) / 144

iProperties.Value("Custom", "MAT. DESC.") = SheetMetal.GetActiveStyle() 
 
iLogicVb.UpdateWhenDone = True 

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 11 of 16

jletcher
Advisor
Advisor

All that does is keep my

extents_length

=0

0 Likes
Message 12 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@jletcher,

 

On changing dimension value, effected value would be 'd0' parameter.

 

Is it working now?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 13 of 16

jletcher
Advisor
Advisor

How can it work you did not tell me to change anything.

 

Your code sends back 0

0 Likes
Message 14 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@jletcher,

 

 

To demonstrate changes in custom iProperty of sheet metal, a screencast video is recorded and uploaded to below link.

 

https://autode.sk/2moKzTD

 

Please feel free to contact if there is any queries.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 15 of 16

jletcher
Advisor
Advisor

LOL now I see where you went wrong.

 

  You have to do this in the template file where there is no "d0" parameter.

 

I gave you my sheet metal setup test file there would be no model, I gave you it with a model to see it does not update.

 

 

Sorry this method is not logical to do.

 

 

 

 

 

 

 

 

 

 

0 Likes
Message 16 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@jletcher,

 

Try below iLogic code to update length of extents.

 

InventorVb.DocumentUpdate()
extents_length = SheetMetal.FlatExtentsLength
extents_width = SheetMetal.FlatExtentsWidth
extents_area = SheetMetal.FlatExtentsArea
 

Parameter("SQ_FT") = Round(SheetMetal.FlatExtentsArea, 3) / 144


iProperties.Value("Custom", "MAT. DESC.") = SheetMetal.GetActiveStyle()

iLogicVb.UpdateWhenDone = True

Please feel free to contact if there is any queries.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes