Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MultiValue Text Parameter iPart

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Benjieng
940 Views, 3 Replies

MultiValue Text Parameter iPart

Hi,

I have tried endlessly to find an answer for my problem.

Im relatively new to iparts and ilogic but i have a basic concept of it all.

I am trying to create a ipart that has a drop down text list which when selected will determine hole depths/position on the part by a background rule.

Heres an example.

 

If i select "BA" then 1 hole will be present and it will be 10mm deep.

If i select "BW" then 2 holes will be present and they will both be 20mm deep.

 

(ive attached some screenshots that should hopefully make it clearer as to what i want to do!)


However the issue is that i cannot make the "End Service" Text parameter available in the ipart table. 

Now i understand that it is more than likely the fact that it is a text parameter that is causing this problem.

 

Is there a workaround?

Cheers!

3 REPLIES 3
Message 2 of 4
wood.isbell
in reply to: Benjieng

You will probably want to change your IF>Then statements to Select Case, but you should be able to get your box like so:

 

'Get an array of your parameter values. Change Test to your parameter.
Dim sChoices() As String = Parameter.Param("Test").ExpressionList.GetExpressionList
'Show a list box with your choices, using the first one as default. Change the text as you like.
Dim sResponse As String = InputListBox("Choose.",  sChoices, 
    sChoices(0), Title := "Make your choice.", ListName := "Choices")
'Now use sResponse string to iterate your results.

Select Case sResponse
    Case "B1"
        'Do stuff
    Case "B2"
        'Do stuff
    Case Else
        'If nothing else fits.
End Select
Message 3 of 4
Benjieng
in reply to: wood.isbell

excellent ill give it a go thankyou! Ill let you know!

Message 4 of 4

I would caution against using iRules in iParts. The rules do not fire when you place the iPart, so you will be stuck with the result of the last instance the rule was fired. This also tends to happen when multiple members are generated.

 

Rather than using iRules to turn features on and off, I would recommend making it part of your table or finding creative ways to use parameters to turn features on and off using the feature properties.

 

As far as using multivalue text parameters in iPart tables, I have tried to do so with no success. I am hoping that possibility will be added some day.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report