Hi @hieut1392. That is a nice thought, but I don't think it will be practical. That DrawingView.SetVisibility method can only work on one entity at a time, and a SurfaceBody object does not appear to be one of the objects that we can provide to that method directly. (I did do some testing to make sure.) One of the most challenging points in a code like that first one, is where it encounters the DrawingCurve.ModelGeometry property, because its value is just a generic Object type. That property has that type of value because it can return many different types of objects, depending on what type of document was directly referenced in the view, and what that specific piece of view geometry was based on. It could be sketch geometry, or work feature, assembly component geometry, assembly proxy stuff, curved outer surface profile/silhouette, etc. Likely the most common thing to expect, when the view is of a part, is an Edge object. If that is the case, then its 'parent' will be a SurfaceBody object. So, if you want to 'pick' the edge of the body, instead of specify the body by its name, then that part would be possible. But the part of the code where we turn the visibility of all the geometry in the view belonging to that body, is another story, and there are just a few options that I have ever seen. Setting each DrawingCurveSegment.Visible property to False (takes a long time), gathering them all into an ObjectCollection, then either select them and execute the command on them, or use the Sheet.ChangeLayer method on them. When doing the ChangeLayer route, we can create a new custom layer, then set its visibility to False, then set that geometry to that Layer. It's not the easiest to undo later though if needed, if you have done other things after that happened.
Unfortunately, we can not really modify the right-click menu to include additional functionality, without some serious complication, such as an Inventor add-in, because it involves customizing Inventor's user interface, and monitoring the 'events' of those custom things we add into it with our own event handlers, to support their functionality with our own code.
Have you considered: Create a custom DVR (DesignViewRepresentation) in the part, make sure it is 'active', then turn off the visibility of that body, so that DVR will record it, then save the part file. Then in the drawing of that part, set the view of that part to that DVR.
Wesley Crihfield

(Not an Autodesk Employee)