« Ribbon Tab Context Toggle | Main | Debugging in Visual Studio 2010 Express »

July 26, 2010

Comments

Hi, Jeremy:
First , Thank you for your reply to the interference question. It's so encouraging. I'm not single in the battle.
Second , I have a new problem , How to create In-place Family Instance programly?

Dear Zhu Xiaomeng,

I am sorry to say that there is no API access to create an in-place family.

You can however create a new family document in memory using the Application NewFamilyDocument method, populate that with the required elements, and load an instance of it into your project, all without ever saving it to disk.

Cheers, Jeremy.

Jeremy,

I'm going to modify my old RevitIniFileEntries console routines to open the .addin file and replace the hardcoded path with the [InstallLocation] of an AddIn. This is a workaround because nobody can tell me how to use the RevitAddinUtility.dll in a console app to write the .addin file directly from within an installer. the example uses a Windows form app with buttons, which is totally useless for installations (where the RevitAddinUtility.dll needs to be used). I'll let you know when it's done.

Dear Jim,

Please have a look at the discussion in the comments section of

http://thebuildingcoder.typepad.com/blog/2010/05/revitaddinutility-for-32-and-64-bit-systems.html

From that, I get the strong impression that the RevitAddinUtility.dll can be used perfectly well from any kind of .NET application, including an installer and a console app.

Still, if you prefer going your own way, I will be very interested to hear and see the results, and of course share them with the community if that is what you would like.

Thank you!

Cheers, Jeremy.

Jeremy,
I have tried using this addin template, Is it possible to use it to create .addin files as a process or is it just a reference material to show how to use it? I noticed it allows me to save the project as something else, but i can't seem to get the newly generated addin file to run or show up when i launch revit! I wonder if I am missing something which i should know about?

Dear Jenny,

I suggest that anybody who wants to make use of these templates first learn the basics of creating and installing and launching and debugging a minimal Revit add-in by hand. You can learn the basics of the Revit API very efficiently by downloading the Revit SDK, looking at Chapter 2, Walkthroughs, and working through the DevTV recordings. All of these are available on the Revit Developer Center:

http://www.autodesk.com/developrevit

That will answer all your questions much more completely than I can do here.

Please also note that I later posted my personalised updated versions of the DevTV templates:

http://thebuildingcoder.typepad.com/blog/2010/10/revit-2011-devtv.html

Cheers, Jeremy.

Dear Jeremy,
thank you very much for this template, it really helps making the process smoother.
one problem though, i converted a while ago to Visual Studio 2010 and the template does not work with it anymore.
i have followed the template migration guideline(http://msdn.microsoft.com/en-us/library/cc512930.aspx)
the the VS conversion wizard can't seem to find the "Microsoft.VsSDK.targets" files!!
i would really appreciate your help in this matter

Dear Alvares,

I asked Augusto, who originally created these templates, and he says:

The template should work ‘as is’, and it does.

All you have to do is copy the .zip files from:

My Documents\Visual Studio 2008\Templates\ProjectTemplates\Visual C#

To:

My Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#

The same obviously applies for VB.NET.

Cheers, Jeremy.

Jeremy,

Thank you very much for providing the DevTV Add-In Templates. I'm still struggling just a bit with them to get them to fully work properly.

At work we exclusively have Revit 64-bit only and when I utilize the template- I have to keep changing the paths that are default to the debugging location for Revit.exe as well as the reference locations to the RevitAPI.dll and RevitAPIUI.dll.

when I look at the TemplateRevitCS.csproj that is a part of the .zip package, I see this as:

$(ProgramFiles)\Autodesk\Revit Architecture 2011\Program\Revit.exe

But whether I keep it as the above or change it to...

C:\Program Files\Autodesk\Revit Architecture 2011\Program\Revit.exe

The debug location still comes up as C:\Program Files (x86)\Autodesk\Revit Architecture 2011\Program\Revit.exe

But in reality my location is:

C:\Program Files\Autodesk\Revit Architecture 2011\Program\Revit.exe

So once I utilize the template - then go to Project - Properties - Debug section and manually browse to that location then the project debug location is fine.

Then I have to go to the Reference section of my solution - where I see RevitAPI and RevitAPIUI with a yellow exclamation mark and have to re-assign such as well to C:\Program Files instead of C:\Program Files (x86).

You can also note as part of looking at the .csproj file provided - it shows:


False
$(ProgramFiles)\Autodesk\Revit Architecture 2011\Program\RevitAPI.dll
False

Which above is stating that its 32-bit via the x86. So I thought I could merely change the x86 to x64 and save the file but that didn't work successfully either.

Could you either re-post adjustments to the template files to get it to work with an exclusive install of 64-bit Revit? I'm just learning and do not know how to correctly edit such templates for Visual Studio?

For some reason it was cut off but...
but right above where RevitAPI.dll is declared it lists...

Reference Include="RevitAPI, Version=2011.0.0.0, Culture=neutral, processorArchitecture=x86"

and the x86 would designate 32-bit only.

Dear Stephen,

I do not understand this second comment of yours. Do you mean to say that you found a solution? If so, what is it? If not, what are you saying, please?

Cheers, Jeremy.

No sorry about that - I still do not have a solution.

I was trying to show you what was inside the TemplateRevitCS.csproj template file for Reference Include = but it got cut off because of the less than/greater.

So I tried to remove the symbols so that the statement would appear on your blog. But please take a look at the text file and note where TemplateRevitCS.csproj has the statement of reference include =

I'm not familiar with editing template files but perhaps Augusto could create another for one who has 64-bit Revit installed only? The point I was making that its more than just changing locations of the files but processorArchitecture would also need to be changed to 64-bit as well.

OK, I did eventually find a solution to my problem where I do not have 32-bit Revit version installed but only 64-bit Revit.

After downloading the winzip file above...

1.) extract the contents
2.) Within the .csproj file...
a.) do a find/replace on $(ProgramFiles) and replace with C:\Program Files
b.) find any instances where processorArchitecture=x86 and replace with processorArchitecture=x64

