- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to just move the (End of Part) down one feature regardless of where it is in the browser using VBA? I already know how to move it all the way to the top, but can't figure out how to get it to move down one feature from where it is currently located regardless of the type of feature that it is? Seems like it should be simple, but I can't figure it out.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
It looks like this in regular iLogic.
Dim oDoc As PartDocument = ThisApplication.ActiveDocument Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition Dim oAfter As PartFeature Dim oBefore As PartFeature oDef.GetEndOfPartPosition(oAfter, oBefore) oAfter.SetEndOfPart(False)
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks, but I was looking for a solution in VBA. I tried to modify it for VBA but I don't know how to modify the last two lines. Not sure if the fourth line down is correct either.
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
Set PartComponentDefinition = oDoc.ComponentDefinition
Dim oAfter As PartFeature
Dim oBefore As PartFeature
oDef.GetEndOfPartPosition(oAfter, oBefore)
oAfter.SetEndOfPart (False)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here is the VBA version.
Public Sub Move_EOP_Down_1()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
Set oDef = oDoc.ComponentDefinition
Dim oAfter As Object
Dim oBefore As Object
oDef.GetEndOfPartPosition oAfter, oBefore
oBefore.SetEndOfPart (False)
End SubTo move the EOP down run it like shown.
To move the EOP up, switch the last line to:
oAfter.SetEndOfPart(True)
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks so much. I hate not being able to figure this out on my own. How did you know what to change?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Glad to have been of some service.
Just trial, error, researching other similar sounding posts, repeat...
I'm not as familiar with VBA as I am with iLogic, but it's not that bad to pick up as needed when we've got a great forum like this to reference.
Good luck in your future Inventor Customization pursuits. ![]()
Wesley Crihfield
(Not an Autodesk Employee)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report