I'd like to know the way to determine if particular Drawing Dimension is Broken.
I mean those dimensions crossing View-Break sign like this:
For now I don't even see any simple way to get the name of a DrawingView the Dimension belongs to.
Solved! Go to Solution.
Solved by chandra.shekar.g. Go to Solution.
Inventor itself can determine it (judging by the display option in dimension style settings):
Hi @Maxim-CADman77 ,
You should be able to identify such dimension lines by querying the (Get/Set) ShowBreakSymbol() boolean on the DimensionStyle Object as documented here.
Let me know in case of any further questions.
-
Tobias
Edit: I might have misinterpreted the question. You don't necessarily need to know which view the dimensions belong to but rather the position of their GeometryIntents in relation to the Start and End Point of the Break Operation in addition to their orientation. That way you should be able to determine whether ShowBreakSymbol() should be true or not.
Does that approach make sense and is easy enough to implement?
I believe this is related only to dimension style but not particular dimensionns.
Hi @Maxim-CADman77 ,
Ah I see what you mean.
Within the Dimension you can only query and change the property via the dimensions' "Style" and changes would be made to the style itself.
If you do have the requirement to set the BreakSymbol per Dimension, I believe it would be best to log it on the IdeaStation.
I'd rather prefer some (even tricky) workaround within next several days than ideal solution several years later.
Try below VBA code to identify broken dimension in drawing.
Sub Select_Broken_Dimension()
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Set oSheet = oDoc.ActiveSheet
Dim oDimension As DrawingDimension
For Each oDimension In oSheet.DrawingDimensions
Dim d As Double
d = distance(oDimension.DimensionLine.StartPoint.Y, oDimension.DimensionLine.StartPoint.X, oDimension.DimensionLine.EndPoint.Y, oDimension.DimensionLine.EndPoint.X)
d = d / 10
If d <> oDimension.ModelValue Then
Call oDoc.SelectSet.Select(oDimension)
End If
Next
End Sub
Function distance(ya As Double, xa As Double, yb As Double, xB As Double)
distance = Sqr((ya - yb) ^ 2 + (xa - xB) ^ 2)
End Function
Please feel free to contact if there are any queries.
Thanks and regards,
This is good idea!
But still needs adding some analysis of the Drawing View.
I mean it doesn't take to consideration DrawingView Scale value (works as expected only for dimensions belong to 1:1 Scaled Views).
PS: I believe it's also worth to compare rounded values, like:
If Round(d,8) <> Round(oDD.ModelValue,8) Then
Please provide non confidential sample drawings (different scale) to test the feasibility.
Thanks and regards,
I believe you don't need another sample.
Just change Drawing View Scale value to something different from "10:1".
Then to keep it working as expected you'll need to change accordingly the hard-coced multiplier in line
d = d / 10
For Dimension that belongs to 5:1 Scaled View:
d = d/5
For Dimension that belongs to 1:2 Scaled View:
d = d*2
...etc.
I still hope it is possible to get scale multiplier of the parent view for each dimension...
I'm attaching a sample set of model and drwing with several broken dimensions on several views with different scale.
I still hope somebody will help me to make VS (View Scale) variable an accosiative.
My current code is:
Sub Main
Dim oIDW As DrawingDocument = ThisApplication.ActiveDocument
Dim oSh As Sheet = oIDW.ActiveSheet
Dim oDD As DrawingDimension
Dim MsgMody As String
Dim VS As Double ' View Scale
For Each oDD In oSh.DrawingDimensions
MsgBody &= oDD.Text.Text
' MsgBody &= oDD.ModelValue
VS = 1/2 ' !!!!
Dim d As Double = OnIDWdistMM(oDD.DimensionLine.StartPoint.Y, oDD.DimensionLine.StartPoint.X, oDD.DimensionLine.EndPoint.Y, oDD.DimensionLine.EndPoint.X) / VS
MsgBody &= " (" & Round(d,3) & ")" '
If Round(d,8) <> Round(10*oDD.ModelValue,8) Then MsgBody &= " - BROKEN !!!"
MsgBody &= vbCrLf
Next
MsgBox(MsgBody,,"Dimensions' Break status:")
End Sub
Function OnIDWdistMM(ya As Double, xa As Double, yb As Double, xB As Double)
OnIDWdistMM = 10 * Sqrt((ya - yb) ^ 2 + (xa - xB) ^ 2)
End Function
Just in case:
I've got the answer regarding View Scale here - https://forums.autodesk.com/t5/inventor-customization/determine-scale-of-the-drawingdimension-s-pare...
Can't find what you're looking for? Ask the community or share your knowledge.