- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @jeslinakoruth. It is difficult to diagnose problems with your code without being familiar with what all the custom terms being used within it represent. Since the code is just black & white text in a code window (the way we usually like to see it) we can not tell if some of them may be blue, unquoted names of parameters, and directly recognized as representing local parameters...or just terms being used as local variables within the code, and do not actually directly represent parameters. We also do not know what types of parameters they are, or what types of values they may have. At first, working with parameters can be a bit tricky, due to the differences in units and automatic (or not) unit conversions that happen.
Is 'partOD' only a local variable, as it looks like, or is it also the exact spelling and capitalization of a parameter in the same model that the iLogic rule is saved within? Same for 'size', 'sizec', 'sizeb', 'sizet', 'zdiameter', zdiameterc' , 'zdiameterb', 'zdiametert', and so on. If any of those terms are just local variables, then they should be 'declared' (using the Dim keyword), and should have their Type specified where they are declared, such as:
Dim size As Double
...if that is just a local variable, and not a blue, unquoted parameter name. Also, keep in mind that when working with blue, unquoted parameter names, or when working with the Parameter("ParamName") type iLogic snippets, the 'value' will be in 'document units' (the value specified within the Document Settings as the default length/distance unit), not necessarily in the parameter's own units (if they are different units). However, when working accessing the actual Parameter object by Inventor API code (such as what you are doing in the last 12 or so lines of code), then the value will always be in 'database units' (always centimeters for length/distance, no matter what the document units or parameter units are).
Wesley Crihfield
(Not an Autodesk Employee)