Need an iLogic pause for rebuild during loop

Need an iLogic pause for rebuild during loop

llorden4
Collaborator Collaborator
2,391 Views
9 Replies
Message 1 of 10

Need an iLogic pause for rebuild during loop

llorden4
Collaborator
Collaborator

In an attempt to develop a work around for this identified bug in another post...

@johnsonshiue 

Since I know I can make desired angle changes on a polar axis in small increments (less than 90 degrees), I'm attempting to create an iLogic loop to step the incremental changes in hopes of achieving my goal of rotating parts & features more than 90 degrees without constraint failures.  Unfortunately this is still failing since I believe iLogic is running faster than the model refresh.  I can accomplish my goal if I manually manipulate the angle changes since the graphics have plenty of time to update between my keystrokes.

 

I've put in some update & rebuild commands into the loop, but they don't appear to help.  Any suggestions on how I might be able to slow down iLogic long enough for the updates to process?  Here's my current code...

'Angle manager
If SpanAngle/(FlatAngle*2) = Fix(SpanAngle/(FlatAngle*2)) Then IsHalfAngle = False Else IsHalfAngle = True
If SpanAngle < FlatAngle Then SpanAngle = FlatAngle                                        'ensure min angle is present
If SpanAngle/FlatAngle <> Fix(SpanAngle/FlatAngle) Then SpanAngle = FlatAngle * 3        'ensure angle has correct increment
FocusAngle = Round(((FlatFocus-1)*(FlatAngle/1 deg)+90)*10)/10*1 deg                    'convert flat # to angle value
If FocusAngle >= 360 deg Then FocusAngle = Round(((FocusAngle/1 deg) - 360)*10)/10*1 deg'keep value in range of 0-359 degrees
While CurAngle <> FocusAngle                                                            'begin stepped angle loop
    CurAngle = CurAngle + FlatAngle                                                        'increase by next angle increment
    Dim oTemp1 As Double = 0
    Dim oTemp2 as Double = 0
    If CurAngle >= 360 Then CurAngle = Round((CurAngle - 360)*10)/10                    'keep value in range of 0-359 degrees
    If CurAngle < 0 Then CurAngle = Round((CurAngle + 360)*10)/10
    If IsHalfAngle = False Then                                                            'if angle spread is equal
        oTemp1 = CurAngle + (SpanAngle/2)
        oTemp2 = CurAngle - (SpanAngle/2)
    Else If IsHalfAngle = True And AngleAdjDirection = "Left" Then
        oTemp1 = Round((CurAngle + (Ceil(SpanAngle/FlatAngle/2)*FlatAngle))*10)/10        'if not, adjust left (clockwise)
        oTemp2 = Round((CurAngle - (Floor(SpanAngle/FlatAngle/2)*FlatAngle))*10)/10
    Else 
        oTemp1 = Round((CurAngle + (Floor(SpanAngle/FlatAngle/2)*FlatAngle))*10)/10        'if not, adjust right (ccw)
        oTemp2 = Round((CurAngle - (Ceil(SpanAngle/FlatAngle/2)*FlatAngle))*10)/10
    End If
    If oTemp1 >= 360 Then oTemp1 = Round((oTemp1 - 360)*10)/10                            'keep value in range of 0-359 degrees
    If oTemp2 >= 360 Then oTemp2 = Round((oTemp2 - 360)*10)/10
    If oTemp1 < 0 Then oTemp1 = Round((oTemp1 + 360)*10)/10
    If oTemp2 < 0 Then oTemp2 = Round((oTemp2 + 360)*10)/10
    LeftAngle = oTemp1                                                                    'rotate/update planes
    RightAngle = oTemp2
    Parameter.UpdateAfterChange = True
    ThisDoc.Document.Rebuild()                                                            'force rebuild
End While

 

 

Autodesk Inventor Certified Professional
0 Likes
Accepted solutions (1)
2,392 Views
9 Replies
Replies (9)
Message 2 of 10

bradeneuropeArthur
Mentor
Mentor

