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)
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