Message 1 of 5
ViewLabels and stuff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to add prefixes to views through the style manager for an iLogic rule to work properly
But this is causing some unwanted side effects and I could not find a way to turn it off
And here's the rule in question :
' Librarie de code iLogic/VBA Métal Marquis
' Auteur: Mathieu Grenier
' Nom: Vues dépliées
' Catégorie: Règles de mises en plans
' Date: 2025-06-04
' Description: Place des vues dépliées pour chaque pièce de tolerie présente sur la feuille de dessin active
' Version: 1.0
' En développement: Oui
' Notes:
Dim doc As DrawingDocument = ThisApplication.ActiveDocument
Dim sheet As Sheet = doc.ActiveSheet
Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
oOptions.Add("SheetMetalFoldedModel", False)
For Each view As DrawingView In sheet.DrawingViews
Dim viewName As String = view.Name.ToUpper()
' Ignorer les vues projetées ou générées automatiquement
If viewName.StartsWith("PROJ") _
Or viewName.StartsWith("AUX") _
Or viewName.StartsWith("COUPE") _
Or viewName.StartsWith("DRAFT") _
Or viewName.StartsWith("DETAIL") _
Or viewName.StartsWith("VIEW") Then
Continue For
End If
Try
Dim refDoc As PartDocument = Nothing
Try
refDoc = View.ReferencedDocumentDescriptor.ReferencedDocument
Catch
Continue For
End Try
If Not refDoc Is Nothing Then
Dim def As SheetMetalComponentDefinition = Nothing
Try
def = refDoc.ComponentDefinition
Catch
Continue For
End Try
If def.HasFlatPattern Then
If def.FlatPattern Is Nothing Then
def.Unfold()
def.FlatPattern.ExitEdit()
End If
Dim pt As Point2d = ThisApplication.TransientGeometry.CreatePoint2d( _
View.Center.X, View.Center.Y + 10)
Dim oFlatView As DrawingView = sheet.DrawingViews.AddBaseView( _
refDoc, _
pt, _
View.Scale, _
ViewOrientationTypeEnum.kFrontViewOrientation, _
DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle, _
, , oOptions)
oFlatView.ShowLabel = False
oFlatView.Name = "FLAT_" & view.Name
End If
End If
Catch
Continue For
End Try
Next
So like, the rule need to ignore every view on the active drawing sheet that isn't a base view.
How can I achieve this, or just hide the view prefix from the section view lines and the detail bubble?