The help file is not very helpful on this one. I tried a quick sample, and MoveToFolder is not working as I would expect.
I can put any value I want for the second parameter, and the body will not move folders. However, if I preselect the body, it will move the folder.
So here is an example. I want to move Structural Member1 to folder Cut-List-Item5. If I was the code below, nothing will happen. I can change the text to the parent folder, to name of the body, to the name of my first born, nothing will happen.
Dim swModel As ModelDoc2
Dim swApp As SldWorks.SldWorks
Dim featMgr As FeatureManager
Dim bStatus As Boolean
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set featMgr = swModel.FeatureManager
bStatus = featMgr.MoveToFolder("Cut-List-Item5", "Structural Member1", False)
But If I select the body I want to move. The code will work. Even if I put giberish in the second parameter.
bStatus = featMgr.MoveToFolder("Cut-List-Item5", "This is stupid", False)
Will return True!!
Thanks for your reply.
I tried to use MoveToFolder with gibberish in second argument too.
It's real... The body has moved as I would expect.
I have not known api to get parent folder yet.
But anyway my issue has been cleared.
Thanks a lot.