08-09-2018
06:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-09-2018
06:40 AM
Being in a part shouldn't matter.
You would need to call this from another method like this (this was written from memory so I can't say for certain it'll work 100%!):
Sub Main()
dim partDoc as partdocument = thisapplication.activedocument 'gets the activedocument in partdocument form
dim partDef as partcomponentdefinition = partdoc.componentdefinition 'gets the part file definition.
dim selectedworkplane as workplane = partDef.workplanes(1) 'gets the XY plane so swap this with whatever your object is
SetFrontViewToWorkplane(ThisApplication, partDoc, selectedworkplane)
End Sub
Public Shared Sub SetFrontViewToWorkplane(ByVal InventorApp As Inventor.Application, ByVal partDoc As PartDocument, ByVal selectedWorkPlane As WorkPlane)
partDoc.SelectSet.Clear()
partDoc.SelectSet.[Select](selectedWorkPlane)
Dim selSet As SelectSet = partDoc.SelectSet
Dim LookAt As ControlDefinition = InventorApp.CommandManager.ControlDefinitions("AppLookAtCmd")
LookAt.Execute()
selSet.Clear()
Dim activeView As View = InventorApp.ActiveView
activeView.SetCurrentAsFront()
End SubIf you still have issues, please respond here with your complete rule and any error messages you receive.
Cheers,
Alex.
----------------------------------------------------------------
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example