Force to Change a Parameter

Force to Change a Parameter

Anonymous
Not applicable
433 Views
5 Replies
Message 1 of 6

Force to Change a Parameter

Anonymous
Not applicable

Hello,

 

I have some iLogic Code that checks the clearance between two of the features.  I have set up the code in this manner:

 

If Parameter1 - Parameter 2 <= 0.300 Then

Message Box (Error Message)

ILogicForm.Show(Form)

End If

 

I can force the Form to open, BUT I can just hit the cancel button and while Parameter1-Parameter2 is in an error condition it will just generate the part as if nothing is wrong.

 

I want to force the user to edit either Parameter1 or Parameter2 so the clearance check will run again.  Please advise.

 

Thanks!!

0 Likes
434 Views
5 Replies
Replies (5)
Message 2 of 6

MechMachineMan
Advisor
Advisor

I would try something like this:

 

SOURCE: https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/statements/do-loop-statement

 

Do While (Parameter1 - Parameter2) <= 0.300
    ILogicForm.Show(Form)
    RuleParametersOutput()
    InventorVb.DocumentUpdate()
Loop 

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 6

Anonymous
Not applicable

What does the last two lines in that code do?

 

RuleParametersOutput ()

InventorVb.DocumentUpdate()

 

I am fairly new to using iLogic so some of the syntax is over my head at the moment.

 

Thanks!

0 Likes
Message 4 of 6

MechMachineMan
Advisor
Advisor

http://lmgtfy.com/?q=inventor+%2B+iLogic+%2B+RuleParametersOutput()


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 5 of 6

Anonymous
Not applicable

So when I put the code you mentioned in my Rule it creates a never ending loop.  The Form will open, but I do not get a cursor to change any of the values.  It is always the loading circle.  Please advise.

 

Thanks!

0 Likes
Message 6 of 6

MechMachineMan
Advisor
Advisor

Hmm. might have to use the Parameter("Parameter1") calls to fix it to force them to update. Could also be an issue with code running in the background during the forums.

 

Something to try and investigate.

 

The inventor Parameter functions page, linked through LMGTFY, should provide some more documentation on the Parameter calls.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes