Assembly sheet viewport title label location

Assembly sheet viewport title label location

marcus.s.s
Enthusiast Enthusiast
887 Views
2 Replies
Message 1 of 3

Assembly sheet viewport title label location

marcus.s.s
Enthusiast
Enthusiast

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:

 

Any assistance is greatly appreciated.

 

viewtitle.png

 

 

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()

 

 

 

 

 

 

 

 

 

0 Likes
Accepted solutions (1)
888 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Are you able to modify the title label location in the desired manner manually through the end user interface?

 

Have you tried to analyse exactly which elements and properties are affected by such a modification?

 

With the results of such an analysis in hand, it might be straightforward to achieve the same modification programmatically through the API.

 

How to research to find a Revit API solution:

 

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-onto...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 3

marcus.s.s
Enthusiast
Enthusiast
Accepted solution

I've found the problem. For some reason the viewport as well as the viewport title location come in skewed when creating the view and the viewport in the same transaction.

 

Creating the viewport in a sub-transaction solved this.

 

A peculiarity, is that that it is only the AssemblyDetailViewOrientation.ElevationLeft and AssemblyDetailViewOrientation.ElevationFront views that have this issue.

 

Thanks for the reply though Mr. Tammik.

0 Likes