system.threading.thread.sleep(Millisec), maybe an option?

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 10

llorden4
Collaborator
Collaborator

Nice idea, gave it a try and did see the delay but no success.  I appears that an update does not occur until iLogic has completed it's run so I may not be able to use this loop theory as a work around.  I have to figure out a way to loop the entire iLogic rule call to allow an update between calls.

Autodesk Inventor Certified Professional
0 Likes
Message 4 of 10

bradeneuropeArthur
Mentor
Mentor

maybe

Inventor.screenupdate = false

Inventor.silentoperation = true

???

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 10

llorden4
Collaborator
Collaborator

Converted that for iLogic to...

This.Application.ScreenUpdating=True

 

Another great idea without success.  I also found this web-link that looks like it might help, but too failed.

 

I guess I need the Autodesk team to get this bug fixed to have any success.

Autodesk Inventor Certified Professional
0 Likes
Message 6 of 10

Curtis_Waguespack
Consultant
Consultant

Hi @llorden4 

 

I had a quick look at your assembly in the other thread and I think you can simplify this a great deal by modeling the cone in the nut model as a surface to serve as "helper" geometry, then constraining that surface to the cone part in the assembly (you can then turn the surface cone off) ...

 

I've done something very similar in the past, and using the cone surface in the model to be positioned was a big leap forward as far as making the model easy to constrain and update predictably. You might even be able to create a multibody part with the cone and the nut in it and then create them both as separate models using the Make Components tool, and then drive position changes in the multi body model which will push the changed out.

 

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

 

 

 

EESignature

0 Likes
Message 7 of 10

llorden4
Collaborator
Collaborator

My answers don't lie with constraints to a "part", I am limited to designs about World features at my stage of development.  The Conical part feature actually doesn't exist yet.   I thought by showing this cone (which is actually faceted) would help communicate my polar issues when all it has done is focus everyone's answer on the cone feature.  Clearly I need to better communicate this need.  I've started another topic with the "Ask the Experts" event and am running into the same conical focus issue there but hopefully we can get past that part soon.

 

I need to constrain Planes to planes, not part faces to part faces as I am working variable parts and shapes; everyone is getting focused on a singular part & design.

Autodesk Inventor Certified Professional
0 Likes
Message 8 of 10

Curtis_Waguespack
Consultant
Consultant

Hi @llorden4 

 

I looked at your other thread and I think my advise for solving the overall goal is the same. Create this as a multibody part and drive that model and push the changes out. If the components to be constrained are to change, then what you would push out would be simple "helper" geometry to which your differing components would be constrained to. 

 

Again this is based on my past attempts to work with a bunch of planes to do much the same thing you are attempting to do... in my case the model simply was not stable or reliable enough to work with due to the work planes loosing their angle orientation, so I had to use the "skeletal" multibody approach.

 

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

 

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 10

llorden4
Collaborator
Collaborator

I spent some time going over your suggestions trying to make sure I fully understand them.

 

I know using "derived" features won't work for me to push data, my templates must be moved and renamed to project folders and this breaks the derived link between files and cannot be repaired/re-linked; it must be re-created.

 

I have "pushed down" data before from assemblies to parts using iLogic and I think you're suggestion works here "IF" one or both of my parts aren't changing.  In this instance, both the cone and the nut are representing "any" part OR assembly file.  If I can create a skeletal design structure, then I should be able to attach any part to any conical shape; be it round, 4 sided, 50 sided, etc.

 

The plan here being to attach assembly "A" at insert point "a,b,c" and constrained to planes 1, 2, 3 and then assembly "B" at "x,y,z" and constrain to planes 4, 5, 6 and boom, we have any object mated to any other object to a known orientation.

 

We agree on the skeletal model concept, perhaps you have an example you'd be willing to share.

Autodesk Inventor Certified Professional
0 Likes
Message 10 of 10

llorden4
Collaborator
Collaborator
Accepted solution

Solution to the original issue resolved and discussed here, again thanks to @johnsonshiue 

 

Closing thread.

Autodesk Inventor Certified Professional