Message 1 of 4

Not applicable
03-13-2019
08:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi! I am a new user in the api of revit
I am trying to create a image of a room to insert this in a sheet
At the beggining I star with boundering to obtain a 3dView but I didn't get a good perspective with this code:
ViewFamilyType viewFamilyType = (from v in new FilteredElementCollector(doc). OfClass(typeof(ViewFamilyType)). Cast<ViewFamilyType>() where v.ViewFamily == ViewFamily.ThreeDimensional select v).First(); using (Transaction t3d = new Transaction(doc, "crop")) { t3d.Start(); View3D view = View3D.CreateIsometric(doc, viewFamilyType.Id); view.HideElements(hidewallId); view.HideElements(hidegridId); //view.HideElements(hidesectionId); view.HideElements(hidelevelId); BoundingBoxXYZ box = room.get_BoundingBox(view); XYZ maxbox = box.Max; XYZ minbox = box.Min; view.CropBox = box; view.CropBoxActive = true; //view.CropBoxVisible = true; view.Scale = 50; Viewport.Create(doc, sheet.Id, view.Id, a1p3); t3d.Commit(); }
The result is:
I can't get with this a view inside of the room... maybe it's not possible or i have to use the camera class, but I don't find how use it. Someone can help me.
I want to get something like the next image
Thanks you and best regards
Lorena
Solved! Go to Solution.