cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename Detail and Section Views

Rename Detail and Section Views

Hello there

 

When adding and deleting a Detail or Section view, the view label "Index" do not remember the last deleted view.

 

e.g.

I Add a section view A-A and delete it. When i add a new section view, the Label will be "B-B" and so on. Same applies to detail views.

It would be great, if Inventor updates the Views automatically or there is a button.

7 Comments
Anonymous
Not applicable

Oh yes.

 

I have this "feature" very often and i find it quite interresting, that the People at autodesk never asked themselves, if it makes any sense....

in my opinionas a daily user of inventor: no !

Inventorstar
Enthusiast

Thanks for your comment, heavy69,

 

in our company, we have huge drawings with many Section and detail views. In the development process you have many revisions. So we sometimes have drawings with labels like "AAA-AAA".

 

This feature is not vital, but its a nice to have feature.

Anonymous
Not applicable

Well.

 

AAA is very high, respect fro that... Normally for us the "Standard" Alphabet is enough 😉

 

And another point Autodesk could think about is the fact that it´s possible to give several details or sections views the same name... a warning would be nice. perhaps something like a friendly: "Are you sure about that, dear user ?" 😉

 

 

Inventorstar
Enthusiast

Thats my Code to solve the Problem at the moment.

Details Naming goes from Z to A
Details go from A to Z

 

After Renaming, W form with the renamed views is shown

 

Private Sub RenameIdentifier()

Dim frm As UserForm
Set frm = frm_RenameReport


Dim InvDocs As Documents
Set InvDocs = ThisApplication.Documents

'Verweis auf das Aktive Dokument
Dim odrawdoc As DrawingDocument
Set odrawdoc = ThisApplication.ActiveDocument

If InvDocs.Count = 0 Then
    ThisApplication.StatusBarText = "MßSTAB LADEN - FEHLER: KEINE DATEI GEÖFFNET!"
    Exit Sub
End If

'Prüfen ob Zeichnung geöffnet
If odrawdoc.DocumentType <> kDrawingDocumentObject Then
    ThisApplication.StatusBarText = "MßSTAB LADEN - FEHLER: KEINE ZEICHNUNG GEÖFFNET!"
    Exit Sub

Else

    Dim docName As String
    docName = ThisApplication.ActiveDocument.DisplayName

    'Verweis auf aktives Blatt
    Dim oSheet As sheet
    Set oSheet = odrawdoc.ActiveSheet

    'Verweis auf Zeichnungsansichten
    Dim oViews As DrawingViews
    Set oViews = oSheet.DrawingViews

    Dim oView As DrawingView

    Dim Iter As Long
    
    Dim AnzSection As Integer
    Dim AnzDetail As Integer
    Dim StrSection As String
    Dim StrDetail As String
    
    StrSection = ""
    StrDetail = ""
    AnzSection = 0
    AnzDetail = 0
    
    'Iteration durch alle Ansichten
    
    'Details Durchnummerieren
    Iter = 26 'Nummerierung beginnt bei Z
    For Each oView In oSheet.DrawingViews
            If oView.ViewType = DrawingViewTypeEnum.kDetailDrawingViewType Then
                oView.Name = num2Letter(Iter)
                StrDetail = StrDetail + " - " + CStr(num2Letter(Iter))
                Iter = Iter - 1
                AnzDetail = AnzDetail + 1
                'Auszuschließende Buchstaben
                If InStr(1, num2Letter(Iter), "A") > 0 Or InStr(1, num2Letter(Iter), "B") > 0 Or InStr(1, num2Letter(Iter), "C") > 0 _
                Or InStr(1, num2Letter(Iter), "D") > 0 Or InStr(1, num2Letter(Iter), "E") > 0 Or InStr(1, num2Letter(Iter), "F") > 0 Then
                    Iter = Iter - 1
                End If
            End If
    Next oView
    
    'Schnittansichten Durchnummerieren
    Iter = 1 'Nummerierung beginnt bei A
    For Each oView In oSheet.DrawingViews
            If oView.ViewType = DrawingViewTypeEnum.kSectionDrawingViewType Then
                oView.Name = num2Letter(Iter)
                StrSection = StrSection + " - " + CStr(num2Letter(Iter))
                Iter = Iter + 1
                AnzSection = AnzSection + 1
                'Auszuschließende Buchstaben
                    If InStr(1, num2Letter(Iter), "X") > 0 Or InStr(1, num2Letter(Iter), "Y") > 0 Or InStr(1, num2Letter(Iter), "Z") > 0 _
                    Or InStr(1, num2Letter(Iter), "U") > 0 Or InStr(1, num2Letter(Iter), "V") > 0 Or InStr(1, num2Letter(Iter), "W") > 0 Then
                    Iter = Iter + 1
                End If
            End If
    Next oView
    
    'Dialogfeld füllen und anzeigen
    frm_RenameReport.lbl_sum_detail.Caption = AnzDetail
    frm_RenameReport.lbl_letter_detail.Caption = StrDetail
    frm_RenameReport.lbl_summ_Schnitt.Caption = AnzSection
    frm_RenameReport.lbl_letter_Schnitt.Caption = StrSection
    frm_RenameReport.lbl_build.Caption = Build
    frm_RenameReport.lbl_Drawing.Caption = docName
    
    frm_RenameReport.Show

End If

End Sub



Private Function num2Letter(num As Long) As String
'Konvertiert Nummern in Buchstaben (ASCII Code)
'Bsp. 1 = A, 28 = AB

    remain = num Mod 26 'Mod = Modulo Operator (Gibt den Rest eines Teilers zurück)

    whole = Fix(num / 26)
    If num > 0 < 27 Then
        If remain = 0 Then
            num2Letter = "Z"
        Else
            num2Letter = Chr(remain + 64)
        End If
    Else
        If remain = 0 Then
            num2Letter = Chr(whole + 63) & "Z"
        Else
            num2Letter = Chr(whole + 64) & Chr(remain + 64)
        End If
    End If
    
End Function
RogerTheShrubber
Advocate

Compile Error:

 Error on Line 3 : Type 'UserForm' is not defined.

Please, could someone provide a solution?

Try copying the sheet into a new drawing and it should reset the labels.

 

I was just copying sheets from one drawing to another and I noticed when I brought in the new sheets it updated all the labels for detail and section views. In theory we can use the to refresh our labels, let me know if this works for you. I'm certainly going to be trying it. For reference I noticed this in Autodesk inventor 2022 at 4:30 pm on 2021-12-22.

Ben-Cornelius
Collaborator

When creating drawing views can get deleted or are off the sheet for example and the view label are now out of sequence. Would be good to have a rename drawing views sequentially for section, detail, and auxiliary views. So if it would ignore views off the sheet and we also have a case where sometimes section lines are shown multiple times with the same label where they are the same so if it could also allow for that.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea