Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am trying to get the updated range box of a part after it has been edified.
but my returned results are always, the dimensions before entering a sketch.
If I edit the extrusion, then the returned values update as expected
My guess is it cant capture the updated the geometry on exiting the sketch, I also tried throwing in various part.Updates before printing the value but no luck.
any suggestions would be great!
I am just working in the vba editor right now, I have just a form with the following:
In the module I have declared:
Dim WithEvents ae As ApplicationEvents Dim WithEvents PE As PartEvents Dim p As PartDocument
on form load I have:
Private Sub UserForm_Initialize() Set ae = ThisApplication.ApplicationEvents Set p = ThisApplication.activeDocument Set PE = p.ComponentDefinition.PartEvents End Sub
I have been messing around with these two calls, but the returned value is always an edit behind
Private Sub ae_OnNewEditObject(ByVal EditObject As Object, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum) If BeforeOrAfter = kAfter Then Debug.Print "eidt object.." & p.ComponentDefinition.RangeBox.MaxPoint.X End If or Private Sub PE_OnSurfaceBodyChanged(ByVal Context As NameValueMap, ByVal BeforeOrAfter As EventTimingEnum, HandlingCode As HandlingCodeEnum) Debug.Print "surface change.." & p.ComponentDefinition.RangeBox.MaxPoint.X End Sub
Was my reply Helpful ? send a Kudos or accept as solution
Solved! Go to Solution.