2007 inspection dim numbers
2007 inspection dim numbers
(OP)
SW2007 sp2.2
Is there a way to assign numbers to the dims of a dwg for inspection purposes?
For example, you have a detailed dwg, our qc guy writes numbers next to each dim in order to reference to his report. I would like for SW to automatically assign those numbers & place them next to the dims. Is that possible?
Is there a way to assign numbers to the dims of a dwg for inspection purposes?
For example, you have a detailed dwg, our qc guy writes numbers next to each dim in order to reference to his report. I would like for SW to automatically assign those numbers & place them next to the dims. Is that possible?






RE: 2007 inspection dim numbers
An API guru may be able to create a macro which recognises the dimensions in a drawing and adds a consecutive number to each.
RE: 2007 inspection dim numbers
Why not place a modifying symbol in the Dimension Text box?
ex: 10.00 <C#-1> would give you 10.00 w/ 1 in a circle. It should only take an extra click or two on each dimension.
RE: 2007 inspection dim numbers
RE: 2007 inspection dim numbers
RE: 2007 inspection dim numbers
What a cool feature!
I notice that <T#-1> and <S#-1> also work.
It is a shame that <T#-B> does not work, since this would be a good way to flag revisions.
JHG
RE: 2007 inspection dim numbers
Apparently, the symbol capability of SW is fairly unknown. You can add any symbol into a dimension using the <****> notation as long as you know what the symbol code is. To find out the symbol code, pick a dimension and then click "More..." in the "Dimension Text" area of the property manager. Choose "Flag Tri A-Z" from the "Symbol Library" combo box, and choose "Triangle B" beneath. Then click OK. The triangle B will appear on the drawing, and the code "<TL-B>" will be shown the "Dimension Text" box of the property manager. You now know that the code for a letter inside a triangle is "<TL-*>", where * is the letter you want.
remj,
Adding the reference numbers to a different layer would be more difficult to do with a macro. The reference number would have to be a separate annotation rather than a part of the dimension, and the annotation would have to be grouped with the dimension to make sure that it maintains its position relative to the dimension when the dimension moves.
If anyone is interested, here is the code to insert felix's symbols to all drawing dimensions:
CODE
Dim swDoc As SldWorks.ModelDoc2
Dim swDwg As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swDispDim As SldWorks.DisplayDimension
Dim swDim As SldWorks.Dimension
Dim sCurSuffix As String
Dim nOpenParPos As Long
Dim nCloseParPos As Long
Dim vDimVal As Variant
Dim dInchVal As Double
Dim sInchString As String
Dim sNewSuffix As String
Dim KillFlag As Integer
Dim sMsg As String
Dim sRefPfx As String
Dim nRefNum As Long
Const DEFSYM As String = "C#-"
Sub AddDimRefNums()
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
If swDoc.GetType <> swDocDRAWING Then
MsgBox "This macro only works for drawing files."
Exit Sub
End If
sMsg = "This macro will add a symbol containing a dimension reference number " & _
vbCrLf & "to all dimensions in this drawing." & vbCrLf & vbCrLf & _
"To add or update dimension reference symbols, choose ""Yes""" & vbCrLf & _
"To remove reference symbols, choose ""No""" & _
vbCrLf & "To quit, choose ""Cancel"""
KillFlag = MsgBox(sMsg, vbYesNoCancel, "Dimension Reference Symbols")
If KillFlag = vbCancel Then
Exit Sub
End If
If KillFlag = vbYes Then
sRefPfx = InputBox("Please enter the desired symbol code." & vbCrLf & _
"For example, ""C#-"" for circles, ""S#-"" for squares." & vbCrLf & _
"Note that symbol codes are case sensitive.", "Symbol Type", DEFSYM)
Else
sRefPfx = ""
End If
Set swDwg = swDoc
nRefNum = 1
Set swView = swDwg.GetFirstView
While Not (swView Is Nothing)
Set swDispDim = swView.GetFirstDisplayDimension5
While Not swDispDim Is Nothing
Set swDim = swDispDim.GetDimension
sInchString = sRefPfx & nRefNum
nRefNum = nRefNum + 1
sCurSuffix = swDispDim.GetText(swDimensionTextSuffix)
nOpenParPos = InStr(1, sCurSuffix, "<", vbTextCompare)
nCloseParPos = InStr(1, sCurSuffix, ">", vbTextCompare)
If (KillFlag = vbNo) And (nOpenParPos > 0) And (nCloseParPos > 0) Then
sNewSuffix = Left(sCurSuffix, nOpenParPos - 1)
sNewSuffix = sNewSuffix & Right(sCurSuffix, Len(sCurSuffix) - nCloseParPos)
ElseIf (nOpenParPos > 0) And (nCloseParPos > 0) Then
sNewSuffix = Left(sCurSuffix, nOpenParPos)
sNewSuffix = sNewSuffix & sInchString
sNewSuffix = sNewSuffix & Right(sCurSuffix, Len(sCurSuffix) - (nCloseParPos - 1))
Else
If KillFlag <> vbNo Then
sNewSuffix = Trim(sCurSuffix) & " <" & sInchString & ">"
Else
sNewSuffix = sCurSuffix
End If
End If
swDispDim.SetText swDimensionTextSuffix, sNewSuffix
Set swDispDim = swDispDim.GetNext5
Wend
Set swView = swView.GetNextView
Wend
End Sub
RE: 2007 inspection dim numbers
You can place that symbol from the regular Dimension Manager More button.
RE: 2007 inspection dim numbers
Good one Handleman
RE: 2007 inspection dim numbers
It looks like christmas came a little late for me this year, but thanks so much for the macro.
I've had the same "problem" and have just been doing this manually forever.
I'm wondering one thing though, is it somehow possible to beat/work around the limitation of 99 dimensions? We do the same thing (which we refer to as "ballooning") and sometimes we make balloon prints with a few hundred dimensions. After the 99th we have to make a note with a circular border.
Thoughts, feelings, suggestions????
RE: 2007 inspection dim numbers
Check out CBL's great FAQ on custom symbols at FAQ559-1229: How Do I Create Custom Symbols?. All you have to do is modify your gtol.sym file to add as many numbers as you want. However, you should note that once you get above 99 the numbers may start overlapping the box/circle/whatever.
RE: 2007 inspection dim numbers
*99,Circle 99
A,CIRCLE .8,.5,.8
A,TEXT .8,.5,99
By revising the size of the X and the Radius the 150 fits in nicely. The size of the enclosing circle isn't that much different from the 2 digit circle.
*150,Circle 150
A,CIRCLE .9,.5,.9
A,TEXT .9,.5,150
You can tweak as needed.
Note that this would have to be included on all your work stations, otherwise I don't think it will show up except on the ones that have this revision.
Sylvia
RE: 2007 inspection dim numbers
RE: 2007 inspection dim numbers
I ran your macro, great time saver, but it only works on the active page. Is there a way to get this to work on all pages? Or add in a start number? I tried c#-16 and it caused problems <c#-161> so does c#1.
I have not tried writing my own macros but it appears this would be a pretty useful skill to learn.
thank you for your time and efforts
RE: 2007 inspection dim numbers
nRefNum = 1
and change it to
nRefNum = InputBox("Enter the starting number","",1)
It's been a while since I looked at this code, but I think that should work. Of course, it error out or behave strangely if you don't enter a number.
RE: 2007 inspection dim numbers
YOU ARE AWESOME!!!!!
Thank you, You probably just saved me a couple hours a week.
RE: 2007 inspection dim numbers