add rule to an external rule prblems

add rule to an external rule prblems

Anonymous
Not applicable
679 Views
5 Replies
Message 1 of 6

add rule to an external rule prblems

Anonymous
Not applicable

How do I add an external rule to an external rule. Or I have an external  rule that exists and when I add to it I get errors. Both of these rules run fine alone. I want to add 2 lines of code to the end of an existing rule that all parts are already triggered to run at save. 

 

see attached.

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

Anonymous
Not applicable
Accepted solution

Hi Ray,

 

My guess is that, because you're using a "Sub Main", and an additional function, your additional lines of code must be in the "Sub Main" to execute.

 

When you're using functions and subs, all executable code must be in a sub or function.

 

Richard

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks I tried it below the sub & got errors- never thought of adding to above sub.

 I serously need a course in the ILOGIC code!

0 Likes
Message 4 of 6

Anonymous
Not applicable

Thanks Rich: I was wondering if you could help me with this string.

 

iProperties.Value("Project", "Designer")= Environment.UserName

this works alone but when I add it to the sub main I get the error "user name is not a member of inventor environment."

 

 I am tring to capture the windows user name and slip it to the designer and author field on save. The Inventor (options) user name can be modified to easily.

 

Thanks for your time.

0 Likes
Message 5 of 6

Anonymous
Not applicable
Accepted solution

Oddly, mine worked when I added it to the Sub Main.  There might be some other things going on, but try using:

 

iProperties.Value("Project", "Designer")= System.Environment.UserName

Richard

Message 6 of 6

Anonymous
Not applicable

Thanks Richard -

System.environment.user name worked great!

 

0 Likes