Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hide all dimension values in a drawing using Ilogic

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
eric.mebisJSLU7
1707 Views, 9 Replies

Hide all dimension values in a drawing using Ilogic

Hello, I'm wondering if there is a way to hide all dimension values in a drawing. Just showing the dimensionlines and arrows but not the dimension and tolerance.

You can easy turn of the layer in witch te dimension is set but than everything disappears. 

Can it also be done for the GT&D sybols and the roughness of surface texture.

 

Hoping to get some help

 

Gr Eric

9 REPLIES 9
Message 2 of 10

Yes that is possible.

I am far from my desk right now.

I will take a look asap.

Keep reading.

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 3 of 10

Hy Brandon, I suppose it is....Thanks a lot.

I'm looking forward

Eric

Message 4 of 10

Public Sub main()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument

Dim c As Sheet
Set c = b.ActiveSheet

Dim v As DrawingView
Dim di As DrawingDimension

For Each v In c.DrawingViews

For Each di In c.DrawingDimensions
di.HideValue = True
Next

Next
End Sub

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 5 of 10

Or this:

 

Public Sub main()

Dim a As Application
Set a = ThisApplication

Dim b As DrawingDocument
Set b = a.ActiveDocument

Dim c As Sheet
Set c = b.ActiveSheet

Dim v As DrawingView
Dim di As DrawingDimension

For Each v In c.DrawingViews

For Each di In c.DrawingDimensions
di.Text.FormattedText = ""
Next

Next
End Sub

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !

Message 6 of 10

Hello Thanks, I tried the rule  but get a error.

I'm using Inventor 2020 en I'm getting a error that the "Let and Set" function not longer is supported.

 

 

Message 7 of 10

Here a iLogic rule that also clears (not hide) all the FeatureControlFrames (GT&D symbols) and SurfaceTextureSymbols. there is none api for clearing the DatumIdentifierSymbols.

 

Dim doc As DrawingDocument = ThisDoc.Document
Dim sheet As Sheet = doc.ActiveSheet

' Clear all DrawingDimensions
For Each drawingDimension As DrawingDimension In sheet.DrawingDimensions
    drawingDimension.HideValue = True
    drawingDimension.Text.FormattedText = ""
Next

' Clear all FeatureControlFrames (GT&D symbols)
For Each featureControlFrame As FeatureControlFrame In sheet.FeatureControlFrames
    featureControlFrame.DatumIdentifier = ""
    featureControlFrame.Notes = ""
    For Each featureControlFrameRow As FeatureControlFrameRow In featureControlFrame.FeatureControlFrameRows
        featureControlFrameRow.Tolerance = "            " 'remove spaces when you also want the box to disapear
        ' LowerTolerance can also be done but then 
        ' you will need to check if the tolerance is set or it will fail.

        If (String.IsNullOrEmpty(featureControlFrameRow.Tolerance) = False) Then
            featureControlFrameRow.DatumOne = "  " 'remove spaces when you also want the box to disapear
            ' DatumTwo and DatumThree can also be done but then 
            ' you will need to check if the previous is set or it will fail.
        End If
    Next
Next

'Clear all SurfaceTextureSymbols
For Each surfaceTextureSymbols As SurfaceTextureSymbol In sheet.SurfaceTextureSymbols
    surfaceTextureSymbols.AdditionalProductionMethod = ""
    surfaceTextureSymbols.AdditionalRoughness = ""
    surfaceTextureSymbols.AdditionalSamplingLength = ""
    surfaceTextureSymbols.MaximumRoughness = ""
    surfaceTextureSymbols.MinimumRoughness = ""
    surfaceTextureSymbols.ProductionMethod = ""
    surfaceTextureSymbols.SamplingLength = ""
    surfaceTextureSymbols.SurfaceWaviness = ""
    surfaceTextureSymbols.MachiningAllowance = ""
Next


 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 8 of 10

Thanks Yelte

Your API works fine and is useful to me. But there is a small issue when you set:

 

drawingDimension.Text.FormattedText = ""

Also the symbols like Ø en regular tekst will be forever lost. When we show back the dimensions  the  original tekst and symbols should be visible.

Can you fix that.... 

Message 9 of 10

try this:

Dim doc As DrawingDocument = ThisDoc.Document
Dim sheet As Sheet = doc.ActiveSheet

' Clear all DrawingDimensions
For Each drawingDimension As DrawingDimension In sheet.DrawingDimensions
    drawingDimension.HideValue = True
    If ((drawingDimension.Text.FormattedText = "<DimensionValue/>") Or
        (String.IsNullOrEmpty(drawingDimension.Text.FormattedText))) Then
        drawingDimension.Text.FormattedText = ""
    End If
Next

'Clear all SurfaceTextureSymbols
For Each surfaceTextureSymbols As SurfaceTextureSymbol In sheet.SurfaceTextureSymbols
    surfaceTextureSymbols.AdditionalProductionMethod = ""
    surfaceTextureSymbols.AdditionalRoughness = ""
    surfaceTextureSymbols.AdditionalSamplingLength = ""
    surfaceTextureSymbols.MaximumRoughness = ""
    surfaceTextureSymbols.MinimumRoughness = ""
    surfaceTextureSymbols.ProductionMethod = ""
    surfaceTextureSymbols.SamplingLength = ""
    surfaceTextureSymbols.SurfaceWaviness = ""
    surfaceTextureSymbols.MachiningAllowance = ""
Next

' Clear all FeatureControlFrames (GT&D symbols)
For Each featureControlFrame As FeatureControlFrame In sheet.FeatureControlFrames
    featureControlFrame.DatumIdentifier = ""
    featureControlFrame.Notes = ""
    For Each featureControlFrameRow As FeatureControlFrameRow In featureControlFrame.FeatureControlFrameRows
        featureControlFrameRow.Tolerance = "            " 'remove spaces when you also want the box to disapear
        ' LowerTolerance can also be done but then 
        ' you will need to check if the tolerance is set or it will fail.

        If (String.IsNullOrEmpty(featureControlFrameRow.Tolerance) = False) Then
            featureControlFrameRow.DatumOne = "  " 'remove spaces when you also want the box to disapear
            ' DatumTwo and DatumThree can also be done but then 
            ' you will need to check if the previous is set or it will fail.
        End If

    Next
Next

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 10 of 10

Jelte you're the best. Is working great. 

👌

Thanks for the support have a merry Christmas and a happy new year.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report