ILOGIC CUSTOM ¨PARAMETER in CUSTOM PROPERTY

ILOGIC CUSTOM ¨PARAMETER in CUSTOM PROPERTY

stefan.godfroid
Participant Participant
1,596 Views
2 Replies
Message 1 of 3

ILOGIC CUSTOM ¨PARAMETER in CUSTOM PROPERTY

stefan.godfroid
Participant
Participant

Hello,

 

I have a custom parameter "TEKENCODE_INPUT" which can be edited with Multi Value list.  (see photo)

Naamloos.jpg

 

Now i want this parameter filled in a custom property.

 

I do this with a Ilogic Rule

 

SyntaxEditor Code Snippet

Dim TEKENINGCODE, TEKENCODE_INPUT As String
Dim TC_input, TC_output As String
TEKENCODE_INPUT = TC_input
Select Case TC_input   
Case S
    TC_output = "S"    
Case K
    TC_output = "K"
Case Else
     TC_output = "X"
End Select
iProperties.Value("custom", "TEKENINGCODE") = TC_output

But whatever i choose, the custom property "TEKENINGCODE" has alwayes the value "S". 

 

What do i wrong?

 

0 Likes
1,597 Views
2 Replies
Replies (2)
Message 2 of 3

petestrycharske
Advisor
Advisor

Stefan,

 

Good morning!  I believe all you have to do is set the custom iProperty equal to the value of your parameter.  Please let me know if the information below gets things working for you.  If you have any questions, please do not hesitate to contact me.  Hope this helps and have a most blessed day!

 

Peace,

Pete

 

iProperties.Value("Custom", "TEKENINGCODE") = TEKENCODE_INPUT 'The name of the parameter

iLogicVb.UpdateWhenDone = True

 

Just a guy on a couch...

Please give a kudos if helpful and mark as a solution if somehow I got it right.
Message 3 of 3

Curtis_Waguespack
Consultant
Consultant

Hi stefan.godfroid,

 

Since you are wanting to set the iproperty to be "X" when the parameter is anything else than S or K in the simple example, you would use something like this:

 

'select the case for TEKENCODE_INPUT
Select Case TEKENCODE_INPUT   
Case "S"
    'more code for other stuff here 
	'when Case is S
	TC_output = TEKENCODE_INPUT
Case "K"
	'more code for other stuff here
	'when Case is K
	TC_output = TEKENCODE_INPUT
Case Else
	'more code for other stuff here 
	'when Case is not S or K
	TC_output = "X"
End Select

'set the custom iproperty to match the parameter
iProperties.Value("Custom", "TEKENINGCODE") = TC_output

If you wanted it the iProperty to always match the parameter value you would use what petestrycharske posted.

 

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

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

EESignature

0 Likes