- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Gentleman,
I am having an issue with the below code. I had it almost working and then I butchered it.
What I am trying to do is the following on all sheets of a Drawing.
- Do I need to write code to ignore the excluded sheet? There will only be a block that is automatically filled out with company information.
1. Change all existing general Dimensions to two style choices; "ANSI - IN [MM]" & "ANSI - MM"
2. Change all existing Ordinate Dimensions to two different style choices; "ANSI - ORDINATE - IN [MM]" & "ANSI - ORDINATE - MM"
3. Change all existing hole and thread call-outs to follow these two choices; "ANSI - IN [MM]" & "ANSI - MM"
Items 1 and 2 can occur on the same drawing. what that means is:
4. "ANSI - IN [MM]" & "ANSI - ORDINATE - IN [MM]" can change at the same time
5. "ANSI - MM" & "ANSI - ORDINATE - MM" can change at the same time
6. I will also have to switch out the feature control frames (there will be 2 choices) - names to be determined.
Thank you
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 13047 StartFragment: 314 EndFragment: 13015 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
DimStyle = DIM_STYLE '----------------------- Looks at Each Sheet ------------------------ For Each oSheet In oDrawDoc.Sheets '----------------------Reference to the style manager ----------- Dim oStylesMgr As DrawingStylesManager = oDoc.StylesManager '---- Get the reference to the target dimension style (by name)--- Dim oDimStyle As DimensionStyle Dim oOrdDimStyle As DimensionStyle If DimStyle = "ANSI - MM" Then oDimStyle = oStylesMgr.DimensionStyles.Item("ANSI - MM") oOrdDimStyle = oStylesMgr.DimensionStyles.Item("ANSI - ORDINATE - MM") Else oDimStyle = oStylesMgr.DimensionStyles.Item("ANSI - INCH [MM]") oOrdDimStyle = oStylesMgr.DimensionStyles.Item("ANSI - ORDINATE - INCH [MM]") End If '--------------------General Set Up ------------------------------ Dim oDims As DrawingDimensions = oSheet.DrawingDimensions Dim oGenDim As GeneralDimension Dim oOrdDim As OrdinateDimension '--------------------Changes General Dimensions-------------------- For Each oGenDim In oDims.GeneralDimensions oGenDim.Style = oDimStyle Next '--------------------Changes Ordinate Dimensions------------------- For Each oOrdDim In oDims.OrdinateDimensions oOrdDim.Style = oOrdDimStyle Next '--------------------Changes Hole & Thread Dimensions-------------- Dim oThreadNote As HoleThreadNote For Each oThreadNote In oSheet.DrawingNotes.HoleThreadNotes oThreadNote.Style = oDimStyle Next Next
Solved! Go to Solution.
