- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Community,
Goal:
Convert an external rule, containing a Windows Form, into a rule that can be included with 'AddVbFile'.
The WinForm, which contains a RichTextBox object, could then be used by any rule with the ability to specify arguments (width, height, formatted text, etc.).
Background:
I developed an iLogic custom windows form (not DLL) that includes a RichTextBox. This offers text formatting options and most importantly, scrollbars - which is an improvement over MsgBox.
A chose iLogic code over a DLL to allow others to customize more easily. (Visual Studio not required)
Reusing the WinForm code required copying from rule to rule.
I converted it to an external rule, which can run from the iLogic Browser, but the arguments (width, height, text) are now static.
With the Community assistance, I hope we can modify the code to leverage 'AddVbFile' and the ability to pass arguments as mentioned above. I hope to avoid parameter mapping.
For example:
AddVbFile "Form - RichTextBox.Vb"
Sub Main
ShowCustomForm(600, 400, "Sample text")
End Sub
I have seen examples of external rules that have subs and functions that are passed arguments. However, none of those examples use windows forms.
If this is possible, I would welcome the Community assistance to make this a more re-useable tool.
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
P.S. I changed the file extension to '.txt' to allow the code to be attached to this post.
-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Solved! Go to Solution.
Link copied