Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: llorden4

Everyone has their reasons for doing things the way they do, but my main reason for wanting to keep as much of my code 'external' is because I want to only have to edit it once, in one place, and be done with it.  We do not have Vault yet, have a very large storage area full of CAD / Engineering related data, all under one main 'project' area.  We do have some types of things that are pretty common, but just different enough to keep them in 'normal'/'general' file system area, rather than Content Center or iPart folders, because we want to maintain full control over each individual file, and keep them in our standard file system layout.  And since I have been into iLogic / Inventor API for several years now, and have many hundreds of unique rules & forms, if I had to edit them within individual Inventor files, I would never get done with it.  I can edit one external rule, instead of having to edit potentially hundreds of Inventor files with internal iLogic rules in them that are 'mostly' identical, or very similar.  And if I want to change a form, I can change the one global one, instead of tens or hundreds of internal ones.

So, not necessarily just due to Parameter related issues.

However, since making that move to external rules, and figuring some of this stuff out, I have grown to rely more and more on the Inventor API code way of doing most things, instead of the iLogic shortcut snippets ways.  There is just more inherent security in seemingly better documentation, in-line document object references, and actual objects.  Where most iLogic tools generally just ask for names (String) of documents or objects, the Inventor API generally asks for the actual objects themselves, which eliminates confusion/uncertainty.

I know for sure which document I am reading/writing from/to in this Inventor API code:

Dim oADoc As AssemblyDocument = ThisApplication.Documents.Open("C:\Temp\MyAssembly.iam", False)
oADoc.ComponentDefinition.Parameters.UserParameters.Item("Height").Expression = "26 in"

...even though it may take a little more code to get there. :winking_face:

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)