- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Greetings,
I am trying to control the location of the viewport title label after placing it on an assembly sheet via API for Revit versions pre-2022.
After placing a viewport on assembly sheets the title labels for detail views elevation front and elevation left are consistently placed off the sheet as shown in attached snapshot.
Thinking that maybe it was the view CropBox that defines the offset where the label is placed, I tried adjusting the CropBox for these views, both before and after placing the viewport for the view on the sheet with no effect.
I have looked through these Building Coder posts trying to find an answer to no avail:
- https://thebuildingcoder.typepad.com/blog/2013/10/exact-viewport-positioning-conceptual-design-autom...
- https://thebuildingcoder.typepad.com/blog/2015/10/sheet-to-model-coordinate-conversion.html
- https://thebuildingcoder.typepad.com/blog/2010/09/view-location-on-sheet.html
Any assistance is greatly appreciated.
The code for creating the front and left detail view/viewports
tg = TransactionGroup(doc, "Create Spool Sheet,View, and Schedules")
tg.Start()
t = Transaction(doc)
t.Start("sub")
adetailviewfront = AssemblyViewUtils.CreateDetailSection(doc, aid, efront, atempid, True)
adetailviewfront.Name = "ELEVATION FRONT"
dviewfrontvp = Viewport.Create(doc, sid, adetailviewfront.Id, XYZ(0, 0, 0))
t.Commit()
t.Start("sub")
dviewfrontvp.SetBoxCenter(dviewfrontxyz)
adetailviewleft = AssemblyViewUtils.CreateDetailSection(doc, aid, eleft, atempid, True)
adetailviewleft.Name = "ELEVATION LEFT"
dviewleftvp = Viewport.Create(doc, sid, adetailviewleft.Id, XYZ(0, 0, 0))
t.Commit()
t.Start("sub")
dviewleftvp.SetBoxCenter(dviewleftxyz)
t.Commit()
tg.Assimilate()
Solved! Go to Solution.