Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iLogic Rule to Change Parameter Values

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
2411 Views, 10 Replies

iLogic Rule to Change Parameter Values

Hi,

 

I am in need of finding & changing parameter values of a particular feature from a part through iRule. Since, that particular part having lot of features. among them i can able to take that particular feature.

 

Thanks in advance.

10 REPLIES 10
Message 2 of 11
mrattray
in reply to: Anonymous

I don't think I understand the problem.
Changing the value of a parameter in iLogic is as easy as myParameter = 2
Mike (not Matt) Rattray

Message 3 of 11
Anonymous
in reply to: Anonymous

I'm confused as well.

 

I guess if you're trying to change them while in the assembly level, I'd say

 

Parameter("myComponent:1","myParameter") = 2

 

I feel like that's about as intricate as it gets.

Message 4 of 11
mrattray
in reply to: Anonymous

Or Parameter("myParameter") = 2 if it's an external rule.
Mike (not Matt) Rattray

Message 5 of 11
Curtis_Waguespack
in reply to: Anonymous

Hi VICKY,

 

In the iLogic rule editor, you can cick the Model tab and then expand the feature to see the sketch and parameters used in that feature. In the illustration below, Extrusion1 consumes Sketch2, which contains parameters d25 and d26.

 

 

Autodesk Inventor iLogic Feature Parameters.png

 

If you right click on the parameter and choose Capture Current State, it will add it to your rule.

Example:

d25 = 2 in

 

If you right click on the sketch and choose Capture Current State, it will add all of the parameters from the sketch to the rule.

Example:

' ***Sketch2***
d25 = 2 in
d26 = 0.5 in

 

 

If you right click on the feature and choose Capture Current State, it will add all of the parameters from the parameter to the rule.

Example:

' ***Extrusion1***
Feature.IsActive("Extrusion1") = True
d26 = 0.5 in
d25 = 2 in
d1 = 0 deg
d0 = 1 in

Related link:

http://help.autodesk.com/view/INVNTOR/2014/ENU/?guid=GUID-FC4714CC-A2C7-40E8-A198-5EFCA2E25CF9

 

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

Message 6 of 11
Anonymous
in reply to: Curtis_Waguespack

Hi everyone,

 

    Thanks for all your valuable feedbacks.... i got find the parameter & changed its value.

 

    Now i am facing the following difficulties. 

 

    Example:-

 

    My Parameter unit defined as 'mm'.  

   

    My Parameter value is 200 mm. Using iLogic Rule i try to add 10 mm with that parameter. Hence, i got the value as 2100 mm instead of 210 mm.

 

    Kindly give any solution for the above said issue.

 

 

Message 7 of 11
waynehelley
in reply to: Anonymous

Is the problem that you have definited the parameter in 'cm' but you want it in 'mm'?

 

In the Parameters window you should be able to define the units of a parameter.

 

Untitled.png

 

And you can set the default units in the Document settings.

 

Untitled.png

 

You can do this to the document settings in your template.

 

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 8 of 11
Anonymous
in reply to: waynehelley

Hi Wayne,

 

    Thanks for your reply.

 

    I have set parameter unit type and Document settings as you mentioned. But still my problem persists.

 

    Is there any unit settings for iLogic Rule?....

 

 

Message 9 of 11
waynehelley
in reply to: Anonymous

I don't understand where your problem is coming from.

 

I have my document settings det to 'mm' and a parameter called 'test' set in 'mm'.

 

If i use the code...

 

Parameter("test") = Parameter("test") + 10

 

10mm gets added onto the parameter called 'test'.

 

You must have something set to 'cm' somewhere or have made a typing-error for your 200mm to be turning into 2000mm.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
Message 10 of 11
Anonymous
in reply to: waynehelley

Thanks for your reply.

 

I will check somewhere in my parameters.

Message 11 of 11
mrattray
in reply to: Anonymous

Post your code here, the problem may pop out at a second set of eyes.
Mike (not Matt) Rattray

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

Post to forums  

Autodesk Design & Make Report