How to use isOrientationAlognPath properly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having trouble using the python API to set the Orientation of a path pattern to "Path Direction".
I have a body that I am patterning along a path (3d curve). The body should be oriented with the path - not the default "Identical" option.
I have tried using both the PathPatternFeatureInput and the pathPatternFeaturesInput. The feature input I can't seem to create properly (object and attributes appear to be set but the path feature is not made), while the features input will create a feature but won't have the proper orientation as specified.
I believe I've seen some feature options access through the UI API, is there a solution using the ui feature dialog?
Any guidance would be helpful!
The code below yields an error that the "path_input" is not a PathPatternFeatureInput, yet the path_input classType is a PathPaternFeatureInput...
path_input = adsk.fusion.PathPatternFeatureInput
path_input.inputEntites = inputEntites
path_input.path=path
path_input.quantity = quantity
path_input.distance = patternDistance
path_input.patterDistanceType = adsk.fusion.PatternDistanceType.ExtentPatternDistanceType
path_input.isOrientationAlongPath = True
pathPattern = root.features.pathPatternFeatures
pathFeature = pathPattern.add(path_input)
I've also tried using a pathPatternInput which creates the feature but does not set the orientation as I would expect.
# Create the input for path pattern
pathPatterns = root.features.pathPatternFeatures
pathPatternInput = pathPatterns.createInput(inputEntites, path, quantity, patternDistance, adsk.fusion.PatternDistanceType.ExtentPatternDistanceType)
#set orientation
pathPatternInput.isOrientationAlongPath = True
# Create the path pattern
pathFeature = pathPatterns.add(pathPatternInput)