Message 1 of 3
Change color of features only on flatpattern view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have been looking for a few days but without result a way to change the color of a function named "Gravure..." only on the view of the flatpattern.
I already have a code start but I can't "reach" the "Gravure..." function in the flatpattern.
I found in "Inventor help" the function "GetFlatPetternEntity or GetSheetMetalEntity" but I did not find an example to understand how it works.
Does anyone have an idea? Thank you
Here, my code:
'Regle pour changer la couleur de la gravure sur mise en plan Déplié If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then 'MsgBox("Cette Règle '" & iLogicVb.RuleName & "' ne fonctionne que pour les Mise en Plans!",vbOKOnly, "MAUVAIS TYPE DE DOCUMENT") Exit Sub Return End If Dim oDoc As DrawingDocument = ThisDrawing.Document Dim oSheet As Inventor.Sheet = oDoc.ActiveSheet Dim oPDoc As PartDocument = oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument Dim oPDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition Dim oGravure As EmbossFeature For Each oView As DrawingView In oSheet.DrawingViews If oView.IsFlatPatternView Then 'Verification qu'il y ai des bossages "GravureX" For Each oGravure In oPDef.Features.EmbossFeatures If Left(oGravure.Name, 7) = "Gravure" Then Dim oDCurves2 As DrawingCurvesEnumerator oDCurves2 = oView.DrawingCurves(oGravure) 'Here Something's wrong! If oDCurves2.Count <> 0 Then 'Definition des lignes en rouge (R, G, B) Dim oRed As Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0) For Each oDCurve As DrawingCurve In oDCurves2 oDCurve.Color = oRed Next Else 'Sortie de la regle Exit Sub End If End If Next End If Next