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: 

Setting CropBox for a 3D view with Revit 2018

20 REPLIES 20
SOLVED
Reply
Message 1 of 21
PeterLMann
2890 Views, 20 Replies

Setting CropBox for a 3D view with Revit 2018

I am getting a different result with 2018 than I was with 2017 and previous versions of Revit.

 

Dim oBBoxCropView As DB.BoundingBoxXYZ

' do some stuff to create required bounding box.

Dim V3D As View3D

V3D.CropBox = oBBoxCropView

 

The code for creating the bounding box results in an identical BoundingBox, but when applied to the view crop box, results in a very large max and min extent.

 

Has anyone else experienced this?

 

?oBBoxCropView

{Autodesk.Revit.DB.BoundingBoxXYZ}

    Max: {(43.355956267, 0.075662107, -0.100000000)}

    Min: {(21.252267057, -21.180810247, -1000.000000000)}

?V3D.CropBox

{Autodesk.Revit.DB.BoundingBoxXYZ}

    Max: {(43.355956267, 0.075662107, -0.100000000)}

    Min: {(21.252267057, -21.180810247, -1000.000000000)}

 

But with Revit 2018, using the same values for oBBoxCropView results in an invalid cropbox for the view.

 

?V3D.CropBox

{Autodesk.Revit.DB.BoundingBoxXYZ}

    Max: {(-1000000000000000019884624838656.000000000, -1000000000000000019884624838656.000000000, -0.100000000)}

    Min: {(1000000000000000019884624838656.000000000, 1000000000000000019884624838656.000000000, -0.120000000)}

20 REPLIES 20
Message 2 of 21
CaptainDan
in reply to: PeterLMann

I have also had this problem in Revit 2018. One of our addins crops a 3D view to the extents of a section box, which has worked in all prior versions of Revit until now (2018). The crop seems to be off by a variable amount depending on the location of the section box but it's not particularly consistent. It tends to be off by about 10 feet or so in X and Y directions...

Message 3 of 21
CaptainDan
in reply to: PeterLMann

Hi Peter,

 

After further investigation I've found that if I ensure that the new bounding box I assign to the View3D's cropbox has the same transform assigned to it as the original crop box then the crop is correct. In prior versions of Revit the Min and Max coordinates would stay the same after assignment to the CropBox property. However in Revit 2018 it appears that if the bounding box's Transform does not match the View3D's crop box, then Revit transforms the Min and Max values upon assignment to the CropBox property. Hard to tell if this was a silent fix to incorrect behaviour in prior versions or if it's a bug in Revit 2018....

Message 4 of 21
matthew_taylor
in reply to: CaptainDan

Hi @PeterLMann, @CaptainDan,

Have you tried to put a doc.regenerate at points in your code? Especially if you've just recreated the view.

There are a growing number of cases where a regen is required. A frustrating change, if that's what's going on.

 


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 5 of 21
PeterLMann
in reply to: matthew_taylor

Thanks Matthew, I tried this, but just causes Revit to crash sooner. Previously, my code finished and when I opened the view, Revit crashed.
Message 6 of 21
PeterLMann
in reply to: CaptainDan

Thanks Captain Dan, both the 3D view and the assigned crop box have the same extent, as I created the crop box from the 3D view, before changing the max and min extents. Have re-run the code, and confirmed that they are both the same.
Message 7 of 21
jeremytammik
in reply to: PeterLMann

Dear Peter,

 

Thank you for your report and sorry to hear the bad news.

 

Could you please provide a minimal reproducible case for me to pass on to the development team for further analysis?

 

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

 

In order for the development team to reproduce and analyse the issue, a minimal sample model and a macro or two demonstrating the problem wiold be optimal.

 

You say that a call to regenerate makes Revit crash sooner; that sounds like a different issue. In the first, you say that the crop box settings differ. Can you please include a separate macro to also demonstrate that crash?

 

Thank you!

 

Best regards,

 

Jeremy



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

Message 8 of 21
PeterLMann
in reply to: jeremytammik

Thanks Jeremy, I will upload a test case. I agree that the crash is a separate issue, probably caused by trying to open the invalid view created.

Best regards Peter
Message 9 of 21
PeterLMann
in reply to: jeremytammik

Thanks Jeremy, I will upload a test case. I agree that the crash is a separate issue, probably caused by trying to open the invalid view created.

Best regards Peter
Message 10 of 21
jeremytammik
in reply to: PeterLMann

Dear Peter,

I see the following file attached to the ADN case 13049014 [Setting CropBox for a 3D view with Revit 2018]:

 

  • 69675 Jun 14 10:33 CodeBook_TestCase.zip

 

It includes some VB code.

 

However, I see no reference whatsoever to anything related to the Revit API.

 

Are you sure you attached the right file?

Best regards,

Jeremy



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

Message 11 of 21
PeterLMann
in reply to: jeremytammik

Hi Jeremy, I have re-uploaded the sample. This contains a vb project that can be loaded as an add-in to Revit and when run, will demonstrate the issue.
Message 12 of 21
jeremytammik
in reply to: PeterLMann

Dear Peter,

 

Thank you for the reproducible sample.

 

