Good day.
I need to scale my sketch.
When I use this code:
contour = rootComponent.sketches.item(0) scales = rootComponent.features.scaleFeatures scaleFactor = adsk.core.ValueInput.createByReal(1.4) inputEntity = adsk.core.ObjectCollection.create() inputEntity.add(contour) basePt = contour.sketchPoints.item(0) scaleUniformInput = scales.createInput(inputEntity, basePt, scaleFactor) scaleUniform = scales.add(scaleUniformInput)
I want to scale sketch in 140%, but I get sketch consists from two parts. First is the same sketch, second is much bigger than 140%. In UI Scale value 1.4 works correctly.
What I have to do for getting only resulting sketch, and what I have to set ValueInput to zoom sketch in 140%?
Also, there is no way to scale meshbody, is there?
I just tested your code with the current release and don't see the same behavior that you're describing although I do see a different problem where the resulting scaled sketch doesn't result in a profile. I get the same behavior when I do the scale interactively. I also tested it using latest update which is scheduled to go live this weekend, (except for the Mac App Store version, which will be a bit later). Anyway, with this version I get a good result, so it looks like some fixes have been made in the scale feature. I suggest waiting for the update this weekend and see if that solves the problem you're having.
Thank you. You are completely right. It works correctly with new update.
Please, suggest me, are there methods to scale and/or move meshbody? Similar to methods for sketch.
That's great news. Thanks for letting me know.
And regarding your other question about scaling and moving meshbodies; Fusion only supports the manipulation of mesh bodies in non-parametric environments. That is you can only import and manipluate mesh bodies if the document is set to not capture design history, the mesh is in a base feature within a parametric design, or the mesh is in a form feature. The API does support the first of the three because you can work in a document that id not capturing design history, however when I try to create a move or scale feature on the mesh body I don't get any errors but the mesh body is not changing either. I'll log a defect for this.
For the case where the mesh body exists within a form or base feature, we still need more API to be able to manipulate anything that's owned by either of those features.
I have to take one thing back that I said. The Scale feature is working as expected on a mesh body. In my original test, the mesh body I created was in a base feature, not in a regular component. When I created the mesh in a regular component within a non-parametric design, scale is working. Move still isn't working and I'll log a bug for that.
Can't find what you're looking for? Ask the community or share your knowledge.