• Blog posts


    By Clint Brown


    I've adapted one of the Inventor API samples to work with iLogic, specifically to create Shrinkwrap Substitute Levels of Details (LOD's). In the image above, you see 3 sets of bicycle sprocket assemblies. These models are Substitute LOD representations, based on the code below. The first shows a Substitute LOD with no holes patched, the second shows a patched hole range and the third shows all holes patched.

    To give the user a bit more interaction with the options in the code, I created an arraylist, which lets the user select the hole patching options they prefer.  

    From the Selection above, if the user selects "Patch a Range" they are presented with 2 input boxes which allow them to specify the range for the hole patching. The defaults are set to 0.5mm (minimum) and 10mm (maximum), but this can be edited in the code. 

    Some housekeeping:

    You can only create a Substitute LOD from an Assembly, and you can't create an LOD while you are already in one, so I put in a simple error trap that will come up "ON ERROR". This will appear if you are in a part file, or if you already have a substitute LOD active.

    The Code is attached below, enjoy!