I logged the issue REVIT-115510 [different result setting CropBox for a 3D view with Revit 2018 -- 13049014] with our development team for this on your behalf as it requires further exploration and possibly a modification to our software. Please make a note of this number for future reference.

 

You are welcome to request an update on the status of this issue or to provide additional information on it at any time quoting this change request number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team, and prioritised against all other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

Cheers,

 

Jeremy



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

Message 13 of 21
PeterLMann
in reply to: jeremytammik

Hi Jeremy,

Is difficult to put a revenue implication. It affects a key function in our software, and so I have had to disable this option and in the release notes will need to suggest that people remain with Revit 2017 if they want to be able to use the function. This will affect a few hundred users.

CodeBook creates view sheets of each room in a project, with elevations and schedules. And creates a 3D view and includes this on the sheet. It also creates 3D views that from which it creates jpgs that can be included in word document reports and using our report generator.

Best regards
Peter

Peter L Mann RIBA FIAP
CodeBook International Ltd. St Clere, 15 Deepdene Wood, Dorking, RH5 4BG, UK
www.CodeBookInternational.com tel: +44 1306 877 513 mobile: +44 7979 805 609


Message 14 of 21
jeremytammik
in reply to: PeterLMann

Dear Peter,

Thank you for your update and business case.

 

I added them to the issue REVIT-115510 [different result setting CropBox for a 3D view with Revit 2018 -- 13049014] to make the development team aware of its importance.

 

Cheers,

Jeremy



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

Message 15 of 21
jeremytammik
in reply to: PeterLMann

Dear Peter,

 

Thank you for your patience.

 

The development team are analysing your issue REVIT-115510 [different result setting CropBox for a 3D view with Revit 2018 -- 13049014] and say so far:

 

  1. This may be a side effect to the adjustments made in January 2016 which were not seen by users until 2018 released.

 

I hope we can find a workaround or advice for Peter regarding what setting produces the effect he wants, and perhaps we need to add some API coverage for different scenarios.

 

  1. From a UI behaviour perspective, I don't see a different in behaviour between 2017 and 2018 (when I run the embedded macro).

We will need to assess this issue.

 

Can you provide more detailed information on the difference in behaviour between 2017 and 2018 that I can pass on to them to clarify the problem?

 

Remember that the development team does not have an add-in development environment at hand, or RevitLookup installed.

 

Maybe your macro could include a couple of lines of code to print out the problematic values and ensure that they are not overlooked.

 

Thank you!

 

Cheers,

 

Jeremy



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

Message 16 of 21
sobon.konrad
in reply to: jeremytammik

Jeremy,

 

Section Box in Revit 2018 is indeed not working. I am having the same experience as fellas above. Code that used to work just fine in 2017 is not working in 2018. There are no errors or warnings, so I am not really sure what the issues are. My section box values look ok when I am debugging, transactions all complete, but when I open the view created, section box is off in space, even though its BoundingBox min and max would indicate that it's located properly. It's all very strange behavior. 

Ps. It is a business loss for us, just like for people above. We have 100s of users not being able to use our plug-in anymore. 

Message 17 of 21
jeremytammik
in reply to: sobon.konrad

Dear Konrad,

 

Thank you for your note and sorry for the inconvenience.

 

The development team are aware and have addressed the issue, with the db entry number REVIT-116470.

 

It will appear in some update release. Unfortunately I cannot say for sure exactly when yet.

 

Cheers,

 

Jeremy



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

Message 18 of 21
Lewis.Dave
in reply to: jeremytammik

Jeremy,

 

Do we have an update on the fix release for the 3D crop box as yet?

 

We use the CodeBook software here at NBBJ as as Peter refers to utilise this to automate 3D views onto 1000's of sheets per project increasing our efficiency 10 fold, without this working correctly we have to manually create each 3D view onto each sheet increasing time and affecting revenue/profit margins.

 

This feature is a big part in our delivery to clients, so not only does this affect our internal workload, if we have to retract on our delivery process/promise on projects across both the UK and US this will have an adverse affect on client relationship and future projects.

 

Any update would be appreciated.

 

Dave Lewis, NBBJ Architects

Message 19 of 21
CaptainDan
in reply to: Lewis.Dave

Hi people,

 

Just thought I'd check in to see if anyone else tried the workaround (that worked for me at least) for this bug?

 

What I originally did (and what worked in prior versions) was create a new BoundingBoxXYZ, set the min and max appropriately and assign this to the CropBox of the section.

 

In Revit 2018, after playing around with the same code I found that as long I additionally set the transform of this new BoundingBoxXYZ to be the same transform that the original CropBox has, then the Min and Max don't change and appear correct. I haven't had any issues since this workaround and the tool that uses this code has been in use for some time now in our workflows without issue. Is everyone sure they're setting the Transform property appropriately?

Message 20 of 21
PeterLMann
in reply to: CaptainDan

Thanks for the feedback Dan, you are right, if I change

Dim oBBoxCropView As DB.BoundingBoxXYZ = V3D.CropBox

To the following, the extent is set correctly within my test sample, I will see what happens in my main application.

Dim oBBoxCropView As New DB.BoundingBoxXYZ
oBBoxCropView.Transform = V3D.CropBox.Transform



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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community