Thursday, September 7, 2023

Looking to create an Inventor Add-in? Wish there was a simpler template to get you started?

You can find a couple of simplified Inventor Add-In templates at this Autodesk University link:  

MFG601910 | Bridging the Gap Between iLogic Automation and Inventor Add-Ins


In this class, I walk you through the setup and use of a simplified add-in template to get you up and running quickly with an add-in template that comes with some preconfigured tools that will allow you to quickly and easily create your own tools and buttons.




Here is a direct link to the *.zip file that includes the Add-in templates, because on the AU page it is showing as a PDF icon for some reason? 

This class walks you how to spin up a basic add-in that comes with some simple buttons that you can configure to your liking.

And/or you can add to it and create you own.


There is also another add-in template included with some of the more advanced "button stacks" with dropdowns, etc. that you can also configure to your liking, and/or you can add to it and create your own:




Autodesk University 2023: Bridging the Gap Between iLogic Automation and Inventor Add-Ins, MFG601910 



Wednesday, February 1, 2023

iLogic : Set View Scale from Standard Preset Set List

 Issue:

You would like to set the view scale of your drawing views using the predefined scale list as found at Manage tab > Styles Editor button > Standard > Standard name > General tab > Preset Values > Scale




Solution:

Here is a quick bit of code to get this list and set the scale based on the scale selected from the input list box.

( Thank you! to Zach B. for the idea for the rule) 





Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oStyleManager As DrawingStylesManager = oDoc.StylesManager

Dim oActiveStandard As DrawingStandardStyle
oActiveStandard = oDoc.StylesManager.ActiveStandardStyle

Dim oList As New List(Of String)
For Each oItem In oActiveStandard.PresetScales
	oList.Add(oItem)
Next

Dim oView As DrawingView
oCurrentScale = oDoc.ActiveSheet.DrawingViews.Item(1).ScaleString

Dim oScale As String = InputListBox("Select a scale", _
oList, oCurrentScale, "iLogic", "Standard Scale List")

If String.IsNullOrWhiteSpace(oScale) Then Exit Sub

For Each oView In oDoc.ActiveSheet.DrawingViews
	If oView.ScaleFromBase = False Then
		oView.ScaleString = oScale
	End If
Next