- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I have been working on this little task for a few days now and all of the searching through the forums has lead me nowhere. I am trying to use the Pick command to select and define the A-Side of sheet metal components and then automatically change the A-Side color to a pre-selected color based on the sheet metal defaults. I know how to select and define the A-Side and how to recall the sheet metal default names to set the color. What I cannot figure out is how to make all the A-Side faces change color.
I have found things on how to change a single face with a specific name to a color, or change random colors of the whole part, but nothing for the A-Side. I found a post where someone used Main and Sub routines to change the color of the A-Side (Solved: Ilogic Script for Highlight Defind A-Side and set the appearance ? - Autodesk Community - In...) , but I don't know how to work with routines like that and so I cannot edit it to change the color based on the sheet metal default.
Sub Main Dim oDoc As PartDocument = ThisDoc.Document Dim oSMDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition Dim oFace As Face If oSMDef.HasFlatPattern Then 'Skip entire rule, part is complete Else 'Force User to select A-Side Face oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick a feature") If Not oFace Is Nothing Then Call oSMDef.ASideDefinitions.Add(oFace) End If If oSMDef.ActiveSheetMetalStyle.Name.Contains("Tread") Then ChangeColor(oFace, "Red", oDoc) 'This is where I was attempting to use the sub routines I found End If End If End Sub
My ultimate goal is to automate my sheet metal creation to avoid errors from others. The rule will run upon save, check if there is a flat pattern, force a designated A-Side, Detect the sheet metal style used, Change the color of the A-side, then create the flat pattern.
Solved! Go to Solution.