3.) delete the old winzip file
4.) finally create a new .zip that combines all the files completed.

My initial problem was that I forgot to delete the original winzip even though I made the appropriate changes.

Dear Stephen,

Congratulations on solving this!

Thank you very much for the explanation!

It sounds pretty straightforward, in the end. I guess it mostly does, once you know how it goes. And of course you made it extra hard for yourself :-)

If you would like to send me your resulting template zip file, I can add it to the post.

Thank you!

Cheers, Jeremy.

Hi Jeremy,

Do you have the template for Revit 2012?
Can the current template be used in 2012?

thanks

Marcelo

Dear Marcelo,

Thank you for a very pertinent question.

I already answered it:

http://thebuildingcoder.typepad.com/blog/2011/04/visual-studio-add-in-wizards-for-revit-2012.html

Cheers, Jeremy.

Hi Jeremy,

I really need your help, I am currently starting to learn Revit Architecture 2011.

I dont have anything in my addins,

So this could be my problem why there are a lot of missing tabs in my revit.

i.e. There's no "workset" and "design options" in my "visibility/graphic overrides" dialog box.

Hope you can help me with this.

Hi Jeremy,

I got the 2012 template, and it seems to be working. However, after every change in my code I need to close Revit, build again my code, and re-start Revit. Although the manifest file is automatically created saving a lot of time and the cleaning function works, the re-building my code is taking too much time since I need to re-start Revit every time.

I'm new in the Revit API environment. Do you know how to avoid re-starting revit after every change in the code? It is really time consuming.

I have windows 7 64 bits, Revit is installed in C:\Program Files\Autodesk...... , and the addin Manager is install in C:\Program FIles (x86)\Autodesk\Add-In Manager for Autodesk Revit 2012. The previous version of the template (2011) said something about the path dependency of the template. Should I edit any path in the template? Should I save my projects always in MyDocuments\Visual Studio 2010\Projects?

If I solve this limitation I'll save a lot of time.

thanks, and happy late Eastern

Marcelo

Dear Gabby,

No, I cannot really help with that at all. It sounds to me as if you have some kind of installation or setup problem. I deal with the API and nothing but that.

Cheers, Jeremy.

Dear Marcelo,

The behaviour you are seeing is normal, I'm afraid (snafu).

I hope that all your questions are answered in full by this recent blog post:

http://thebuildingcoder.typepad.com/blog/2011/05/debugging-an-add-in-without-restarting-revit.html

Cheers, Jeremy.

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