Message 1 of 2
iLogic - Change partslist style/layer visibility for all drawings in folder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What I'm trying to do:
From a form in my main drawing I'd like to control;
-fill in as built date (custom iprop, gets used in stamp)
-change visibility "As Built" layer (shows/hides stamp with date)
-change the partslist style depending on what materialnotation I select in my form
I'd like this to happen for all sheets in the active document, but also for the other 5 drawings that are residing in the same folder.
What I got so far:
Sub Main() Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oStyleMgr As DrawingStylesManager oStyleMgr = oDoc.StylesManager Dim oPartListStyle As PartsListStyle If Parameter("MaterialNorm") = "AD-2000 304" Then oPartListStyle = oStyleMgr.PartsListStyles.Item("-Norm_AD2000s") ElseIf Parameter("MaterialNorm") = "AD-2000 904L" Then oPartListStyle = oStyleMgr.PartsListStyles.Item("-Norm_AD2000n") ElseIf Parameter("MaterialNorm") = "ASME 304" Then oPartListStyle = oStyleMgr.PartsListStyles.Item("-Norm_ASMEs") ElseIf Parameter("MaterialNorm") = "ASME 904L" Then oPartListStyle = oStyleMgr.PartsListStyles.Item("-Norm_ASMEn") End If Dim oPartsList As PartsList For Each oPartsList In oDoc.ActiveSheet.PartsLists oPartsList.Style = oPartListStyle Next If AsBuilt = True Then ThisDrawing.Document.StylesManager.Layers("As Built LAYER").Visible = True Else ThisDrawing.Document.StylesManager.Layers("As Built LAYER").Visible = False End If End Sub
This gets done what I wanted to happen, except it only works for the active sheet. I'd love to get it working on the other sheets and drawings too but I'm not sure how to achive/approach that (my iLogic/VBA experience is rather limited).