Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to get drawing dimensions for just one feature but it's not working.
Sub Main()
Dim refDoc As Document
Dim oFeatureName As String = "f1"
Dim oFeatureDimensions As FeatureDimensions
Dim oSheet As Sheet = ThisApplication.ActiveDocument.ActiveSheet
For Each oView As DrawingView In oSheet.DrawingViews
refDoc = oView.ReferencedDocumentDescriptor.ReferencedDocument
oFeatureDimensions = GetFeatDims(refDoc,oFeatureName)
If Not oFeatureDimensions Is Nothing Then oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oView,oFeatureDimensions)
Next
End Sub
Function GetFeatDims(ByVal oDoc As Document,ByVal oName As String) As FeatureDimensions
Dim pDoc As PartDocument
If Not oDoc.DocumentType = kPartDocumentObject Then Return Nothing Else pDoc = oDoc
For Each pFeature As PartFeature In pDoc.ComponentDefinition.Features
If pFeature.Name = oName Then Return pFeature.FeatureDimensions
Next
Return Nothing
End Function
Any ideas why?
Solved! Go to Solution.