« AutoCAD 2010 DWG Export | Main | Filter for View and Phase »

September 22, 2010

Comments

Is it possible to get the origin of the area of the viewport that is non-annotative? In other words, each viewport has two boundaries. The outer one is a little bigger for the sake of including annotation. But the extent of the annotation boundary can vary from sheet to sheet. Furthermore, the sheet dynamically changes the boundary according to whether it finds annotations in this outer boundary. The result is that I cannot determine where the non-annotative crop region starts (on the sheet), as get_BoundingBox.Min gives the starting point of the outer crop box.

Dear Thomas,

Nope, sorry, I do not believe you currently have any access to this information.

Cheers, Jeremy.

I'm working on an app to duplicate a sheet (ie duplicate all views on a sheet and place them on a new sheet in the same place relative to the title block) I've got this working apart from the location of the copied views on the new sheet. They seem to have a mind of their own and end up all over the place.

The only difference to the above code is that i'm using GetBoxOutline() to get the outline cordinates for the View port and Viewport.Create() (both 2013 addition I think). Even adding in the offset value doesn't work as in one of my test sheets there are two viewports and one is moved up and one down in the copied sheet. so the placement error isn't uniform or even in the same direction for two view ports on the same sheet. I have no clue whats going on and any help would be great.

Has this been fixed in 2014? I still can't get this to work in 2013 unless someone has further ideas the offsets appear to be different for each viewport.

Dear Anthony,

Have you taken a look at the Revit 2014 copy and paste API, and especially the new DuplicateViews SDK sample?

Cheers, Jeremy.

Hi,

I havn't looked at 2014 yet either however I did find a way around this in 2013. It's a bit long and "hacky" but basicaly by placing the view ports as above and then working out what correction is need.

I did this by returning the Outline of both the new and reference viewports (using GetBoxOutline()) and then working out the distances between the min x and y points of the outlines and fixed points on their respective sheets (I used the View.Outline.Min.U (orV). I then used the difference between the distances to create a "bespoke" correction per placement.

I hope this makes some sort of sense.

Dear James,

That makes absolute sense, and sounds totally brilliant.

Congratulations on solving that!

Thank you very much for sharing and describing such an effective 'hicks-hack' :-)

Sorry, couldn't resist, hope you don't mind!

Cheers, Jeremy.

I don’t mind at all, I’m glad I could contribute something!

I'd just like to say thank you for all your blog posts here as they have been invaluable to me as I have been writing various addins for our company to use. I’m looking forward to migrating them all over to 2014 soon and seeing what I can do with the new futures... When our IT department final put 2014 on our system...

Thanks again,

James

:-)

Hi Jermey,

My requirement is very similar to placing legends from one sheet to another.I have come across James Hicks reply but my apologies that I could not really understand it.Can you please help me give an idea how to implement it.BTW,I am new to Revit API.

Thanks

Dear Madhuri,

To begin with, if you are new to the Revit API, I can recommend two things:

1. Take a look at the getting started material and all the tutorials to get a good hang of all aspects:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

2. In general, if a feature is not available in the Revit product manually through the user interface, then the Revit API will not provide it either.

Therefore, before thinking about possibly automating any task, it is important to explore the possibilities and develop an optimal solution through the user interface first. For that, I would suggest asking an application engineer, product usage expert, or product support for help on finding a suitable workflow and laying down best practices.

To address your need, I would not recommend trying to reproduce James' approach, if, as he says, it's long and "hacky".

A number of new view APIs have been added since that was written.

To start with, look at Steve Mycynek's and Scott Conover's classes at Autodesk University 2012 and 2013, respectively:

CP3133 - Using the Autodesk Revit Schedule and View APIs

DV1823 - A 2014 Update to the Autodesk Revit Schedule and View APIs

I hope this helps.

Cheers, Jeremy.

Dear Jeremy,
Hope You are fine
I'm trying to change the location of "Label Outline" in the viewport, In Visual studio I see Maximum point and Minimum point take the new values I set, But in Revit, no change!
Please Advice,

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource