copying paramater in .idw?

copying paramater in .idw?

sreed
Enthusiast Enthusiast
881 Views
5 Replies
Message 1 of 6

copying paramater in .idw?

sreed
Enthusiast
Enthusiast

I have a user parameter called "ModelDesignState" that is multi-value.  I have this in my .idw because it is tied to a rule that reaches out to the model.  I am wondering if there is a way to copy this parameter out of my .idw and paste it into another .idw?  Is there a way to make it a global parameter or something like that?

parameter.JPG

kelly.young has embedded your image for clarity.

0 Likes
Accepted solutions (1)
882 Views
5 Replies
Replies (5)
Message 2 of 6

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @sreed,

 

You can just add this to the top of the iLogic rule that is referencing the parameter. This will check for the parameter first, and then create it if not found.

 

Note that as written it also sets / resets the list regardless of whether the parameter exists or is created new, which is likely what you want, but maybe not.

 

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

 

 

Try
    'check for parameter 
    oTest = Parameter("ModelDesignState") 
Catch
    'create multi-value text parameter
    ThisDoc.Document.Parameters.UserParameters.AddByValue _
    ("ModelDesignState", "WorkInProgress", UnitsTypeEnum.kTextUnits)
End Try

'set list
MultiValue.SetList("ModelDesignState", "WorkInProgress", "Pending", "Released")

 

EESignature

0 Likes
Message 3 of 6

marcin_otręba
Advisor
Advisor

You can add it to your template.

For old ones you can run rule and write them to each, you can use template file and read parameter from it and place it to old ones...

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 4 of 6

sreed
Enthusiast
Enthusiast

Thanks for the help and sorry about making duplicate posts.  I have put your solution into my rule, but now I am getting an error with a different rule.  I will attach a drawing and some rules so you can see what i'm talking about.

As you can tell I don't know much about rules.

Also when we change the parameter in the form it automatically goes back to "work in progress"

0 Likes
Message 5 of 6

Curtis_Waguespack
Consultant
Consultant

Hi @sreed

 

I just saw your last post concerning the errors. Did you get this sorted out?

 

I ran the rules in a test drawing file, and all worked well, I did not see the parameter switch back in the form either.

 

What version of Inventor are you using? I might be able to provide a simple example file set for you to look at.

 

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

EESignature

0 Likes
Message 6 of 6

sreed
Enthusiast
Enthusiast

Yes I got it figured out,  there was an error that I did not notice before. 

Thank you for your help

0 Likes