- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm dynamically creating some sweeps based on paths. The sweeps are getting created and loaded into the main revit Document as families.
For straight lines, this works fine, but for an Arc, something weird is happening and I can't figure it out. I'm almost sure it has something to do with the input for the SketchPlane in the NewSweep() method, but I haven't been able to solve what the right plane orientation is or how to built it. I tried using the XDirection and YDirection of the Arc object, and also looked at this post:
https://forums.autodesk.com/t5/revit-api-forum/error-using-familycreate-newsweep/td-p/6941973
but it didn't help to use the same method as in the post for creating the SketchPlane.
So far the code is:
arc_plane = Plane.CreateByNormalAndOrigin( XYZ.BasisZ, XYZ.Zero)
arc_sketchPlane = SketchPlane.Create(fdoc, arc_plane)
sweep = fdoc.FamilyCreate.NewSweep( True, arc_path, arc_sketchPlane,
profile, 0, ProfilePlaneLocation.Start)
return sweep
Everything seems to be in order but the SketchPlane, and this is the result I get, where the arc is created but it is skewed on the XY plane:
(attached below are images from a 3D View and a Plan view, with marks as to the desired result in red)
Solved! Go to Solution.