
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
For starters, it may seem like this question has been asked many times, but I've done a lot of searching through this forum with no luck.
I have a bunch of drawings where I need to replace old styles with the new styles in our style library. I'll explain what I'd like the iLogic to do by explaining what I currently have to do manually.
1. Find the dimension, right-click, then edit dimension style.
2. Once in the styles library, I find the style I want to replace, right-click, replace style, find what I want to take its place, purge replaced style, save and exit.
I found a little script that will do this, but only to one (the first) dimension. Here it is:
Sub Main() 'change dimension style 'drawing document Dim oDrawDoc As DrawingDocument = ThisDoc.Document 'active sheet Dim oSheet As Sheet = oDrawDoc.ActiveSheet 'reference to the first dimension Dim oDim As GeneralDimension = oSheet.DrawingDimensions(1) 'the current dimension style object Dim oStyle As DimensionStyle = oDim.Style 'reference to the style manager Dim oStylesMgr As DrawingStylesManager = oDrawDoc.StylesManager 'get the reference to another dimension style Dim oNewStyle As DimensionStyle _ = oStylesMgr.DimensionStyles.Item("Dimension-180-Arial _XXX") 'change the style oDim.Style = oNewStyle End Sub
I'd like to get this to replace all dimension styles with "Dimension-180-Arial _XXX". One thing to note is that when I do this manually, I don't lose my dimension type (reference parenthesis, number of decimal places shown, etc.). When I use the above script, I DO lose those things (e.g. it will update "(0.750)" to "0.750". Reference parenthesis will be gone. I know the "XXX" implies the tolerance (three digits past the decimal), but when I do it manually, it doesn't affect that. Doing it manually changes the font size and color. Running the script changes everything. I'm not really sure why there's a difference.
Lastly, if what I'm trying to do isn't possible, I'd like to be able to take all dimensions on the drawing and set them to font size 180 and Arial.
Thanks in advance!
Solved! Go to Solution.