« AU Day Two | Main | Export Solid to ACIS »

December 05, 2011

Comments

Thanks for publish my question and solution. And of course for your help.

Thanks for the ParameterUnitConverter code. I have used it successfully in my applications and now I'm upgrading to 2014 and I'm getting two Errors at the following lines:

FormatOptions fo = document.ProjectUnit.get_FormatOptions(ut);


DisplayUnitType dut = fo.Units;

I'm trying to understand how the new units classes should be used instead but I'm having some trouble with getting this to work. Can you please help me?

Dear Caroline,

Yes, indeed, the unit handling has been completely overhauled in the Revit 2014 API.

Have you looked at the What's New section in the Revit API help file? I normally discusses such changes.

Have you searched for occurrences of these methods in the Revit 2013 and 2014 SDK samples, and compared the differences there? That would provide an exact mapping from old to new.

Those are the two places I would start looking.

Unfortunately, the current pre-release does not include the most up-to-date SDK, but it will be posted any day now on the ADN web site.

Cheers, Jeremy.

Thanks Jeremy I'll follow up those leads.

Caroline

Hi Jeremy,

I checked out your leads and found that the method GetDisplayUnitType does the trick. So this little correction gets it rolling again

//FormatOptions fo = document.ProjectUnit.get_FormatOptions(ut);
Units units = document.GetUnits();
DisplayUnitType dut = units.GetDisplayUnitType();

I suspect that ParameterUnitConverter could be simplified or even replaced with some of the new methods but it will have to be another day for me to check this out. Thanks again.
Caroline

Dear Caroline,

Thank you for your appreciation. I am very glad to hear it worked!

Cheers, Jeremy.

Dear Jeremy,

Can you advice, please, how to put Lighting Load Density and Power Load Density by API

Thanks

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