Tuesday, June 24, 2014

iLogic: Working with the Active Sketch


Issue:
You're working with sketches in some iLogic code and want to be able to find the active sketch name, or active sketch number. 



Solution:
Here are a couple of quick rules that will do this. And also as a bonus there is a quick rule to delete all sketches in the part.

Rule1: Find the active sketch name



Dim oSketch As PlanarSketch
If Typeof ThisApplication.ActiveEditObject Is Sketch Then
oSketch = ThisApplication.ActiveEditObject
MessageBox.Show(oSketch.Name & " is the active Sketch", "iLogic")
Else
MessageBox.Show("Active Edit Object is not a Sketch", "iLogic")
End If




Rule2: Find the active sketch number



Dim oSketches As PlanarSketches
oSketches = ThisApplication.ActiveDocument.ComponentDefinition.Sketches

i=1
For Each oSketch in oSketches
            oSketch = oSketches.Item(i)
                   If oSketch Is ThisApplication.ActiveEditObject Then
                   MessageBox.Show("The active sketch is number: " & i, "iLogic")
                   Else
                   End If
          i=i+1  
Next
 



Rule3: Delete all sketches.



Dim oSketches As PlanarSketches
oSketches = ThisApplication.ActiveDocument.ComponentDefinition.Sketches

If Typeof ThisApplication.ActiveEditObject Is Sketch Then
ThisApplication.ActiveEditObject.ExitEdit
Else
End If

For Each oSketch in oSketches
            oSketch = oSketches.Item(oSketch.Name)
          oSketch.Delete
Next
 

Thursday, June 19, 2014

Inventor 2015 User Interface Is Missing Buttons?

Issue:
You've upgraded to Autodesk Inventor 2015 from a previous version and find that some of the tool buttons have been hidden and stacked into grouped, fly-out menus. You've checked with a reputable attorney, and have found out that it's not legal to sneak into the Autodesk Inventor development team's office and release two dozen rabid ferrets, as payback for them once again dinking with Inventor's interface. So as "Plan B" you'd like to find some way to make the buttons more easily accessible. Can this be done?




Solution:
You can right click any tool group that has a dropdown arrow next to it and choose Ungroup. And you can also select a specific tool and choose Move to Main Panel if it's one you use often.

For further information on customizing the display of ribbon panels, visit this link:
http://help.autodesk.com/view/INVNTOR/2015/ENU/?guid=GUID-E5AB014C-D87B-4D7B-963C-00847E3DDE01