Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Retrieve Dimension from Assembly - Slow

johnster100
Collaborator

Retrieve Dimension from Assembly - Slow

johnster100
Collaborator
Collaborator

Hi,

I'm using the code from here:

https://adndevblog.typepad.com/manufacturing/2016/03/retrieve-sketch-dimension-of-part-document-insi...

 

to retrieve dimensions from an assembly. The issue is when i use it on a large assembly it's incredibly slow (can take up to 5 minutes) or sometimes Inventor just freezes indefinitely. 

 

i can check that dimensions are retrieveable by using:

oSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions(oView, oDCproxy)

 

and this line executes very quickly. But when i come to retrieve the dimension Inventor freezes

 

My assembly I'm retrieving from has lots of parts with derived sketches, so I'm wondering if it's something to do with that?

 

Is there another method i could try?

 

Any help would be appreciated, 

thanks,

John

 

 

0 Likes
Reply
469 Views
4 Replies
Replies (4)

WCrihfield
Mentor
Mentor

Are you trying to retrieve all retrievable dimensions from the model in the view, or just specific ones, or only from specific sub-assemblies/parts within the assembly shown in the view?  Are you trying to retrieve dimensions into every view within your drawing document with one run of the rule, or just one view per rule run?

If all views in your drawing are of the same main assembly, you can bypass getting the assembly document for each oView.ReferencedDocumentDescriptor.ReferencedDocument, and simply use ThisDrawing.ModelDocument near the top one time.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

johnster100
Collaborator
Collaborator

Hi,

i'm just trying to get one dimension. It's from a sketch that's shared to several other parts however, I think this is where the problem comes. 

 

From the one dimension constraint the GetRetrieveableDimension function returns a count of 27 dimensions. This will be due to the sketch being shared and some parts are patterened. 

 

I've also tried retrieving all the dimensions for the specific occurrence but this causes inventor to crash.

 

thanks,

John

0 Likes

WCrihfield
Mentor
Mentor

I haven't tried it yet myself, but I wonder if this method would work, instead of using the GetRetrievableDimensions() route?

oView.SetIncludeStatus(oObj, True)
oView.SetVisibility(oObj, True)

(Where oObj is the dimension you're trying to show in your drawing)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

johnster100
Collaborator
Collaborator

Hi,

I couldn't get that to work. 

 

Is there anyone at autodesk who i could send my files to for their opinion? (i'm not allowed to upload them to a public forum).

 

thanks,

John

0 Likes