How to locate orphaned Dimensions on Drawing Document

How to locate orphaned Dimensions on Drawing Document

Anonymous
Not applicable
1,890 Views
8 Replies
Message 1 of 9

How to locate orphaned Dimensions on Drawing Document

Anonymous
Not applicable

After looking thru the api, i'm finding it hard to get a list of orphaned dimensions.

I can get a list of all the dimensions...easy.

I've basically deleted a part from the assembly and now want to remove that dimension in a section view on the drawing document.

 

But looking / comparing the properties of a non-orphaned vs an orphaned shows nothing.

 

Is there an orphaned list?

Is there a color override switch somewhere?

Or can I somehow get the object that the dimension is trying to reference and check to see if it is valid or has a valid file reference...or something?

 

-Doug

0 Likes
Accepted solutions (1)
1,891 Views
8 Replies
Replies (8)
Message 2 of 9

Curtis_Waguespack
Consultant
Consultant

Hi

 

You can use If oDrawingDim.Attached = False for this.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


 

 

oDoc = ThisDoc.Document

'Delete all orphaned dimensions
For Each oDrawingDim In oDoc.ActiveSheet.DrawingDimensions
If oDrawingDim.Attached = False Then
oDrawingDim.Delete
End If
Next

 

EESignature

0 Likes
Message 3 of 9

Anonymous
Not applicable

yes, i looked into that, but i don't show that value working.

 

It's true for this dimension, the dimension is definately orphaned, the color on screen is magenta and if i try to re-attach via the GUI, it generates an error.

 

-Doug

0 Likes
Message 4 of 9

Anonymous
Not applicable

Do you know a way to re-attach them via the API.

 

Basically call the "Re-Attach Orphaned Annotations" in the menu system.

or

somehow make an entire copy of the dimension.

 

-Doug

0 Likes
Message 5 of 9

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi dgesler,

 

I found these, but have not tried to use them.

Please post back some sample code if you are successful.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com


 

 

'Auto-Reattach Annotation
ThisApplication.CommandManager.ControlDefinitions.Item("DLxAnnoReconnectCmd").Execute
'Auto-Reattach Orphaned Annotations
ThisApplication.CommandManager.ControlDefinitions.Item("DLxAutoReattachSickAnnotationsCmd").Execute

 

EESignature

Message 6 of 9

Anonymous
Not applicable

Thank you very much.

 

Yes, both do work... I haven't tried it as a service yet (Application.Visible = false)

 

but here is my code after locating the dimensions to re-attach

 

// works, but wanted individual control of dimensions, saved just in case select doesn't work when in non-GUI mode

//m_application.CommandManager.ControlDefinitions["DLxAutoReattachSickAnnotationsCmd"].Execute2(true);

foreach (Inventor.DrawingDimension d in reAttachList)
{
      Document.SelectSet.Clear();
      Document.SelectSet.Select(d);
      m_application.CommandManager.ControlDefinitions["DLxAnnoReconnectCmd"].Execute2(true);
}

 

-Doug

0 Likes
Message 7 of 9

Anonymous
Not applicable

Now I'm just wondering how the Attach Property is actually calculated.

 

My dimensions do not have a valid workpoint (the part with the workpoint is not even loaded in the assembly anymore).

 

Currently I know what dimensions need re-attached, but would like a generic function just to re-attach any orphaned ones, individually.

 

-Doug

0 Likes
Message 8 of 9

DeerSpotter
Collaborator
Collaborator

See we have an issue, i would like to use your code to re-attach the dimensions.

 

this is my situation:

 

1. as soon as we change a part to something bigger or smaller the dims lose there hold. we can reattach manually but it takes time. Will this code fix that?

 

regards,

Max

Image and video hosting by TinyPic
..........................................................................................................................
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
..........................................................................................................................


See My LinkedIn Profile
0 Likes
Message 9 of 9

Anonymous
Not applicable
the DLxAutoReattachSickAnnotationsCmd command is the equivalent to selecting "Re-Attach Orphaned Annotations"
0 Likes