Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello dear friends,
I am trying to find out the orientation (top, front, right), where the width x height is at their max. So with the help of Forum I wrote this function:
Sub findOrient()
MaxX = Round(Measure.ExtentsLength, 0) 'X
MaxY = Round (Measure.ExtentsWidth,0) 'Y
MaxZ = Round(Measure.ExtentsHeight, 0) 'Z
If MaxOfMany(MaxX, MaxY, MaxZ) = MaxX Then
If MaxY > MaxZ Then
oOrient = kFrontViewOrientation
Else
oOrient = kTopViewOrientation
End If
elseif
.... pattern
end if
end sub
oOrient is global function.
On assembly level and part level, this function does, what it should, but when I loop through part on assembly level, I cann't make it work. I tried to open referenced document, and use the function:
For Each oRefDoc As Document In oDoc.AllReferencedDocuments
oControlDoc = ThisApplication.Documents.Open(oRefDoc.FullFileName, True)
oControlDoc.Activate
Call oOrient()
Next
Externalrule on the other hand, gives satisfying results, but sadly I don't know how to access that Info.
There is probably a way using Namevaluemap objects, and sending value back to main program, but after few attempts, I gave up.
Could someone help me?
Solved! Go to Solution.