Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto Retrieve Dimensions with ilogic

1 REPLY 1
Reply
Message 1 of 2
benjoefoe
804 Views, 1 Reply

Auto Retrieve Dimensions with ilogic

I found a bit of code online and I'd like to fit it in what I'm trying to do. What I have is multiple sheet metal parts on one page. I want this code to retrieve every dimension in every view on this page.

 

Here is the code I found. As you see in row 3 is it only retrieves the dimensions from "View 1" only. I need it to do multiple views

 

 

Dim oDrawDoc As DrawingDocument = ThisDoc.Document

 

Dim oSheet As Sheet = oDrawDoc.ActiveSheet

 

Dim oDrawView As DrawingView = oSheet.DrawingViews(1)

 

Dim oGeneralDimensionsEnum As GeneralDimensionsEnumerator

oGeneralDimensionsEnum = oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oDrawView)

Thanks, Ben

AutoDesk Inventor 2020 Certified
1 REPLY 1
Message 2 of 2
salariua
in reply to: benjoefoe

I would post this in Inventor Customisation forum.

 

I think you need to iterate trough all the views:

 

 

Dim oViews As DrawingViews

Dim oView As DrawingView

 

oViews = oSheet.DrawingViews

 

For Each oView In oViews

    'your code

Next

 

Edit:

Problem is: Once you retrived dimensions on one view they are not available to retrieve in the others (projections). So I would create base view then projections (always) and make the code process the views in order they ware created (don't know if possible). This way it gets as many dimensions possible in main view and whatever left (can't retrieve) in the others.

 

 

Edit:

Do a search on the web, I think it's been solved before.

 

http://forums.autodesk.com/t5/inventor-customization/retrieve-dimensions/td-p/3650292/page/2

 

http://forums.autodesk.com/t5/inventor-customization/retrieve-dimensions/td-p/3650292

 

 

Adrian S.
blog.ads-sol.com 

AIP2012-2020 i7 6700k AMD R9 370
Did you find this reply helpful ?
If so please use the Accepted Solutions or Like button - Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report