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: 

add rule to an external rule prblems

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Ray_P
515 Views, 5 Replies

add rule to an external rule prblems

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.

5 REPLIES 5
Message 2 of 6
Radioflyer651
in reply to: Ray_P

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

Message 3 of 6
Ray_P
in reply to: Radioflyer651

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!

Message 4 of 6
Ray_P
in reply to: Radioflyer651

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.

Message 5 of 6
Radioflyer651
in reply to: Ray_P

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
Ray_P
in reply to: Ray_P

Thanks Richard -

System.environment.user name worked great!

 

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

Post to forums  

Autodesk Design & Make Report