DrawingDimension Attached Property

DrawingDimension Attached Property

Anonymous
Not applicable
366 Views
4 Replies
Message 1 of 5

DrawingDimension Attached Property

Anonymous
Not applicable
I have a VBA program running as a macro to create parts, drawings and assemblies from template objects. There is a portion of code in which I am deleting unattached dimensions from drawings. The code is below and essentially comes straight from the Samples section of Programming Help.

What appear to be incorrect is that the attached property for any given dimension in the drawingdimensions collection evaluates to true (I confirmed this by stepping through the code) but when I access the drawing through the normal Inventor interface, dimensions will show as unattached. Other than the fact that the dimension attached property evaluates to True, the code runs without error.

Any help? Thanks.

'Loop through and delete all unattached dimensions
For Each objDwgDim In objSheet.DrawingDimensions
If objDwgDim.Attached = False Then
objDwgDim.Delete
End If
Next
0 Likes
367 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
I just tried this and the property does seem to return False for unattached
dimensions (shown in pink in the user interface). Do these unattached
dimensions show up in pink in your drawing? If so, would it be possible for
you to send me the data files? (sanjayDOTramaswamyATautodeskDOTcom)

Sanjay-

wrote in message news:5039087@discussion.autodesk.com...
I have a VBA program running as a macro to create parts, drawings and
assemblies from template objects. There is a portion of code in which I am
deleting unattached dimensions from drawings. The code is below and
essentially comes straight from the Samples section of Programming Help.

What appear to be incorrect is that the attached property for any given
dimension in the drawingdimensions collection evaluates to true (I confirmed
this by stepping through the code) but when I access the drawing through the
normal Inventor interface, dimensions will show as unattached. Other than
the fact that the dimension attached property evaluates to True, the code
runs without error.

Any help? Thanks.

'Loop through and delete all unattached dimensions
For Each objDwgDim In objSheet.DrawingDimensions
If objDwgDim.Attached = False Then
objDwgDim.Delete
End If
Next
0 Likes
Message 3 of 5

Anonymous
Not applicable
I am running a macro to move orphaned dimensions to a new layer, but am finding that orphaned holenotes show the attached expression equals true. Yet when I move the orphaned holenote in my drawing it turns pink. General Dimensions do not seem to have this issue, ie. if I dimension a hole diameter with general dimension, then suppress the hole, the attached expression equals false.
Any help would be appreciated.

I am using IV11 SP2.
0 Likes
Message 4 of 5

Anonymous
Not applicable
It is inadvertent that hole notes currently appear in the API as drawing
dimensions. It would not be advisable to rely on this behavior since this
could be "fixed" in the future (could be as soon as the upcoming release).
There isn't any other way to access hole notes, but it will be provided in a
future release. I understand that this doesn't help you for now. Sorry.

Sanjay-
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thank you Sanjay.
Mike
0 Likes