Hi YaroslavSin,
Thank you very much for the example, that was exactly what helped me a lot.
I always looked in the “Features” chapter but couldn’t find “GetFeatureByName()”.
Now I will try how I can find the last feature in the model tree.
I also noticed that there can't be a space in the "name".
GetFeatureByName("Fase 1")
"Chamfer 1" is not found because it contains a space.
gSession.SetConfigOption("regen_failure_handling", "resolve_mode")
Set solidModel = gSession.CurrentModel
Set feat = solidModel.GetFeatureByName("length")
Set aktFeat = solidModel.GetFeatureByName("profil3")
Set reorderOperations = New CpfcFeatureOperations
Set afterFeatOps = feat.CreateReorderAfterOp(aktFeat)
Call reorderOperations.Append(afterFeatOps)
Call solidModel.ExecuteFeatureOps(reorderOperations, Nothing)
Call solidModel.Regenerate(Nothing)
Set gOWindow = gSession.CurrentWindow
goWindow.Activate
goWindow.Repaint
goWindow.Refresh
Call gSession.SetConfigOption("regen_failure_handling", "no_resolve_mode")
Translated by the Community Moderation using Google Translate
-----------------------------------------------------------------------------------------------
Hi @YaroslavSin
vielen Dank für das Beispiel, genau das hat mir sehr geholfen.
Ich hab immer im Kapitel "Features" gesucht, aber kein "GetFeatureByName()" gefunden.
Nun werden ich versuchen, wie ich das letzte Feature im Modellbaum finden kann.
Habe auch festgestellt, dass im "namen" kein Leerzeichen sein darf.
GetFeatureByName("Fase 1")
"Fase 1" wird nicht gefunden, weil ein Leerzeichen enthalten ist.
gSession.SetConfigOption("regen_failure_handling", "resolve_mode")
Set solidModel = gSession.CurrentModel
Set feat = solidModel.GetFeatureByName("laenge")
Set aktFeat = solidModel.GetFeatureByName("profil3")
Set reorderOperations = New CpfcFeatureOperations
Set afterFeatOps = feat.CreateReorderAfterOp(aktFeat)
Call reorderOperations.Append(afterFeatOps)
Call solidModel.ExecuteFeatureOps(reorderOperations, Nothing)
Call solidModel.Regenerate(Nothing)
Set gOWindow = gSession.CurrentWindow
gOWindow.Activate
gOWindow.Repaint
gOWindow.Refresh
Call gSession.SetConfigOption("regen_failure_handling", "no_resolve_mode")