ilogic to change selected dims to basic tol.

ilogic to change selected dims to basic tol.

Anonymous
Not applicable
857 Views
3 Replies
Message 1 of 4

ilogic to change selected dims to basic tol.

Anonymous
Not applicable
I would like to be able to pick dimensions (overall size dim.)

Then change the tolorance to basic.

I have found this rule that changes all dims,
I just need to add the the pick function then change the picked dims.

Any help adding pick then changing to tol basic, not all dims.

Thank


Referance rule....
' Set a reference to the select set of the active document. Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument ' Find all selected occurrences and add them to an ObjectCollection. Dim oDrawingDims As DrawingDimension 'Loop through all dimensions For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions 'set the Tolerance Method'oDrawingDims.Tolerance.SetToDefault oDrawingDims.Tolerance.SetToBasic 'oDrawingDims.Tolerance.SetToReference Next

 

0 Likes
Accepted solutions (1)
858 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

You were right there, You were just missing 2 or 3 lines of code! Select the dimensions then run the rule.

 

' Set a reference to the select set of the active document.
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument

' Find all selected occurrences and add them to an ObjectCollection.
Dim oDrawingDims As DrawingDimension
Dim oSSet As SelectSet = oDoc.SelectSet
'Loop through all dimensions
For Each oDrawingDims In oSSet
'set the Tolerance Method'oDrawingDims.Tolerance.SetToDefault
oDrawingDims.Tolerance.SetToBasic 
'oDrawingDims.Tolerance.SetToReference
Next  

 

 

Message 3 of 4

maxim.teleguz
Advocate
Advocate

this is really useful

0 Likes
Message 4 of 4

nathan_m_gardner
Enthusiast
Enthusiast

Can I get a full copy of this macro? I want to be able to change dims to ref. thanks

 

.....

I have it:

 

Sub ToggleToleranceReferenceDefault()

' Set a reference to the select set of the active document.
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

' Find all selected occurrences and add them to an ObjectCollection.
Dim oDrawingDims As DrawingDimension
Dim oSSet As SelectSet
Set oSSet = oDoc.SelectSet

'Loop through all dimensions
For Each oDrawingDims In oSSet

'set the Tolerance Method'oDrawingDims.Tolerance.SetToDefault
oDrawingDims.Tolerance.SetToReference

'oDrawingDims.Tolerance.SetToReference

Next

End Sub

0 Likes