iLogic Form Drop Down list for Custom iProperties

iLogic Form Drop Down list for Custom iProperties

Cadmanto
Mentor Mentor
3,033 Views
5 Replies
Message 1 of 6

iLogic Form Drop Down list for Custom iProperties

Cadmanto
Mentor
Mentor

As many of you know, I am not a guru when it comes to iLogic.  I fumble at best!!! 🙃

With that said, I have been combing the forums and have seen a few threads on similar topics to the drop down.

Most notably the attached link.

https://forums.autodesk.com/t5/inventor-forum/ilogic-form-dropdown/td-p/3560928

 

What I am trying to do is in my iLogic form, which is present in all of my formats, is have a drop down that only has three selections to populate into the title block.  So, to this point, I have created a custom iproperty called "STATUS".

I want the three selections to be WIP, REL and OBS. 

status.png

When I "Save & Run" this rule, I get below.

status1.png

I figure that what ever is missing, is probably something simple.

 


Windows 10 x64 -16GB Ram
Intel i7-6700 @ 3.41ghz
nVidia GTS 250 - 1 GB
Inventor Pro 2020

 

Best Regards,
Scott McFadden
(Colossians 3:23-25)


0 Likes
Accepted solutions (1)
3,034 Views
5 Replies
Replies (5)
Message 2 of 6

Sergio.D.Suárez
Mentor
Mentor
Accepted solution

Hello dear @Cadmanto , here you have an alternative path that may be useful for you. It is not necessary to create a parameter for a selection box. Try it and tell me how you are doing. regards

 

Dim oValueList As New ArrayList
	oValueList.Add("WIP")
	oValueList.Add("REL")
	oValueList.Add("OBS")
Dim oValue As String = InputListBox("Select one option", oValueList, "WIP", "Ilogic ", "Available Selections")

iProperties.Value("Custom", "Status") = oValue

 


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 6

Cadmanto
Mentor
Mentor

My Man @Sergio.D.Suárez .  This worked like a charm!!!  Once I set the even triggers, all was good and is doing exactly what I need it to do.  Thank you so much!!!

 


Windows 10 x64 -16GB Ram
Intel i7-6700 @ 3.41ghz
nVidia GTS 250 - 1 GB
Inventor Pro 2020

 

Best Regards,
Scott McFadden
(Colossians 3:23-25)


0 Likes
Message 4 of 6

jtylerbc
Mentor
Mentor

Scott,

 

I started writing this before @Sergio.D.Suárez replied, but got interrupted before I finished it.  There are several issues with your original method - some iLogic, some not.  I realize you've solved it another way now, so I'm posting it just for educational purposes on why your previous attempt didn't work.

 

  1. The code tries to set the values in the list before the parameter actually exists.  That is the reason for the specific error you see in your screenshot.
  2. If the parameter does already exist (or you were to add something to your code to create it), you run into another issue.  In your "MultiValue.SetList" line, the values (WIP, REL, and OBS) are being seen as code variables instead of text.  They need to be put into quotes to be seen as text strings.  I'm guessing you probably based your work on an example that used numeric values - in that case the quotes wouldn't have been necessary.
  3. There is no option for Exporting Parameters from a drawing (even manually without involving iLogic).
  4. Text parameters can't be set for export, which means the third line of your code won't actually do anything.

 

Issues 1 & 2 could be fixed.  Issues 3 & 4 would need to be worked around somehow.  Because of these additional complications, Sergio's solution is likely cleaner than fixing your original version would be.

 

The one exception I can think of would be if you needed to incorporate the pick list into an iLogic form with other inputs, rather than having it pop up its own list box.  If that were needed, it might be worth revisiting your original method and shaking the bugs out of it. 

Message 5 of 6

Cadmanto
Mentor
Mentor

Thanks John.  That is a very good explanation.  I really appreciate you taking the time to spell that out for me.

Now that I look back on it, what you are saying makes sense.  I don't do iLogic all that often and when I do, it is research, cut and paste time. 😋

I did take that from the link I posted trying to improvise for my own application.  What Sergio gave me works well.

While I use Solidworks occasionally, and for the most part it pales in comparison to Inventor, one thing they do have that is pretty slick is the Property tab builder which is a tool similar to the iLogic form.  It has the ability to create drop down lists rather easily.  What I have working now works great.

Appreciate you John!!!

 


Windows 10 x64 -16GB Ram
Intel i7-6700 @ 3.41ghz
nVidia GTS 250 - 1 GB
Inventor Pro 2020

 

Best Regards,
Scott McFadden
(Colossians 3:23-25)


0 Likes
Message 6 of 6

jtylerbc
Mentor
Mentor

If the intended use is as a parameter (not a property), Inventor's multivalue list and iLogic forms work pretty well.

 

Unfortunately, since you can't export a text parameter, this doesn't really work out well for creating a dropdown list of iProperty values.  As I hinted at, there is a way to get around that limitation, by having iLogic code that sets the property value equal to the parameter value.  That's not all that hard to do if it's really necessary, but seemed like more effort than it is worth in your case, with Sergio's solution being somewhat cleaner already.

 

If we simply had the ability to export text parameters, we would have something roughly equivalent to the feature you describe from Solidworks.  Unfortunately, we have to take a roundabout path to get there with the current Inventor features. 

0 Likes