Sanjay Yallure
Saturday, October 31, 2015
Thursday, August 27, 2015
Autodesk Inventor iLogic - Model & Vault Browser Toggle.
Sub SwitchVaultModelTree()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oPanes As BrowserPanes
Set oPanes = oDoc.BrowserPanes
If oPanes.ActivePane.Name = "Vault" Then
'oPanes.Item(3).Activate
oPanes.Item("Model").Activate
Else
oPanes.Item("Vault").Activate
End If
If oDoc.Type = kDrawingDocumentObject Then
oPanes.Item("Model").Activate
End If
End Sub
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oPanes As BrowserPanes
Set oPanes = oDoc.BrowserPanes
If oPanes.ActivePane.Name = "Vault" Then
'oPanes.Item(3).Activate
oPanes.Item("Model").Activate
Else
oPanes.Item("Vault").Activate
End If
If oDoc.Type = kDrawingDocumentObject Then
oPanes.Item("Model").Activate
End If
End Sub
Thursday, January 9, 2014
Tuesday, April 10, 2012
Monday, April 9, 2012
Saturday, December 24, 2011
Autodesk Inventor iLogic Code to List Names of Drawing Views
Autodesk Inventor "iLogic Rule file” to list the view names in a Autodesk Inventor drawing.
I was revising a drawing & wanted to add a new view to the drawing with a view name.
I was revising a drawing & wanted to add a new view to the drawing with a view name.
Instead of looking at all the sheets & list the names of existing views to chose the unique name for new view.
I write this illogic which will list all the existing view names in my drawing (It does sorting as well) & make it easier to name my new view.
Here is the procedure to use the illogic rule
1) Download ViewNames.iLogicVb into a safe location.
2) Goto Manage >> iLogic >> Edit iLogic Tree
3) Right click on the “External Rules in Files” & select “Add External Rule”.
4) Browse & select to the downloaded file in the “Open Rule File(s)” Dialog & it will appear in the iLogic Tree Editor’s “External” tab.
5) To use the iLogic Right click on ViewNames & select “Run Rule”.
Following Dialog will list the names of existing views.
Steps 1 to 4 are required at 1st time only.
For further use follow step 5 only.
Please run this only in a drawing document. I have not written it to handle any error codes.
iLogic Code:
'Programmed by: - Sanjay Yallure
Dim strViewNames(0 To 100) As String
Dim i As Integer
Dim j As Integer
Dim bolRearrange As Boolean
Dim strTempViewname As String
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheets As Sheets
Dim oSheet As Sheet
oSheets = oDoc.Sheets
Dim oViews As DrawingViews
Dim oView As DrawingView
i = 0
For Each oSheet In oSheets
oViews = oSheet.DrawingViews
For Each oView In oViews
'MsgBox oView.Name
'Write #1, oView.Name
strViewNames(i) = oView.Name
i = i + 1
Next
Next
Do
bolRearrange = False
For j = 0 To i - 1
If strViewNames(j) < strViewNames(j + 1) Then
strTempViewname = strViewNames(j)
strViewNames(j) = strViewNames(j + 1)
strViewNames(j + 1) = strTempViewname
bolRearrange = True
Else
End If
Next j
Loop While bolRearrange = True
Dim strViewNamesList As String
For j = 0 To i+1
strViewNamesList = strViewNamesList & strViewNames(j) & vbCrLf
Next j
MsgBox (strViewNamesList, vbInformation, "Viewnames")
04 Sept 2012:
Here is the Ilogic with error handling incorporated.
ViewNames1.iLogicVb
Subscribe to:
Posts (Atom)