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
Solved! Go to Solution.
Solved by JelteDeJong. Go to Solution.
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 !
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 !
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 !
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.
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.
Blog: hjalte.nl - github.com
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....
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.
Blog: hjalte.nl - github.com
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.