Inventor Drawing; Toggle hide dimension while in active sketch

Inventor Drawing; Toggle hide dimension while in active sketch

thao.q.nguyen
Explorer Explorer
149 Views
1 Reply
Message 1 of 2

Inventor Drawing; Toggle hide dimension while in active sketch

thao.q.nguyen
Explorer
Explorer

I have seen some post that you can use VBA with this code to hide/unhide dimension but it seems it doesn't work on the inventor 2024 version. 

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
oDoc.ComponentDefinition.Sketches(1).DimensionsVisible = Not oDoc.ComponentDefinition.Sketches(1).DimensionsVisible

 

0 Likes
150 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @thao.q.nguyen.  That specific 3 lines of code might not work in VBA, because it is missing the 'Set' keyword in front of the second line, but it should work in an iLogic rule.  Even in Inventor 2024 version the PlanarSketch.DimensionsVisible property is still present, and still a Read/Write Boolean.  I just tested it from an iLogic rule and it worked just fine.  However, if the Sketch object itself is not visible, the dimensions will not be visible either.  So, you may have to make the sketch itself visible first.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)