Message 1 of 6
Update MoveFaceFeature Dimension
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning everyone,
I have found out how to place a move face feature object, although it is often glitchy. I am looking for a way to change how much the face is moved after a feature is already placed. It looks like I'm supposed to copy the definition of the feature, update it, and then set the feature to have that definition. This is however not working.
Does anyone know how I would do this?
Sub Main
'MUST BE RUN IN AN ASSEMBLY WITH COMPONENTS
Dim oFaces As New List(Of FaceProxy) 'CREATE LIST OF FACEPROXIES TO EDIT MOVEFACEFEATURES
For i = 1 To 2
oFaces.Add(ThisApplication.CommandManager.Pick(kPartFacePlanarFilter, "Select End Face" & i))
Next
For Each oFaceProxy As FaceProxy In oFaces
Dim oFrame As PartComponentDefinition = oFaceProxy.ContainingOccurrence.Definition
Dim oFace As Face = oFaceProxy.NativeObject
If oFace.CreatedByFeature IsNot Nothing 'IF FACE IS THE RESULT OF A MOVEFACEFEATURE
If oFace.CreatedByFeature.Type = ObjectTypeEnum.kMoveFaceFeatureObject
Dim oMoveFeat As MoveFaceFeature = oFace.CreatedByFeature
Dim oFaceDef As MoveFaceDefinition = oMoveFeat.Definition
oFaceDef.SetDirectionAndDistanceMoveType(5, oFace, True)
'TRY TO UPDATE OFFSET
Continue For
End If
End If
'IF NO MOVEFACEFEATURE DETECTED, CREATE ONE (THIS WORKS)
Dim oCollect As FaceCollection = ThisApplication.TransientObjects.CreateFaceCollection : oCollect.Add(oFace)
Dim oMoveDef As MoveFaceDefinition = oFrame.Features.MoveFaceFeatures.CreateDefinition(oCollect)
oMoveDef.SetDirectionAndDistanceMoveType(10, oCollect(1), True)
oFrame.Features.MoveFaceFeatures.Add(oMoveDef)
Next
End Sub