Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ScheduleSheetInstance bounding box

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
aignatovich
1552 Views, 7 Replies

ScheduleSheetInstance bounding box

Hi folks!

 

I have a little question.

 

I am trying to place schedules to the view sheet in a vertical chain. The result should be something like:

target.PNG

Actually there are 2 (or more) schedules. I've already achieved what I want. I retrieve bounding box on active viewsheet of each ScheduleSheetInstance and move insertion point for each schedule.

 

The problem is that ScheduleSheetInstance bounding box is a bit large than actual schedule table:

borders.png

I've draw borders with this python shell code:

shInst = selection[0] # a ScheduleSheetInstance should be selected to run this code

bb = shInst.get_BoundingBox(doc.ActiveView)

tx = Transaction(doc, "bounds")
tx.Start()

doc.Create.NewDetailCurve(doc.ActiveView, Line.CreateBound(bb.Min, XYZ(bb.Min.X, bb.Max.Y, 0)))
doc.Create.NewDetailCurve(doc.ActiveView, Line.CreateBound(XYZ(bb.Min.X, bb.Max.Y, 0), bb.Max))
doc.Create.NewDetailCurve(doc.ActiveView, Line.CreateBound(bb.Max, XYZ(bb.Max.X, bb.Min.Y, 0)))
doc.Create.NewDetailCurve(doc.ActiveView, Line.CreateBound(XYZ(bb.Max.X, bb.Min.Y, 0), bb.Min))

tx.Commit()

The distance is ~2.12 mm. I hardcoded this value in my code. It seems it works, but I don't know if it works in every possible cases.

 

 

So, the question is:

 

Is there any way to retrieve this value via API?

 

Thank you!

 

Cheers, Alexander

 

 

 

7 REPLIES 7
Message 2 of 8
jeremytammik
in reply to: aignatovich

Dear Alexander,

 

Thank you for your query.

 

How picky you are  🙂

 

I passed on the question to the development team for you.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 8
aignatovich
in reply to: jeremytammik

Thank you, Jeremy!

 

Sorry, I like good code and don't like magic constants Robot wink

Message 4 of 8
jeremytammik
in reply to: aignatovich

My pleasure! I like good code too! Just joking ...



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 8
aignatovich
in reply to: jeremytammik

Don't worry, I understand you are joking)

Message 6 of 8
jeremytammik
in reply to: aignatovich

Dear Alexander,

 

Thank you for your patience.

 

I heard back from the development team.

 

They absolutely confirm your current approach and provide the magic constant that you were looking for:

 

For a schedule instance in the sheet view, we add an invisible margin around the actual schedule table.

 

This margin will show up when selecting the schedule instance.

 

The margin width is a hardcoded value in the schedule code.

 

It is 1/12" which is around 2.12 mm.

 

Right now, there is no way to retrieve this value through API as it is not exposed yet.

 

I think it is safe to use this hardcoded value as it has been there and remained constant for years.

 

This is what the schedule instance margin looks like when selecting the schedule instance.

 schedule_instance.pngYou can see that the move control and the drag height control are showing at the margin bounding box.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 8
aignatovich
in reply to: jeremytammik

Thank you, Jeremy!

Message 8 of 8
jeremytammik
in reply to: aignatovich

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report