Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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: 

iLogic methods in a class

5 REPLIES 5
Reply
Message 1 of 6
NachitoMax
261 Views, 5 Replies

iLogic methods in a class

Hi

 

keeping things organised, i moved some code to a Public Class. I instantiate the application and pass in the document being used but im hitting an issue.

 

iProperties.Value(ComponentODocName, SetName, PropertyName) obviously works in sub Main() level but not in Class level. Ive tried adding the doc to the front but nothing.

 

what is the magic code required for this in a class?

 

 

thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


5 REPLIES 5
Message 2 of 6

could you share the code?

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 3 of 6
WCrihfield
in reply to: NachitoMax

Hi guys.  I believe this is like most cases where you want to be able to use 'Rule Objects' within other resources.  I believe the 'iProperties' object is essentially a local variable of type Autodesk.iLogic.Interfaces.IiProperties Interface, which has already been assigned a value for us behind the scenes.  To use it else where, we would usually need to 'pass' that iProperties variable to the other resource, one way or another.  You could have local variable within your other Class with its Type set to Autodesk.iLogic.Interfaces.IiProperties, then set that 'input' object as its value whichever way you want, then you should be able to use that local variable.  But I believe there may be at least one or more other more base iLogic objects that could be sent to 'another' resource that would provide a broader or more dynamic benefit, such as the iLogicVb or InventorVb objects (both are the same thing).  You can use its CreateObjectProvider to create an IStandardObjectProvider, which can then be used as a basis for most of the other common and uniquely iLogic objects used in standard snippets.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 6
NachitoMax
in reply to: NachitoMax

I don't do ilogic that often, I'm more a vb guy and while they are similar, they are not.

 

It's not a biggie, I just ditched my class and promoted my functions up a level.

 

Thanks for replying

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 5 of 6
Frederick_Law
in reply to: NachitoMax

You can use VB only in rules.

Make it easier to convert to addin.

Message 6 of 6

Programming a addin gives you more flexibility and more possibilities. I think ilogic is meant to be used for product configurations....

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

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

Post to forums  

Autodesk Design & Make Report